tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GOMEZ Henri <>
Subject RE: Connector Pools and Downloads?
Date Mon, 16 Jul 2001 10:07:44 GMT
> Michael Rimov [] wrote :
>A while back I created a download manager so that I can provide customized 
>security, logging and management.  The download manager actually sends the 
>file through the servlet response after setting the appropriate content 
>types and length.  So far so good.....

>				The Problem

>This is causing a serious problem under heavy loads.  In the case of Resin,

>the Apache --> Resin connectors came from a fixed block of connections from

>a pool.  Since a multi-megabyte download can take a long time, the 
>connection pool can get filled up rather quickly, and all subsequent 
>servlet responses just crash, or hang for minutes at a time per request.

What do you call heavy load ? You can setup Tomcat to handle up to 
100 ajp13 threads (and even more) each one handling one download situation.
In that case you'll have 100 Apache forked childs forwarding download from
servlet engine to client (browser).

>				What to do?
>Since uploads and downloads seem to be a pretty common entity that people 
>desire for the servlet containers to do, I'm kind of at a loss on how to go

>about this.  AFAICT, the tomcat-->Apache connector is going to have the 
>same problems. [If I'm misreading this, I'd LOVE to be corrected! :-) (Also

>if it isn't a problem is this true for both ajp12 and ajp13? (and ajp14 to 
>be)? )]

You'll get the problem before that, at one time you Web-server (Apache or
other one) will have no more process available to handle the download. 

Imagine you setup Apache Web-server to have up to 250 childs (forked or
25*10. You set Tomcat to have also 250 ajp13/ajp14 threads available. 
The 251th client will be rejected by Apache Web-Server before even trying to
speak with Tomcat server :!

I suppose I can reference count the download manager and only allow so many 
downloads, but then people are going to go elsewhere instead of wait for a 
download to be available.

Don't forget that mod_jk support load-balancing and you could use 2 or more
Tomcat using ajp13/ajp14 behind your Apache Web-Server....

View raw message