tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Boyer" <>
Subject Re: Tomcat/Java and SMP
Date Fri, 03 Dec 2004 04:21:16 GMT
The ability of Tomcat (or any other Java application) to use multiple
CPUs depends on if the JVM can support multiple CPUs. Sun's JVM for
Windows uses native threads which the OS can schedule across multiple
CPUs. Clearly, your test application shows this. I believe Java threads
are mapped one-to-one to native Windows threads. With concurrent Java
threads, the OS is basically determining which processors handle which
If you want to see what's happening in Tomcat when this is going on,
try a profiler like JProfiler. You can also press Ctrl-break in the
console window to get a thread dump of the JVM. If there's any kind of
blocking going on, this should help identify that.

>>> 12/2/2004 9:40:36 PM >>>


I have a setup of 10 application servers using Tomcat 4/5, jsdk
1.4.2_02, SMP, win2k.  In watching the performance under load I am
concerned that only one CPU is being utilized at a time.  To validate
my theory I try hitting the application server with a request
to generate a large report and then making another connection.  The
second connection is painfully slow and task manager only
reports a 50% CPU utilization.  After doing some reading on SMP/native
threads and windows, I wrote a test java application that
spawns n infinite loop threads from a single JVM with a delay between
each creation.  Sure enough one cpu (task manager reporting
50%) and then the other cpu are consumed (task manager reporting 100%).
 This test tells me that Java is capable of using both CPU's
via native threading and some black magic in the windows dll's but that
this scenario isn't happening in tomcat.

Is it possible for tomcat to use more than one CPU or is there a
critical flaw in my logic?


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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message