Thread-max

From Resin 3.0

Revision as of 09:41, 6 January 2006 by Ferg (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


thread-max configures the maximum number of threads in Resin's thread pool. The actual number of threads in the JVM will be somewhat higher, because libraries and routines that allocate Threads directly do not count against the thread-max value.

memory issues

Each thread allocates virtual memory for its stack. By default on Linux, this size is 8M of memory. On a 32-bit computer, this limits the number of threads to 128, assuming the heap size is 1G. By setting [-Xss] to 1m, you can allocate up to 1024 for a 1G heap.

See also: java.lang.OutOfMemoryError

priority threads

Resin uses the thread pool for requests and also for high-priority tasks like session and database timeouts. Because the timer tasks are higher priority, Resin reserves a number of threads for those tasks. This means that setting thread-max to 100 and hitting the server with 200 clients may only serve 75 requests at a time, because 25 threads are reserved for the high-priority tasks.

Personal tools