Linux System Performance Evaluation

Source: Internet
Author: User

I. Check the number of CPUs, cores, and threads in Linux.

(1) Check the number of physical CPUs

Grep 'physical id'/proc/cpuinfo | sort-u | wc-l

(2) Check the number of cores

Grep 'core id'/proc/cpuinfo | sort-u | wc-l

(3) view the number of threads (logical cpu)

Grep 'processor '/proc/cpuinfo | sort-u | wc-l

The number of logical CPUs (possibly core, threads, or both) in each physical CPU:

Grep 'siblings '/proc/cpuinfo | sort-u

The command execution result shows that the server has 1 cpu, 6 cores, 2 cores, and 12 threads in total.

You can use dmidecode to view the cpu model. You can also find the specific cpu parameters based on the model.

Ii. Linux server performance evaluation (cpu, memory, disk IO)

(1) Factors Affecting Linux server performance

A. Operating System Level

CPU

Memory

Disk I/O bandwidth

Network I/O bandwidth

B. Application Level

(2) System Performance Evaluation Criteria

  • Performance Impact Factors Criteria
    Good Bad Bad
    CPU User % + sys % <70% User %+ sys % = 85% User % + sys %> = 90%
    Memory Swap In (si) = 0

    Swap Out (so) = 0

    Per CPU with 10 page/s More Swap In & Swap Out
    Disk Iowait %< 20% Iowait %= 35% Iowait % >= 50%
    • Where:

      % User: the percentage of time when the CPU is in user mode.

      % Sys: the percentage of time when the CPU is in system mode.

      % Iowait: Percentage of CPU waiting for input/output completion time.

      Swap in: si, indicating page import of virtual memory, that is, switching from swap disk to RAM

      Swap out: so indicates page export of the virtual memory, that is, switching from RAM to swap disk.

      (3) System Performance Analysis Tools

      1. Common system commands

      Vmstat, sar, iostat, netstat, free, ps, top, etc.

      2. Common combination methods

      O use vmstat, sar, and iostat to check whether it is a CPU bottleneck.

      O use free and vmstat to detect memory bottlenecks

      O use iostat to check whether it is a disk I/O bottleneck

      O use netstat to check whether it is a network bandwidth bottleneck

      (4) Linux Performance Evaluation and Optimization

      1. Overall system performance evaluation (uptime command)

      [Root @ server ~] # Uptime

      16:38:00 up 118 days, 5 users, load average: 1.22, 1.02, 0.91

      Note: load average is the output value. The size of these three values cannot be greater than the number of system CPUs. For example, the system has eight CPUs in this output, if the three load average values are greater than 8 for a long time, the CPU is very busy and the load is high, which may affect the system performance, generally, the system performance is not affected. Conversely, if the output value of the load average is smaller than the number of CPUs, it indicates that the CPU still has idle time slice. For example, the output in this example, the CPU is very idle.

      2. CPU Performance Evaluation

      (1) Monitor the CPU of the system using the vmstat command

      This command displays brief information about the performance of various system resources. Here we mainly use it to view a CPU load.

      The output result of the vmstat command in a system is as follows:

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.