2

What is meant by Net IO time in JProfiler?

JProfilerguide says following but I dont know what exactly it means? Is the time spent on network or waiting on network? What to fix if the net io time is huge?

During network operations, many calls in the Java standard libraries can block because they're waiting for more data. This kind of blocking is called "Net I/O" in JProfiler. JProfiler knows the list of methods in the JRE that lead to blocked net I/O and instruments them at load time.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
NaiveCoder
  • 957
  • 3
  • 14
  • 34

2 Answers2

5

Net I/O is the time that sockets are waiting for data.

  • A server socket that is waiting for a connection, is in the net I/O thread state. This does not indicate a performance problem.

  • 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.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
  • @ Ingo Kegel - In my case, the queries are executing fine within few milliseconds, but still the net IO time is huge? its like out of 2.5 hours of total time runnable time is just 12 minutes and Net IO time is rest of 2.5 hours. – NaiveCoder Oct 08 '18 at 14:45
  • Can you also tell me what exactly is runnable time? it it time spent executing the code on CPU? – NaiveCoder Oct 08 '18 at 16:00
  • `it it time spent executing the code on CPU? ` -> No, "Runnable" includes only the time that the thread is not in any other thread states, i.e. it wants to perform instructions. However, it will not always be sechduled to run by the OS. – Ingo Kegel Oct 09 '18 at 09:53
  • As for you other comment, you are probably looking at the "Runnable" time and you should switch to "All thread states" to see the wall clock time. – Ingo Kegel Oct 09 '18 at 09:54
  • @ Ingo Kegel - So what view will actually tell me how much time spent doing something on CPU? When I add up runnable + net io time , it adds ups equal to the time snapshot was captured for. So if in runnable thread was not executing and was just ready then when the code got executed and where this time is logged? – NaiveCoder Oct 10 '18 at 05:08
  • In the profiling settings, on the CPU recording tab you can choose to record estimated CPU times. However, this has a 5ms granularity and will not be accurate for short-running methods. – Ingo Kegel Oct 10 '18 at 08:18
  • sorry but I m not yet clear on runnable time.. why we show it in JProfile if it doesn't actually mean anything ? for example: In my case JProfiler says 622 seconds spent on methodX().. why it says 622 seconds when it is not the cpu time? – NaiveCoder Oct 11 '18 at 04:32
  • The runnable time is the wall clock time minus the waiting and blocking time. It's a very useful measure when trying to find performance bottlenecks. The CPU time is something that is not available at a fine granularity. – Ingo Kegel Oct 11 '18 at 06:18
  • @NaiveCoder Did you ever figure out, why your net I/O was high, while directly executing queries was fast? We have the same here, but only from time to time. – PeMa Aug 20 '19 at 05:31
  • @PeMa We could not figure out with JProfiler.. We moved to AppDynamics tool. Its much better than JProfiler. – NaiveCoder Aug 22 '19 at 15:20
  • @NaiveCoder Thank you I'll habe a look on that one. By the way, it seems, in our case, the occasionally slow communication was due to MariaDB not getting enough memory from the system. ... anyway still guessing, since we also couldn't get closer with jProfiler, still I think it was very helpful so far. – PeMa Aug 22 '19 at 16:20
0

"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.