tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: ThreadPool vs HeapSize
Date Sun, 14 Dec 2008 15:31:03 GMT
Hash: SHA1


Billy Ng wrote:
> I am using Tomcat 5.5 on Linux 64-bit.  The server always has lots of
> hits so I increase the maxThreads from 300 to 500 in server.xml.
> From the thread monitor, I saw mostly about 350 threads were used.

Is this steady use or peak use? You should always prepare to meet peak
use rather than steady use.

> But I notice the # of threads dropped to 70 when the garage collection
> kicked in.

Perhaps many of those 350 threads were allocated, but not actually
serving requests.

> Currently, the heap size max and min is 768MB.  Should I
> increase the heap size when I increase the maxThreads?

There's no particular reason to increase the heap size when increasing
maxThreads. Threads themselves take a tiny bit of memory, but that
shouldn't concern you. If each request uses a lot of memory, then you
will want to increase the heap accordingly. If you're getting away with
500 threads and a sub-gigabyte heap, I think you're doing fine (of
course, I know nothing else about your setup!).

Are you concerned that the number of threads drops? If you want to make
sure that you have some threads laying around ready to process a sudden
surge of traffic, try setting the minSpareThreads attribute on your

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


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

View raw message