tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Wang <>
Subject Re: Slow downloads through mod_jk on Windows XP
Date Mon, 07 May 2012 23:50:41 GMT
On 05/07/2012 06:06 PM, André Warnier wrote:
> Andy Wang wrote:
>> Hi all,
>> We've had a number of cases of people reporting to us that file 
>> downloads are slow when passed through tomcat and I've not been able 
>> to reproduce the problem on Linux but finally was provided a windows 
>> XP VM that was able to reproduce the problem.
>> This is Apache 2.2.22 and mod_jk 1.2.32 with tomcat 5.0.30 (yeah, I 
>> know this is ancient.  I'll try with something newer tomorrow).
>> I have two URLs configured both with an identical iso file (roughly 
>> 450MB) in size.
>> When I go through the URL configured to run directly through Apache 
>> the download speeds on the file are around 30MB/s which is reasonable 
>> for what I would expect on the network connection between the client 
>> and the web server.
>> The second URL is JkMount'ed through to tomcat and download the same 
>> file drops down to 5-6 MB/s (starts at 10-ish MB/s).
>> The one thing I haven't tried configuring is upping the ajp packet 
>> size because the version of tomcat I was provided doesn't support 
>> that, but otherwise the operating system is tuned so the 
>> TcpWindowSize is 131072.
>> Unfortunately, this is windows, and both apache and tomcat are local 
>> on the server so I can't sniff the packets between the two systems 
>> with wireshark.
>> I don't see anything on the mod_jk configuration 
>> that deals with buffer sizes.
>> Hoping someone has some ideas on what to look at that might help 
>> tweak this thing to perform similarly to Apache direct downloads.
> Considering your setup, it should not be too hard to set up a download 
> of the same file file directly from Tomcat (through its HTTP 
> Connector), to compare that with your two previous ways.  This way, 
> you could make sure if it is Tomcat, or the mod_jk/AJP link which is 
> the issue.
> Also, still considering your setup, it should be possible to configure 
> things so that these file downloads are handled directly by Apache 
> httpd, since that seems to satisfy your expectations.  mod_jk 
> "JkMount/JkUnMount" rules (*) should make that possible, no ?
> Have to be a bit careful not to introduce security holes, and I am 
> assuming that the files are static (which may be wrong here).
> (*) or the <Location ..> + "setHandler jakarta-servlet" configuration 
> variation
Thanks for the http connector idea.  I forgot about that.  The primary 
reason why i'm using tomcat to download a static file is really for 
testing purposes to confirm performance between mod_jk and direct 
apache.  we have servlets that stream content files that see the same 
massive performance hit so in our actual use case it's not static files 
:(.  I'm thinking this would be a valid test to help at least tweak 
mod_jk to it's potential.

We've checked and double checked the buffering code of the servlets and 
it all looks fine AND the performance is fine on Linux and the speed 
characteristics are identical to serving static files through tomcat + 
mod_jk so I'm hoping that it's an apples to apples comparison.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message