Common Linux commands are documented for later use:
First, view the server configuration
1. View the number of logical CPUs and CPU model
Command: Cat/proc/cpuinfo | grep name | Cut-f2-d: | Uniq-c
Results:
Meaning: 24 logical CPUs, CPU called Xeon, CPU model is e5-2620, CPU frequency 2.1G Hz
2. View the IDs of all physical processors
Command: Cat/proc/cpuinfo | grep ' Physical ID ' | Sort|uniq
3. View the number of processing cores (CPU core) in each physical processor
Command: Cat/proc/cpuinfo | grep ' CPU cores ' | Sort|uniq
4. View the ID of all processing cores (CPU core)
Command: Cat/proc/cpuinfo | grep ' Core ID ' | Sort|uniq
5. View the IDs of all logical processors (Hyper-Threading Technology)
Command: Cat/proc/cpuinfo | grep ' Processor ' | Sort|uniq
Results:
Meaning: On this server, the physical CPU has 2, each physical CPU has 6 processing cores, the actual processing core number is 12, and the logical processor is 24 (Hyper-Threading Technology)
6 . Detailed information about the server CPU
Command: Cat/proc/cpuinfo
Results:
Meaning: Processor: The ID of the logical processor (several processor have several logical processors)
Physical ID: The ID of the physical processor (there are several physical processors with several different physical IDs)
Core ID: ID of each processing core
CPU cores: Number of cores in each physical processor
Sibings: The number of logical processors in each physical processor
Second, test server performance
1. Display server virtual memory usage every few seconds
Command: Vmstat interval seconds number of views
Results:
Meaning:
Procs (Process): R: Number of processes in the running queue; B: Number of processes waiting for IO, that is, blocked processes
Memory: SWPD: virtual memory size; free: available memory size; Buff: The amount of memory used as a buffer; cache: The size of the memory used as caching
Swap:si:Amount of memory swapped in from disk (/s). ; So:amount of memory swapped to disk (/s).
IO: (the size of the Linux version block is now 1024bytes) BI: Number of blocks read per second; Bo: number of blocks written per second
System: In: Interrupts per second, including clock interrupts, CS: Number of context switches per second.
CPU (expressed as a percentage): US: User Process Execution Time, SY: System Process Execution time, ID: idle time (including IO wait time), WA: Wait io time
2. View server uptime and load information
Command: Uptime
Conclusion:
Meaning:
Copy
Text Editor
PostgreSQL use
Shell script Run
Linux basic commands