You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Agmen-Smith <ch...@Rightmove.co.uk> on 2003/04/02 18:30:29 UTC

Tomcat 4.1 slower than Tomcat 3.3

Is Tomcat 4 slower than Tomcat 3?

I've recently tried to port my Tomcat 3.3 webapp to Tomcat 4.1. It's the
same webapp, the config files are as similar as I can make them, we're using
the same connector to Apache. However, Tomcat 4.1 chews up CPU like you
wouldn't believe.

Example: at peak load, one of our Tomcat 3.3 servers served 20,000 page
impressions in an hour, at an average %usr CPU of 60%. Using Tomcat 4.1, we
can only serve about 7,000 pages if we down-weight it so that it is at 60%.

Old setup:
Apache 1.3.x -> AJP 1.3 -> Tomcat 3.3.x -> webapp (uses Velocity 1.2 &
Turbine 2.1)

New setup:
Apache 1.3.x -> AJP 1.3 -> Tomcat 4.1.x -> webapp (uses Velocity 1.2 &
Turbine 2.1)

We have tried profiling the app using hprof and these are the results:
Method                             Tomcat 3    Tomcat 4
java.net.URLEncoder.encode         33.62%      22.60%
java.net.SocketInputStream.read    14.15%      18.77%
java.net.SocketOutputStream.write   1.87%       3.47%

The encode method is used by Velocity and Turbine to generate URL links. For
this particular test, T4.1 used about 1.5 times the CPU that T3.3 used.
Given that the same number of pages & therefore links are being generated, I
think this shows that T4.1 is spending significantly more time in
SocketInputStream.read that T3.3. 

I have tried to following tuning options, even though they weren't needed in
T3.3:
- Removed servlet filters (no effect; not used in T3.3)
- Reduced logging to bare minimum (no effect)
- Experimented with numerous JVM settings: -server -d64 -Xmn256mb -Xmx384mb
-Xconcurrentio (no effect)
- Tried latest Solaris patches (no effect)
- Tried 64-bit java (no effect)
- Changed maxProcessor (# of threads) from default to 20 to 50 to 100 etc
(no effect)
- Changed Java/Solaris threading libraries (no effect)

I don't have any more ideas how to fix it; instead I am clutching at straws
:o) Some of those straws include:
- Tuning/hacking/fixing Turbine, in case it is incompatible with the Servlet
2.3 spec.
- Trying even more JVM setting permutations, in the hope that I come across
the "magic" combination.
- Disabling socket keepalive in Apache.

Until we can fix this, we are sticking with Tomcat 3.3, which has so far
been stable, fast and robust (except for allowing sessions between https and
http).

Chris Agmen-Smith


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs service. 
________________________________________________________________________

Re: Tomcat 4.1 slower than Tomcat 3.3

Posted by Endre Stølsvik <En...@Stolsvik.com>.
On Thu, 3 Apr 2003, Bill Barker wrote:

| Since it seems that you aren't using JSP at all, it isn't surprising (to me
| at least :) that the extra over-head of supporting the 2.3 Servlet spec
| drags down TC4.1 vs. TC3.3.  For non-JSP sites that don't require
| Servlet-2.3 features, it is very hard to beat  TC3.3 for performance.

I actually thought that TC3.3 was refactored for performance, while TC4
was made for .. overviewability.. or whatever. TC4 is very "rigid", while
TC3.3 is using straighter, faster lines of control.

TC5 is supposed to take the good-shit from both TC3.3 and TC4 and make
"the very best" Servlet Container in the universe.

.. is my understanding.

-- 
Mvh,
Endre Stølsvik               M[+47 93054050] F[+47 51625182]
Developer @ CoreTrek AS         -  http://www.coretrek.com/
CoreTrek corporate portal / EIP -  http://www.corelets.com/

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


Re: Tomcat 4.1 slower than Tomcat 3.3

Posted by Bill Barker <wb...@wilshire.com>.
Well, the big performance change in TC4.1 over TC3.3 is Jasper2 vs. Jasper1.
For heavy JSP sites, my benchmarks say that TC4.1 wins.

Since it seems that you aren't using JSP at all, it isn't surprising (to me
at least :) that the extra over-head of supporting the 2.3 Servlet spec
drags down TC4.1 vs. TC3.3.  For non-JSP sites that don't require
Servlet-2.3 features, it is very hard to beat  TC3.3 for performance.

"Chris Agmen-Smith" <ch...@Rightmove.co.uk> wrote in message
news:4F4436D2E472D411862400B0D03E4A6962CA19@RM01...
> Is Tomcat 4 slower than Tomcat 3?
>
> I've recently tried to port my Tomcat 3.3 webapp to Tomcat 4.1. It's the
> same webapp, the config files are as similar as I can make them, we're
using
> the same connector to Apache. However, Tomcat 4.1 chews up CPU like you
> wouldn't believe.
>
> Example: at peak load, one of our Tomcat 3.3 servers served 20,000 page
> impressions in an hour, at an average %usr CPU of 60%. Using Tomcat 4.1,
we
> can only serve about 7,000 pages if we down-weight it so that it is at
60%.
>
> Old setup:
> Apache 1.3.x -> AJP 1.3 -> Tomcat 3.3.x -> webapp (uses Velocity 1.2 &
> Turbine 2.1)
>
> New setup:
> Apache 1.3.x -> AJP 1.3 -> Tomcat 4.1.x -> webapp (uses Velocity 1.2 &
> Turbine 2.1)
>
> We have tried profiling the app using hprof and these are the results:
> Method                             Tomcat 3    Tomcat 4
> java.net.URLEncoder.encode         33.62%      22.60%
> java.net.SocketInputStream.read    14.15%      18.77%
> java.net.SocketOutputStream.write   1.87%       3.47%
>
> The encode method is used by Velocity and Turbine to generate URL links.
For
> this particular test, T4.1 used about 1.5 times the CPU that T3.3 used.
> Given that the same number of pages & therefore links are being generated,
I
> think this shows that T4.1 is spending significantly more time in
> SocketInputStream.read that T3.3.
>
> I have tried to following tuning options, even though they weren't needed
in
> T3.3:
> - Removed servlet filters (no effect; not used in T3.3)
> - Reduced logging to bare minimum (no effect)
> - Experimented with numerous JVM
settings: -server -d64 -Xmn256mb -Xmx384mb
> -Xconcurrentio (no effect)
> - Tried latest Solaris patches (no effect)
> - Tried 64-bit java (no effect)
> - Changed maxProcessor (# of threads) from default to 20 to 50 to 100 etc
> (no effect)
> - Changed Java/Solaris threading libraries (no effect)
>
> I don't have any more ideas how to fix it; instead I am clutching at
straws
> :o) Some of those straws include:
> - Tuning/hacking/fixing Turbine, in case it is incompatible with the
Servlet
> 2.3 spec.
> - Trying even more JVM setting permutations, in the hope that I come
across
> the "magic" combination.
> - Disabling socket keepalive in Apache.
>
> Until we can fix this, we are sticking with Tomcat 3.3, which has so far
> been stable, fast and robust (except for allowing sessions between https
and
> http).
>
> Chris Agmen-Smith
>
>
> ________________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs service.
> ________________________________________________________________________




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