Does thread initilization takes time in JBoss ?
Issue
- We are using jboss and open jdk7 in RHEL 6.3 environment. We have deployed our application in jboss and see the response time for the intial few request are very high. But after some time this reduces, On Further investigation we found the time was taken to create threads. Our application receives a request and it creates multiple threads for further procession. we saw that the time taken to call run method of thread is huge and after that it reduces.
Sudo code
Vector<Callable<Object>> vecThreads = new Vector<Callable<Object>>();
// we add six threads per request
vecThreads.add((Callable<Object>) Executors.callable((Runnable) ThreadObject Class));
ExecutorService pool = Executors.newFixedThreadPool(40);
Collection<Future<Object>> futures = pool.invokeAll(vecParallelThread);
if (futures != null) {
for (Future<Object> f : futures) {
f.get();
}
}
Please let us know if this behaviour is normal?
And also steps to reduce the thread creation time?
I see that these threads are waiting only during initial few request. Obviously this is not an expected behavior, but the concern over here is number of threads that is available JBoss server on startup is not creating that many threads as configured.
I would like to know if any way to create all configured threads during the startup of server?
Below is the executor defined :
<subsystem xmlns="urn:jboss:domain:threads:1.1">
<bounded-queue-thread-pool name="http-executor" allow-core-timeout="false">
<core-threads count="800"/>
<queue-length count="50"/>
<max-threads count="1000"/>
<keepalive-time time="60000" unit="milliseconds"/>
</bounded-queue-thread-pool>
</subsystem>
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
