The authoritative guide to Java Performance Optimization-reading notes (i)-operating System performance monitoring tool

Source: Internet
Author: User

One: CPU

1. The user-state CPU is the percentage of the total CPU time that executes the application code.

The system-State CPU is the percentage of the total CPU time that the application performs operating system calls. System-State CPU high means that shared resources are competing or there is a lot of interaction between I/O devices.

One goal of improving application performance and scalability is to minimize system-state CPU usage.

2. The CPU run queue is a lightweight process that is ready to run and waiting for available CPUs.

When the running queue length reaches 4 of the processor or more, the corresponding system is very slow.

There are two ways to resolve the run queue Length:

1). Increase the CPU to share the load;

2). Analyze the application running in the system, improve the CPU utilization;

1. Vmstat
procs-----------Memory-------------Swap-------io-----system--------CPU-----r  B   swpd   free   buff  cache   si   so    bi    bo   in   CS US sy ID WA St 2  0      0 104956    868 825812    0    0     1     5  0  0  0 0

R:cpu Run Queue Length, value is the actual number of lightweight processes in the running queue

US: User-State CPU utilization

SY: System State CPU usage

ID:CPU Idle Rate

2. Top
top-09:42:04 up 3 days, 3 min, 1 user, load average:0.00, 0.01, 0.05tasks:108 Total, 3 running, sleeping, 0 Stopped, 0 zombie%cpu (s): 0.0 us, 0.0 sy, 0.0 ni,100.0 ID, 0.0 wa, 0.0 hi, 0.0 si, 0.0 stkib mem:1015472 Total   , 104568 free, 84224 used, 826680 Buff/cachekib swap:0 Total, 0 free, 0 used.                                                                                            727760 avail Mem PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND 784 root 0 553064 16340 5748 S 0.0 1.6 0:21   . tuned 743 Root 20                                                                                          0 110512 13140 676 S 0.0 1.3 0:00.13 dhclient                                                                9678 polkitd 0 527456 13128 4680 S 0.0 1.3 0:00.09 POLKITD                              1 root 0 43684 6176 3804 S 0.0 0.6 0:05.08 systemd

The upper part is the statistical information of the whole system, and the lower half is the statistics of the process.

Two: Memory

1. When the system is using paging or virtual memory, there is a memory replacement when accessing memory in swap and the JVM garbage collection in swap, there is definitely a problem with performance;

2.

The authoritative guide to Java Performance Optimization-reading notes (i)-operating System performance monitoring tool

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.