Uptime
The Linux uptime command is primarily used to obtain information such as host uptime and query Linux system load.
eg
# uptime
02:03:50 up 126 days, 12:57, 2 users, load average:0.08, 0.03, 0.05
10:19:04 up 257 days, 18:56, users, load average:2.10, 2.10,2.09
Display Content Description:
10:19:04//System Current time
Up 257 days, 18:56//host has run time, the greater the time, the more stable your machine.
Number of users//user connections, which is the total number of connections, not the number of users
Load average//System average load, statistics last 1, 5, 15 minutes of system average load
So what is the average system load?
The average system load is the average number of processes running in a queue during a specific time interval .
If the current number of active processes per CPU core is not greater than 3, then the performance of the system is good.
If the number of tasks per CPU core is greater than 5, then there is a serious problem with the performance of this machine.
If your Linux host is 1 dual-core CPUs, when load Average is 6, it means that the machine is fully used.
1 can be considered as the optimal load value. The load will vary with the system.
Single CPU system 1-3 and SMP system 6-10 are all possible to accept.
Cat/proc/loadavg
# Cat/proc/loadavg
0.00 0.01 0.05) 2/384 4482
0.00 0.01 0.05 Indicates the average load of the system for the last 1 minutes, 5 minutes, 15 minutes; The higher the system load, the busier the CPU is.
2/384 2 represents the number of processes in the running queue at this time; 384 represents the total number of processes in the system
4482 represents the ID of the last process created at this end.
W
# W
02:14:34 up 126 days, 13:08, 2 users, load average:0.00, 0.01, 0.05
USER TTY from [email protected] IDLE jcpu PCPU
Root Tty1-29jul16 114days 0.63s 0.30s-bash
Ceshi pts/0 118.247.5.122 02:03 0.00s 0.00s 0.00s W
User: Username
TTY: The terminal number assigned by the system after recording
From: Remote host name (that is, where to log in from)
[Email protected]: when to login
Idle: How long it has been idle, indicating when the user is idle.
JCPU: The time taken by all processes connected to the terminal (TTY), which does not include the past background job time, but includes the currently running background job
Elapsed time
PCPU: Refers to the time taken by the current process (that is, the process displayed in the What item)
What: the command line that is currently running the process
Tload
# tload
0.23, 0.32, 0.45
Average load: 0.23, 0.32, 0.45 represents the average system load for the last 1 minutes, 5 minutes, and 15 minutes.
Top
# Top
top-21:23:53 up min, 2 users, load average:0.19, 0.35, 0.47
tasks:255 Total, 1 running, 253 sleeping, 0 stopped, 1 zombie
%CPU (s): 1.1 us, 0.3 sy, 0.0 ni, 98.6 ID, 0.0 wa, 0.0 hi, 0.0 si, 0.0th
KiB mem:4022756 Total, 2130488 used, 1892268 free, 192608 buffers
KiB swap:19999740 Total, 0 used, 19999740 free. 919724 Cached Mem
The first line: The time is: 21:23:53; The 40min has been run; Current online users: 2; Average load: 0.19, 0.35, 0.47 indicates the last 1 minutes, 5 minutes, 15 minutes of system flat
The average load.
Second line: Total number of processes: 255 Running processes: 1 Number of sleep processes: 253 number of processes stopped: 0 Number of zombie processes: 1
Third line: User space consumption CPU percent: 1.1% kernel space consumption cpu percent: 0.3% the process in the user process space has changed the priority level of CPU consumption
Ratio: 0% Idle cpu percent: 0.0% CPU time waiting for input and output: 0.0 total time spent on soft interrupts for CPU services: 0.0% steal
time:0.0%
Line four: Total physical memory: 4022756 Total physical memory used: 2130488 Total free Memory: 1892268 amount of memory used as the kernel cache: 192608
Line five: Total swap area: 19999740 Total swap area used: 0 Total Idle swap area: 19999740 total buffer swap: 919724
Line six: Process ID, process owner, priority, nice value, negative indicates high priority, positive value indicates low priority, total amount of virtual memory used by the process, process used, not
The amount of physical memory swapped out, the size of the shared memory, the status of the process, the percentage of CPU time that was last updated to current, the percentage of physical memory used by the process, the
Total CPU time, command name, command line
Linux view the current system load situation