tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Crowther <>
Subject Re: How to run Tomcat on Multiple Cores in Windows 2003 server?
Date Fri, 14 Aug 2009 11:52:46 GMT
2009/8/14 shivram.raj <>:
> Our application deployed in Tomcat running in Windows 2003 server is very
> slow. Whenever the user tries page navigation, more CPU is used (15 - 25%)
> in the server and it seems only 2 cores out of 8 in the processor is used by
> Tomcat.

How many concurrent requests are you sending, and how are you sending
them?  If you're testing your app using a single Web browser, most
browsers will not send more than two concurrent requests to the same

> Can any one suggest me how to fix this issue?

1) Make sure you know which Tomcat version you're running, and tell us
in your next post - we're not psychic, and there have been a lot of
versions over the last ten years!

2) Make sure you know what you're testing, and verify that your test
*should* produce more than two concurrent requests.

3) Take a thread dump.  This is easier if you start Tomcat using its
startup scripts than if you run it as a service - you don't tell us
how you've started Tomcat.  If you're currently running it as a
service and you installed it from the .exe setup, then (for some odd
reason) you won't have the startup script.  The easiest way to fix
this is to download the zip file for the version of Tomcat you're
running, unzip that, and copy the .bat files over to your running
Tomcat's installation directory.  Then stop the service, and instead
run startup.bat from a cmd window to start Tomcat.  Now you can take a
thread dump by pressing ctrl-break in that window.  It'll usually
appear in one of the log files, depending on how the logging's set up.

4) Examine the thread dump and see what's actually running!

> FYI, while configuring Tomcat,
> I have set the Java settings such that the Initial Memory pool to 256 MB and
> Maximum memory pool to 512 MB. I did not mention anything for Thread stack
> size.

These may or may not be appropriate, depending on your application.
Only you, as the application developer, can know.  They're certainly
large enough for Tomcat's own structures for any reasonable load.

> Do I need to change anything in the server.xml to add any thread setting
> parameters?

Generally, no.  Tomcat will make use of as many cores as it can get
its sticky hands on, unless something's been configured to stop it!

> Also, does any one know how to create a thread stack? jstack is
> not available in my environment as I am running java 1.5 in Windows 2003.

See above.

- Peter

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

View raw message