I need to be sure I understand what I read about setting the max threads on jBoss 6. We are trying to set up for some load testing so I need it to be where it would be in production. Here is what I found in the docs:
max-threads - optional; specifies the maximum number of threads which may be running concurrently. Attributes are:
- count - optional float attribute; specifies a fixed quantity.
- per-cpu - optional float attribute; specifies a quantity which is multiplied by the number of available CPUs. Both quantities are then added and the final result is the actual count used.
so if I use:
<bounded-queue-thread-pool-executor name="ThreadPool" blocking="true">
<thread-factory name="ShortTasksThreadFactory"/>
<queue-length count="500" per-cpu="200"/>
<core-threads count="100" per-cpu="50"/>
<max-threads count="200" per-cpu="100"/>
<keepalive-time time="30" unit="seconds"/>
<task-filter>
<clear-context-classloader/>
<clear-tls/>
</task-filter>
</bounded-queue-thread-pool-executor>
<bounded-queue-thread-pool-executor name="ThreadPool" blocking="true">
<thread-factory name="ShortTasksThreadFactory"/>
<queue-length count="500" per-cpu="200"/>
<core-threads count="100" per-cpu="50"/>
<max-threads count="200" per-cpu="100"/>
<keepalive-time time="30" unit="seconds"/>
<task-filter>
<clear-context-classloader/>
<clear-tls/>
</task-filter>
</bounded-queue-thread-pool-executor>
am I getting a max thread count of 100 x 2 cpu + 200 = 400?
also, is this keepalive setting good for a production environment? Any other changes you would suggest in order for the server instance to handle a fairly heavy load?