Our team is currently running stress tests and using JProfiler for monitoring.
The target server is a Spring application using Hikari CP with the connection pool size set to 10.
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.
To understand the test results, we referred to the following pages:
- The definitive guide to JProfiler (ej-technologies.com)
- Finally, JProfiler adds a synthetic “Net I/O” state that keeps track of the times when a thread is waiting for network data. This is important for analyzing servers and database drivers, because that time can be relevant for performance analysis, such as for investigating slow SQL queries.
- What is meant by Net IO in JProfiler? – Stack Overflow
- A JDBC call that is waiting for the database to return a result is in the net I/O state. In this case, you can see the associated SQL string in the call tree.
And we made the following assumptions:
- In JPA views, Waiting thread time is due to the server waiting to get a connection to the database, and Net I/O thread time is the time from when the server starts fetching data from the database until the data is returned.
Based on this and knowing Hikari CP has only 10 connections, we expected that with 40 threads, the waiting thread time would be longer than with 10 threads. This was true, but we also noticed that the Net I/O thread time increased as well, although the increase was small.
If net I/O only includes the time from when data fetching starts until it returns, without including the time waiting for a connection, then theoretically, the time spent should be about the same whether there are 10 or 40 threads. However, our actual tests showed otherwise.
It seems our understanding of Waiting and Net I/O thread states in JPA views might be incorrect, and the official documentation doesn’t provide a clearer explanation.
Can anyone provide a more detailed explanation? Thanks!
Che ZY is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.