You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vijay Menon <vi...@hotmail.com> on 2010/10/14 01:35:14 UTC

Tomcat performance under low load

Hi all
Thanks for reading this post. 
We are currently having 2 requirements that are opposites. The first requirement is performance under high loads and the other one is equivalent performance for 1 request.
Our prod env currently uses Apache with mod_jk and ajp 1.3 to Tomcat 6.0.26 and jdk 1.6.0_18 on solaris.
We're scaling to satisfactory loads of 250 concurrent requests serving pages in 0.5 seconds.
The other test scenario is where the tomcat instance is kept idle and a single request is sent in every 90 or so seconds. In this case, the response takes about 8 seconds out of which about 6 seconds cannot be tracked.
As the result, what we're finding is that under high loads, it performs well but under very low loads, it does not.
This definitely happens in the tomcat layer as we've used the FastCommonAccessLogValve logger which gives the time for the request in Tomcat.
The connector properties are protocol="AJP/1.3" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" useBodyEncodingForURI="true".
I was wondering whether anyone would be able to help with this issue.
Thanks in advance
VM 		 	   		  

Re: Tomcat performance under low load

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vijay,

On 10/13/2010 7:35 PM, Vijay Menon wrote:
> We're scaling to satisfactory loads of 250 concurrent
> requests serving pages in 0.5 seconds.

Excellent (assuming that 0.5 seconds is acceptable to your team).

> The other test scenario is where the tomcat instance is kept idle
> and a single request is sent in every 90 or so seconds. In this case,
> the response takes about 8 seconds out of which about 6 seconds
> cannot be tracked. As the result, what we're finding is that under
> high loads, it performs well but under very low loads, it does not.

:(

> This definitely happens in the
> tomcat layer as we've used the FastCommonAccessLogValve logger which
> gives the time for the request in Tomcat.

I'd like to echo Chuck's suggestion: take Apache httpd out of the
equation and run your "load" test against Tomcat directly.

> The connector properties
> are protocol="AJP/1.3" maxThreads="150" minSpareThreads="25"
> maxSpareThreads="75" acceptCount="100" connectionTimeout="20000"
> disableUploadTimeout="true" useBodyEncodingForURI="true".

If you want your server to be as efficient as possible, you should use
an <Executor> which will allow the request processing threads to be
destroyed during times of low activity. It's not really that big of a
deal, but it's worth mentioning.

A couple more questions:

1. How large are the requests you are processing? Is the usage profile
the same for "high load" versus "low load" situations -- other than the
actual frequency of requests, of course.

2. Are you using a database of any kind? If so, can you post the
configuration for that (minus any sensitive information, of course)?

90 seconds would be a very low timeout for a database connection, but
it's possible that you have a bottleneck in your application that
somehow only appears when you're nearly idle.

3. Is some other process running on the server during these low-load
times? Maybe some cron job or heavy reporting operation or something?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky3HvUACgkQ9CaO5/Lv0PDK4gCeOJaCAXqQfB4C9EA0kYdrjRpt
0pAAn2EURuQAExb7lfBahaSdG5u2cshc
=Sw5F
-----END PGP SIGNATURE-----

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


RE: Tomcat performance under low load

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Vijay Menon [mailto:vijay_menon@hotmail.com] 
> Subject: Tomcat performance under low load

> The other test scenario is where the tomcat instance is kept 
> idle and a single request is sent in every 90 or so seconds.
> In this case, the response takes about 8 seconds out of which
> about 6 seconds cannot be tracked.

What do you measure if you send such requests directly to Tomcat, not via httpd?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Tomcat performance under low load

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vijay,

On 10/16/2010 6:42 PM, Vijay Menon wrote:
> Thanks for the replies. Based on that, we did change the connectors
> to use executor threads. However, based on profiling the app, it
> turned out to be a code issue.

Glad you solved your problem. Can you tell us what your app was doing
that caused it to perform poorly under only low load? That seems like an
interesting situation.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky8OeIACgkQ9CaO5/Lv0PBcOQCgpAfQyYx5KKbu9OwhfU5eKgC0
tAYAoLQB9VFGBr3GeOCJmTbbHzVsKqPb
=2L8d
-----END PGP SIGNATURE-----

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


RE: Tomcat performance under low load

Posted by Vijay Menon <vi...@hotmail.com>.
Hi Chris
Sorry about the delay in replying. I've been a bit busy with performance issues :)
The issue has come down to the vendor code persisting the cache as serialized objects to the file system and taking time to load it back, based on the decompiled code. The cache seems to be sufficiently tuned but for some reason, the file access is slow.
We haven't yet got the exact reason yet, so have to wait and see.
Vijay
From: vijay_menon@hotmail.com
To: users@tomcat.apache.org
Subject: RE: Tomcat performance under low load
Date: Sun, 17 Oct 2010 08:42:30 +1000








Thanks for the replies. Based on that, we did change the connectors to use executor threads. 
However, based on profiling the app, it turned out to be a code issue.
Thanks again.

From: vijay_menon@hotmail.com
To: users@tomcat.apache.org
Subject: Tomcat performance under low load
Date: Thu, 14 Oct 2010 09:35:14 +1000








Hi all
Thanks for reading this post. 
We are currently having 2 requirements that are opposites. The first requirement is performance under high loads and the other one is equivalent performance for 1 request.
Our prod env currently uses Apache with mod_jk and ajp 1.3 to Tomcat 6.0.26 and jdk 1.6.0_18 on solaris.
We're scaling to satisfactory loads of 250 concurrent requests serving pages in 0.5 seconds.
The other test scenario is where the tomcat instance is kept idle and a single request is sent in every 90 or so seconds. In this case, the response takes about 8 seconds out of which about 6 seconds cannot be tracked.
As the result, what we're finding is that under high loads, it performs well but under very low loads, it does not.
This definitely happens in the tomcat layer as we've used the FastCommonAccessLogValve logger which gives the time for the request in Tomcat.
The connector properties are protocol="AJP/1.3" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" useBodyEncodingForURI="true".
I was wondering whether anyone would be able to help with this issue.
Thanks in advance
VM 		 	   		  

RE: Tomcat performance under low load

Posted by Vijay Menon <vi...@hotmail.com>.
Thanks for the replies. Based on that, we did change the connectors to use executor threads. 
However, based on profiling the app, it turned out to be a code issue.
Thanks again.

From: vijay_menon@hotmail.com
To: users@tomcat.apache.org
Subject: Tomcat performance under low load
Date: Thu, 14 Oct 2010 09:35:14 +1000








Hi all
Thanks for reading this post. 
We are currently having 2 requirements that are opposites. The first requirement is performance under high loads and the other one is equivalent performance for 1 request.
Our prod env currently uses Apache with mod_jk and ajp 1.3 to Tomcat 6.0.26 and jdk 1.6.0_18 on solaris.
We're scaling to satisfactory loads of 250 concurrent requests serving pages in 0.5 seconds.
The other test scenario is where the tomcat instance is kept idle and a single request is sent in every 90 or so seconds. In this case, the response takes about 8 seconds out of which about 6 seconds cannot be tracked.
As the result, what we're finding is that under high loads, it performs well but under very low loads, it does not.
This definitely happens in the tomcat layer as we've used the FastCommonAccessLogValve logger which gives the time for the request in Tomcat.
The connector properties are protocol="AJP/1.3" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" useBodyEncodingForURI="true".
I was wondering whether anyone would be able to help with this issue.
Thanks in advance
VM