Linux Server Load Analysis

Source: Internet
Author: User

In general, stress testing requires monitoring the state of the server to assess the server load capacity, and in addition to the analysis by tools such as Zabbix, you can use commands to analyze

1.uptime command Check server average load

[[email protected] ~]# uptime 20:57:23 up days,  ,  2 users,  load average:0.00, 0.00, 0.00

Analytical:

Load average represents a 1-minute load of 5-minute load 15-minute load

2.iostat Check Server IO usage

[Email protected] ~]# iostat-mlinux 2.6.32-431.20.3.el6.x86_64 (iz23j6e7bhez)         04/16/2015      _x86_64_        (1 CPU) Avg-cpu:  %user   %nice%system%iowait  %steal   %idle           0.21    0.00    0.13    0.01    0.00   99.65Device:            TPs    mb_read/s    mb_wrtn/s    mb_read    Mb_wrtnxvda              0.11         0.00         0.00        251        596

Analytical:

%user: The percentage of CPU that is used to run at the user level.
The percentage of CPU used by the%nice:nice operation.
%system: The percentage of CPU that is used to run at the system level (kernel).
%iowait:cpu the percentage of CPU that is consumed while waiting for hardware I/O.
%idle:cpu the percentage of idle time.
Device segment:
TPS: The number of I/O requests sent per second.
BLK_READ/S: Number of blocks read per second.
BLK_WRTN/S: Number of blocks written per second.
Blk_read: The total number of blocks read in.
BLK_WRTN: Total number of block writes.


3.vmstat command to monitor server status values

[Email protected] ~]# vmstatprocs-----------memory-------------Swap-------io------System-------CPU-----R  b< C5/>SWPD   free   buff  cache   si   so    bi    bo   in   CS US sy ID WA St 0  0      0   6356 105640 250424    0    0     0     1 1 0 0 +  0  0
parsing:

R: Indicates the running queue (number of processes allocated to the CPU)
B: Number of blocked processes
SWPD: Virtual Memory usage Size

Free: idle physical memory size

Buff:liunx Cache Size

Cache: File Caching

Si: Read virtual memory size per second

So: Write virtual memory size per second

BI: Number of blocks received per second (related to disk minimum cluster) for block devices (disk, etc.)

Bo: Number of block devices sent per second

In: Number of interrupts per second CPU

CS: The number of context switches per second (call system functions, the context switch, the smaller the better the value.) For example, the dynamic mode of PHP-FPM, in high concurrency will create a new php-cgi process, which will cause CS to grow; Similarly, call system functions in code, resulting in context switching, very resource-intensive)

US: User CPU time

SY: System CPU Time

ID: Idle CPU time

WT: CPU time waiting for IO

4. Brain Stump Top command

Top-21:15:24 up-Days, 2:18, 1 user, load average:0.13, 0.04, 0.01tasks:76 Total, 1 running, sleeping, 0   Stopped, 0 zombiecpu (s): 0.3%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%stmem:501492k Total, 455900k used, 45592k free, 90888k buffersswap:0k total, 0k used, 0k free, 235952k cached P ID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND 1148 root 0 768m 8 892 7124 s 0.3 1.8 22:43.36 Alihids 1 root 0 19232 1512 1224 S 0.0 0.3 0:00                              . Init 2 Root 0 0 0 0 S 0.0 0.0 0:00.02 Kthreadd      3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 4 root 0 0 0 0 S 0.0 0.0 0:02.79 ksoftirqd/0 5 root RT 0 0 0 0 S 0 .0 0.0 0:00.00 Migration/0 6 root RT 0 0 0 0 S 0.0 0.0 0:01.94 watchdog/0     7 Root 0 0 0 0 S 0.0 0.0 0:52.26 events/0 8 root 20 0   0 0 0 S 0.0 0.0 0:00.00 cgroup 9 Root 0 0 0 0 S 0.0 0.0                                0:00.00 khelper Root 0 0 0 0 S 0.0 0.0 0:00.00 netns      Root 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr Root 0 0 0 0 S 0.0 0.0 0:00.00 pm root 20 0 0 0 0 s 0.0 0.0 0:00.00 xenwatch Root 0 0 0 0 S 0.0 0.0 0:00.01 Xenbu                  S
The top command combines a lot of information, and the top 3 messages are generally found in this top command, and the top command also displays details for each process.


Linux Server Load Analysis

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.