-
1. Re: What is the default number of threads in JBOSS EAP 6.4?
jaysensharma Feb 2, 2016 11:54 PM (in response to shijazi)What is the default thread pool for http connector? Copying similar discussion here:
Internally executor can not be monitored. However it has some values like default MAX_THREADS value which is computed as following in EAP6.4 (which uses JBOSSWEB_7_5_0_FINAL )
MAX_THREADS computation for Java based connector.
512 * Runtime.getRuntime().availableProcessors()
- /**
- * Maximum amount of worker threads.
- */
- protected int maxThreads = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 64 : ((Constants.MAX_THREADS == -1) ? 512 * Runtime.getRuntime().availableProcessors() : Constants.MAX_THREADS);
If you want to really tune and monitor the threads statistics then you will need to define custom thread pool executor. It means f you do not want to use the default values then you got the right link which tell us exactly how to create an Executor and how to associate it with the connector:
Example:
Then it can be monitored using CLI as following:- <subsystem xmlns="urn:jboss:domain:threads:1.1">
- <bounded-queue-thread-pool name="http-executor" allow-core-timeout="true">
- <core-threads count="100"/>
- <queue-length count="100"/>
- <max-threads count="100"/>
- </bounded-queue-thread-pool>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">
- <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" executor="http-executor"/> <!-- NOTICE -->
- <virtual-server name="default-host" enable-welcome-root="true">
- <alias name="localhost"/>
- <alias name="example.com"/>
- </virtual-server>
- </subsystem>
- [standalone@localhost:9999 /] /subsystem=threads/bounded-queue-thread-pool=http-executor:read-resource(include-runtime=true)
Regards
Jay SenSharma
-
2. Re: What is the default number of threads in JBOSS EAP 6.4?
shijazi Feb 4, 2016 12:40 AM (in response to jaysensharma)could you help me specifying the difference between bounded and unbounded queue, and what is the default timeout for the request coming to JBoss?
-
3. Re: What is the default number of threads in JBOSS EAP 6.4?
jaysensharma Feb 4, 2016 1:13 AM (in response to shijazi)unbounded-queue-thread-pool
: This type of thread pool always accepts tasks. If fewer than the maximum number of threads are running, a new thread is started up to run the submitted task; otherwise, the task is placed into an unbounded FIFO queue to be executed when a thread is available.bounded-queue-thread-pool
: This type of executor maintains a fixed-length queue and two pool sizes: acore
size and amaximum
size. When a task is accepted, if the number of running pool threads is less than thecore
size, a new thread is started to execute the task. If space remains in the queue, the task is placed in the queue. If the number of running pool threads is less than themaximum
size, a new thread is started to execute the task. If blocking is enabled on the executor, the calling thread will block until space becomes available in the queue. The task is delegated to the handoff executor, if a handoff executor is configured. Otherwise, the task is rejected.Reference:
Regards
Jay SenSharma