Che ZY
Che ZY

Reputation: 41

Does JProfiler's Net I/O and Waiting Thread operations involve low CPU load? Is there a relationship between CPU usage and Runnable thread time?

Our team is currently running stress tests and using JProfiler for monitoring.

We chose two scenarios for the test: setting concurrent threads to 10 and 40, and then compared the results.

The test results were recorded using Async Sampling for both JPA views and HTTP Server views.

We made a few discoveries:

  1. CPU usage showed a significant difference: with 10 threads, it ranged from 15-30%, while with 40 threads, it ranged from 40-70%. (Image shows the results of performing the same stress test four times) And the server is configured with 1 CPU core.

enter image description here enter image description here

  1. Comparing 10 threads to 40 threads, the time spent in runnable thread time is about the same, whether observed in JPA views or HTTP Server views.

JPA views enter image description here HTTP Server views enter image description here

  1. In both test scenarios, Net I/O takes time, but 40 threads consume more time than 10 threads, whether observed in JPA views or HTTP Server views.

JPA views enter image description here HTTP Server views enter image description here

  1. When the number of threads is 10, there is no Waiting thread time, but there is Waiting thread time when it is 40, whether observed in JPA views or HTTP Server views.

JPA views enter image description here HTTP Server views enter image description here

I referred to the following resources (the issue pertains to an earlier version of JProfiler):

The answer explains that the Net I/O thread state should involve low CPU load operations. Is this correct? And is the Waiting thread state also a low CPU load operation?

If both are correct, it implies that the CPU should be consumed elsewhere, such as in the runnable thread state (with block thread time approaching zero, I think it can be ignored).

So why is there such a large difference in CPU usage between 10 threads and 40 threads, even though Runnable thread time is about the same?

Thank you all for your time and help!

Upvotes: 1

Views: 66

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48090

why is there such a large difference in CPU usage between 10 threads and 40 threads

Context switches are expensive operations and depending on the number of cores, the function of CPU usage per thread count jumps at some point.

Upvotes: 0

Related Questions