cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@d-haven.org>
Subject Re: SQLTransformer makes Cocoon hang under high load
Date Thu, 30 Jun 2005 20:15:27 GMT
Fabrizio Sitzia wrote:
> Hello,
> 
> I'm developing a dynamic Cocoon webapp that performs a lot of (nested) queries
> using the SQLTransformer.
> 
> The SQLTransformer performs SELECT operations only, and it is configured to
> use a JDBC database connection pool that is managed by Cocoon itself.
> Excerpt from cocoon.xconf:
> 
>   <datasources>
>     <jdbc logger="core.datasources.db" name="db">
>       <pool-controller min="5" max="50"/>
>       ...
>     </jdbc>
>   </datasources>
> 
> 
> At some point, I decided to stress-test the webapp using the 'ab'-tool (Apache
> benchmark) to simulate a large number of concurrent requests.
> 
> When the number of concurrent requests is heading towards the 'max' number of
> pooled database connections, the following occurs:
> 
> - The 'ab' benchmark is aborted with a timeout error.
> 
> - Using a database monitoring tool, you will notice that the 'max' number of
> pooled database connections have been left open.
> 
> - Cocoon 'hangs' indefinitely!
> Any further requests to the webapp will timeout, and nothing gets written to
> the logs (access.log, error.log...)
> There are no warnings, nor any error messages in the logs that would indicate
> why the hang occured in the first place. Up to the hang, everything appears to
> run normally!
> 
> That's scary!

It sounds like SQLTransformer naively gets a new connection per query. 
This in turn requires that if your page has 4 nested queries then 
SQLTransformer is using 4 of your 50 connections.  It only takes 13 
simultaneous requests to use up all the connections at that rate, and if 
all your requests have anywhere between 1 and 3 connections reserved and 
are not finished yet, none of the pages will release the connection and 
a deadlock occurs.  If you have as many as 10 nested queries it is 
obvious to see how something like this could occur.

I think the ESQL logicsheet suffered from this many moons ago, but 
resolved it by requesting one connection per page.  BTW, Microsoft's 
feeble driver is limited to one connection per query--so your choice is 
to use jTDS or some other company's version.

Nonetheless, it seems like there is a bug in SQLTransformer.  Submit a 
bug report, and hopefully it can get resolved.

-- 
Design is a funny word. Some people think design means how it looks.
But of course, if you dig deeper, it's really how it works.

                                                        -- Steve Jobs

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message