简体   繁体   中英

vmstat pidstat result analysis for Java program

vmstat 1 100

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----

rb swpd free buff cache si so bi bo in cs us sy id wa st

1 0 0 2307452 283392 712136 0 0 2 2 17 21 0 1 99 0 0
3 0 0 2307436 283392 712136 0 0 0 0 10677 3455 21 43 35 0 0
4 0 0 2307436 283392 712136 0 0 0 0 10700 3620 22 42 36 0 0
3 0 0 2307436 283392 712136 0 0 0 0 10549 3523 21 43 36 0 0

pidstat -I -w -p 3809 2

PID cswch/s nvcswch/s Command

3809 0.00 0.00 java

3809 0.00 0.00 java

3809 0.00 0.00 java

I am doing a pressure test. The server program is a WebSocket server, which accepts 10,000 client connections. Each client connection sends a message to server every 2 seconds, and server responds a message to each client every 2 seconds.

My question is :

1) From vmstat 1 100 , it seems that the cpu( sy is 42%, us is 21% around) is doing much system-level work instead of user-level work. So I think there are too much context switch for CPU.

However, from pidstat , the cswch/s and nvcswch/s are all 0 for the server program. I think this result means that there are not much context switch for CPU.

Could anybody help explain the result of the Linux server monitoring result?

  • pidstat is referencing to process 3809
  • vmstat is measuring all the processes of the system cause you set only the sampling frequency

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM