


The commands to view the linux load are: 1. [top] command to view the linux load; 2. [uptime] command to view the linux load; 3. [w] command to view the linux load; 4. [vmstat] command to view linux load.
The command to view the linux load is:
1. The top command to view the linux load:
Related learning recommendations: linux video tutorial
Explanation of the first line:
top - 11:03:08 up 1 days, 04:01, 3 user, load average: 0.05, 0.05, 0.01
11:03:08: System current time
up 1 days, 04:01: Elapsed time since system boot 1 day
- ##3 users: Currently 3 users are online
- load average:0.05, 0.05, 0.01: system 1 minute, 5 minutes, 15 Minute CPU load information.
Explanation of the second line:
Tasks: 176 total, 1 running, 175 sleeping, 0 stopped, 0 zombie
- 176 total: There are currently 176 tasks
- 1 running: 1 task is running
- 175 sleeping: 175 processes are sleeping
- 0 stopped: Number of stopped processes
- 0 zombie: Number of zombie processes
Explanation of the third line:
%Cpu(s): 0.1 us, 0.2 sy, 0.2 ni, 99.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
- 0.1%us: The percentage of CPU time occupied by user mode processes
- 0.2%sy: The percentage of CPU time occupied by the kernel
- 0.2%ni : The CPU time percentage of the user-mode process of the task with a negative renice value. Nice means priority
- 99.4%id: Percentage of idle CPU time
- 0.0%wa: Percentage of CPU time waiting for I/O
- 0.0%hi: CPU hard interrupt time percentage
- 0.0%si: CPU soft interrupt time percentage
Explanation of the fourth line:
KiB Mem : 3882172 total, 1079980 free, 1684652 used, 1117540 buff/cache
- 3882172 k total: total physical memory
- 1684652k used: Physical memory used
- 1079980k free: free physical memory
- 1117540k cached: memory used as cache
Explanation of the fifth line:
KiB Swap: 0 total, 0 free, 0 used. 1871412 avail Mem
- 0k total: the total amount of swap space ##0k used : Used swap space
- 0k free: Free swap space
- ##1871412k cached: Cached swap space
- Last line:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMANDPID: Process ID
- USER: Owner of the process
- PR: Priority of the process
- NI: nice value
- VIRT: occupied virtual Memory
- RES: Physical memory occupied
- SHR: Shared memory used
- S : Progress state S: Hibernate R Running Z zombie process N Nice value is negative
- %CPU: Occupied CPU
- %MEM: Occupied Memory
- TIME: The cumulative value of the time occupied by the CPU
- COMMAND: Start command
- 2. Check the linux load at uptime:
3. Check the linux load with w:
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
Explanation is as follows:- TTY - Terminal number assigned by the system after login
- FROM—Remote host name, that is, where to log in from
- LOGIN@—When to log in
##IDLE —How long has it been idle, indicating the time the user has been idle. This is a timer that will be reset once the user performs any operation.
JCPU—The time occupied by all processes connected to the terminal (tty). This time It does not include the past background job time, but includes the time taken by the currently running background job.
PCPU - refers to the current process (that is, the process displayed in the WHAT item) Time taken
WHAT—Command line of the currently running process
- 4. Check linux load with vmstat
r
represents the running queue (that is, how many processes are actually assigned to CPU), when this value exceeds the number of CPUs, a CPU bottleneck will occur. This is also related to the load of top. Generally, if the load exceeds 3, it is relatively high, if it exceeds 5, it is high, if it exceeds 10, it is abnormal, and the status of the server is very dangerous. The load of top is similar to the run queue per second. If the run queue is too large, it means that your CPU is very busy, which generally results in high CPU usage.#b
represents a blocked process. I won’t go into details about this, but everyone knows that the process is blocked.swpd The used size of virtual memory. If it is greater than 0, it means that your machine’s physical memory is insufficient. If it is not the cause of program memory leak, then you should upgrade the memory or reduce the consumption. Memory tasks are migrated to other machines.
free
The size of free physical memory, my machine memory has a total of 8G, and the remaining 3415M.-
buff Linux/Unix
The system is used to store, cache the content in the directory, permissions, etc. My machine takes up about 300 M cache cache
is directly used to remember the files we open and buffer them. (This is the cleverness of Linux/Unix, taking part of the free physical memory. The purpose of caching files and directories is to improve the performance of program execution. When the program uses memory, buffer/cached will be used quickly.)
si
The size of the virtual memory read from the disk per second. If this value is greater than 0, it means that the physical memory is not enough or the memory is leaked. You need to find the memory-consuming process and solve it. My machine has plenty of memory and everything works fine.so
The size of virtual memory written to disk per second. If this value is greater than 0, the same as above.bi
The number of blocks received by the block device per second. The block device here refers to all disks and other block devices on the system. The default block size is 1024byte.bo
The number of blocks sent by the block device per second. For example, when we read a file, bo must be greater than 0. Bi and bo are generally close to 0, otherwise the IO is too frequent and needs to be adjusted.in
Number of CPU interrupts per second, including time interrupts
## cs
The number of context switches per second. For example, when we call a system function, we need to perform context switching, thread switching, and process context switching. The smaller the value, the better. If it is too large, consider lowering the thread or The number of processes. For example, in web servers such as apache and nginx, when we do performance testing, we usually conduct thousands or even tens of thousands of concurrency tests. The processes selected for the web server can be adjusted downward according to the peak value of the process or thread. Stress testing , until cs reaches a relatively small value, the number of processes and threads is a more appropriate value. The same goes for system calls. Every time a system function is called, our code will enter the kernel space, causing context switching. This is very resource-consuming, and we should try to avoid calling system functions frequently. Excessive context switching means that most of your CPU is wasted on context switching, resulting in less time for the CPU to do serious work, and the CPU is not fully utilized, which is not advisable.
us
User CPU time, I was once on a server that does encryption and decryption very frequently. I can see that us is close to 100, and the r run queue reaches 80 (machine Doing stress testing, performance is not good).
sy
System CPU time, if it is too high, it means that the system call time is long, such as frequent IO operations.
id
Idle CPU time, generally speaking, id us sy = 100, it is generally believed that id is the idle CPU usage, us is the user CPU usage, sy is the system CPU usage.
#wt
Waiting for IO CPU time.
5. Some other operations
- ##cat /proc/cpuinfo
: You can view it CPU information, several processors equal several CPUs;
- #sar
: You can monitor the status of all resources in the system, sar -n DEV to check the network card traffic history, sar - q Check the historical load. The most useful thing is to check the network card traffic. If the traffic is too large: If rxpck/s is greater than 4000, or rxKB/s is greater than 5000, it is likely to be attacked, and packet capture and analysis are required;
- free
: View the total memory size of the current system and memory usage;
- ps
: View the process, ps aux or ps -elf, often used together with the pipe character, to view a process or its number;
- netstat
: View the port, netstat -lnp is used Print which ports are currently enabled on the system. netstat -an is used to print network connection status;
- tcpdump
: Packet capture tool analyzes data packets to know which IPs are there Attack; you can write the content into the specified file 1.cap, display the contents of the package, and display the data flow direction on the screen without adding -w;
wireshark
: Packet capture tool, you can temporarily use this command to view web requests on the current server
The above is the detailed content of What command is used to check the Linux load?. For more information, please follow other related articles on the PHP Chinese website!

The basic structure of Linux includes the kernel, file system, and shell. 1) Kernel management hardware resources and use uname-r to view the version. 2) The EXT4 file system supports large files and logs and is created using mkfs.ext4. 3) Shell provides command line interaction such as Bash, and lists files using ls-l.

The key steps in Linux system management and maintenance include: 1) Master the basic knowledge, such as file system structure and user management; 2) Carry out system monitoring and resource management, use top, htop and other tools; 3) Use system logs to troubleshoot, use journalctl and other tools; 4) Write automated scripts and task scheduling, use cron tools; 5) implement security management and protection, configure firewalls through iptables; 6) Carry out performance optimization and best practices, adjust kernel parameters and develop good habits.

Linux maintenance mode is entered by adding init=/bin/bash or single parameters at startup. 1. Enter maintenance mode: Edit the GRUB menu and add startup parameters. 2. Remount the file system to read and write mode: mount-oremount,rw/. 3. Repair the file system: Use the fsck command, such as fsck/dev/sda1. 4. Back up the data and operate with caution to avoid data loss.

This article discusses how to improve Hadoop data processing efficiency on Debian systems. Optimization strategies cover hardware upgrades, operating system parameter adjustments, Hadoop configuration modifications, and the use of efficient algorithms and tools. 1. Hardware resource strengthening ensures that all nodes have consistent hardware configurations, especially paying attention to CPU, memory and network equipment performance. Choosing high-performance hardware components is essential to improve overall processing speed. 2. Operating system tunes file descriptors and network connections: Modify the /etc/security/limits.conf file to increase the upper limit of file descriptors and network connections allowed to be opened at the same time by the system. JVM parameter adjustment: Adjust in hadoop-env.sh file

This guide will guide you to learn how to use Syslog in Debian systems. Syslog is a key service in Linux systems for logging system and application log messages. It helps administrators monitor and analyze system activity to quickly identify and resolve problems. 1. Basic knowledge of Syslog The core functions of Syslog include: centrally collecting and managing log messages; supporting multiple log output formats and target locations (such as files or networks); providing real-time log viewing and filtering functions. 2. Install and configure Syslog (using Rsyslog) The Debian system uses Rsyslog by default. You can install it with the following command: sudoaptupdatesud

When choosing a Hadoop version suitable for Debian system, the following key factors need to be considered: 1. Stability and long-term support: For users who pursue stability and security, it is recommended to choose a Debian stable version, such as Debian11 (Bullseye). This version has been fully tested and has a support cycle of up to five years, which can ensure the stable operation of the system. 2. Package update speed: If you need to use the latest Hadoop features and features, you can consider Debian's unstable version (Sid). However, it should be noted that unstable versions may have compatibility issues and stability risks. 3. Community support and resources: Debian has huge community support, which can provide rich documentation and

This article describes how to use TigerVNC to share files on Debian systems. You need to install the TigerVNC server first and then configure it. 1. Install the TigerVNC server and open the terminal. Update the software package list: sudoaptupdate to install TigerVNC server: sudoaptinstalltigervnc-standalone-servertigervnc-common 2. Configure TigerVNC server to set VNC server password: vncpasswd Start VNC server: vncserver:1-localhostno

Configuring a Debian mail server's firewall is an important step in ensuring server security. The following are several commonly used firewall configuration methods, including the use of iptables and firewalld. Use iptables to configure firewall to install iptables (if not already installed): sudoapt-getupdatesudoapt-getinstalliptablesView current iptables rules: sudoiptables-L configuration


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft