I have a java application and it starts 2035 threads during the application startup and in which around 1250 threads will wait for 3 seconds until the socket time to out happen other 785 threads establishes the socket connections and completes their jobs quickly.
I can see the CPU usage is not even crossing more than 50% for half n hour when I start my application. As per my understanding if all threads fights for CPU then CPU% will increases more than by 100 % but which is not happening and my application is taking almost half n hour extra to finish the tasks if include this 1250 threads.
I can see number of Threads with top command as 196 till half n hour.I am using Linux vm with 6 cores per socket and it has 6 cores.
If I remove this 1250 threads which are waiting for socket timeout then my application execution is very fast and within 3 mins other 785 threads able to establish the socket connection and completing their jobs.
Can any one help me to understand though CPU% usage is low, which process is causing the slow down of the application?