Linux Study Notes (7)-view system resources and linux Study Notes
Monitor System Resources: vmstat
# Vmstat [sampling time] [sampling times]
For example: # vmstat 3 2
Sample once every 3 seconds. A total of 2 samples
Field interpretation of output information
R |
Indicates the running queue. If the running queue is large, the CPU is busy. |
B |
Indicates the blocked process. |
Swpd |
The size of the virtual memory used. If it is greater than 0, the physical memory of the machine is insufficient. |
Free |
Idle physical memory size |
Buff |
Buffer |
Cache |
Cache |
Si |
Size of the virtual memory read from the disk per second |
So |
Size of data written to disk from virtual memory per second |
Bi |
Disk write speed |
Bo |
Disk read Speed |
Id |
Percentage of idle cpu resources |
Explanation of cache and buffer:
Since the Read and Write speeds of hard disks and memory are quite different, when data is written to the disk, there will be a buffer mechanism to improve efficiency. When data is written from the disk to the memory, a cache mechanism is provided to improve efficiency.
View the kernel detection information during startup: dmesg
When Linux is started, a lot of text is displayed on the screen in front of the screen, and it feels very high. The information contains system resource information. After the boot is complete, you can still view it. You can use the dmesg command.
# Dmesg
There is a lot of output information above, and it is very painful to find the information you need with the naked eye. Pipeline service will help you.
# Dmesg | grep CPU
Use MPs to find CPU Information
View memory usage: free
# Free-m
Display memory usage, in MB
View CPU details
# Cat/proc/cpuinfo
Displays detailed CPU Information
View system kernel information: uname
# Uname [Option]
Option:
-A: view all information about the system.
-R: view the kernel version.
-S: view the kernel name
Determine the number of digits of the current system
# File/bin/ls
The system displays whether the current number of digits is 32-bit or 64-bit. /Bin/ls is the path of the built-in ls command.
View the release version of Linux: lsb_release
# Lsb_release
How to view Computer Configurations in linux
How to view system hardware configuration in linux
In linux, how does one view system configurations? In the graphic mode, we can conveniently use the Linux Graphics Tool and click a few to view the hardware information of the Linux system. However, most production server systems do not install the Xwindo service to save system resources. Therefore, in the graphic mode, we can easily view the hardware information of the system.
In linux, how does one view system configurations?
In the graphic mode, we can conveniently use the Linux Graphics Tool and click a few to view the hardware information of the Linux system. However, most production server systems do not install the Xwindo service to save system resources. Therefore, it is necessary to view the hardware information of the system in graphic mode.
Linux has not yet provided commands or software for Machine System Information (like CPU-Z, everest, etc ). The specific method to view the system configuration is as follows:
1. the system hardware configuration is in the/proc directory.
2. You can run the following command to view the files:
Cat/proc/cpuinfo view cpu information. processor 0 is a U, 1 is two, and flags is hyper-threading.
Lspci viewing motherboard Information
Free-m memory query (the memory size is displayed under the total attribute ).
Fidsk-l check hard disk space
Df-h hard disk Query
View the folder size in du-sh
The memory process load is complete.
Uptime query of running time load and other information
The linux system is mainly used for programming and development. You need to use Command commands to query machine configurations. All actions in the system are queried by Command commands. So we suggest you install a Windows 7 7 system if you really cannot.
In Linux, how does one view the resources occupied by processes?
1. free
This command is used to view the current system memory usage. It displays the remaining and used physical memory, swap memory, shared memory, and kernel buffer in the system.
2. top
Usage: top [-] [d delay] [q] [c] [S] [s] [n]
Description: displays the process status in real time.
D: Change the display update speed, or press s in the interactive command Column
Q: there is no delay in display speed. if the user has the superuser permission, top will be executed in the highest priority.
C: Switch the display mode. There are two modes: one is to display only the name of the execution file, and the other is to display the complete path and name S: accumulative mode, the CPU time of the completed or deduplicated sub-itinerary (dead child process) is accumulated.
S: security mode. Cancel negotiated commands to avoid potential crisis.
I: Do not display any idle (idle) or useless (zombie) itinerary
N: number of updates. After the update is completed, the system will exit the top
B: The batch file mode, used together with the "n" parameter, can be used to output the top result to the file.
Example:
It is displayed that the system exits after 10 updates;
Top-n 10
3. ps
Usage: ps [options] [-- help]
Views: displays the dynamics of the instantaneous process.
Parameters:
There are many ps parameters. Only a few common parameters are listed here and their meanings are briefly described.
-A: list all the itineraries.
-W display widening can display more information
-Au displays more detailed information
-Aux: Show All itineraries containing other users