Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

View system load command

2025-02-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

What are the commands to view the load?

I. uptime command

1.uptime detailed explanation

The uptime command is mainly used to obtain information such as host running time and query linux system load. The uptime command used to show only how long the system was running. Now, you can show how long the system has been running, and the information is as follows: the current time, how long the system has been running, how many login users there are, and the average load of the system in the past 1 minute, 5 minutes and 15 minutes.

two。 Usage

Uptime

Detailed explanation of display content

10:19:04 / / system current time

Up 257 days, 18:56 / / the host has been running time, the longer the time, the more stable your machine.

12 user / / number of user connections, which is the total number of connections rather than the number of users

Load average / / average load of the system, statistics of the average load of the system for 15 minutes in the last 15 minutes

So what is the average system load? The average system load is the average number of processes in the running queue during a specific time interval.

If the number of currently active processes per CPU kernel is not greater than 3, then the performance of the system is good. If the number of tasks per CPU kernel is greater than 5, then the performance of this machine has a serious problem.

II. W command

1.w detailed explanation

The Linux w command is used to display user information that is currently logged into the system.

Execute this instruction to know who are currently logged in to the system and the programs they are executing.

Executing the w instruction alone displays all users, or you can specify a user name to display only information about a user.

two。 Usage

W [- fhlsuV] [user name]

3. Parameter description

-f turns on or off showing where the user logs in to the system.

-h does not display the title information column of each field.

-l uses a detailed format list, which is the default value.

-s uses a concise format list and does not show the login time of the user, the CPU time spent by the terminal phase jobs and programs.

-u ignores the name of the executing program and the information that the program takes CPU time.

-V displays version information.

Example: view system load

Detailed explanation of the main contents

Load average / / average load of the system, statistics of the average load of the system for 15 minutes in the last 15 minutes

So what is the average system load? The average system load is the average number of processes in the running queue during a specific time interval.

If the number of currently active processes per CPU kernel is not greater than 3, then the performance of the system is good. If the number of tasks per CPU kernel is greater than 5, then the performance of this machine has a serious problem.

The first number indicates the average number of tasks using cpu in one minute.

The second number indicates the average number of tasks using cpu in 5 minutes.

The third number indicates the average number of tasks using cpu in 15 minutes.

Example: does not show where the user logs in

W-f

Example: display version information

W-V

Three. Top command

1.top detailed explanation

Top command is a commonly used performance analysis tool under Linux, which can display the resource consumption of each process in the system in real time, similar to the task manager of Windows. How to use it is described in detail below. Top is a dynamic display process, that is, the user can press the key to constantly refresh the current state. If the command is executed at the foreground, it will monopolize the foreground until the user terminates the program. More accurately, the top command provides real-time monitoring of the status of the system processor. It will display a list of CPU's most sensitive tasks in the system. This command can be used by CPU. Memory usage and execution time sort tasks; and many of the features of this command can be set through interactive commands or in personal customization files.

two。 Command format:

Top [parameters]

3. Command function:

Displays information about the processes being executed by the current system, including process ID, memory usage, CPU occupancy, etc.

4. Command parameters:

-b batch processing

-c displays the complete governance command

-I ignore the failure process

-s security mode

-S accumulation model

-I set the interval

-u specify user name

-p specify the process

The number of times the-n loop is displayed

Top

Explanation of some of the final output information:

Load average: 0.09, 0.05, 0.01

The three numbers represent the average system load for different time periods (one minute, five minutes, and fifteen minutes), and of course, the smaller the number, the better. the rule of "the number of cores is the load": in multi-core processing, your system average should not be higher than the total number of processor cores.

The memory used by a process can be top, with three columns of VIRT RES SHR, indicating the memory used by the process. VIRT identifies the total amount of memory that the process can use, including the actual memory used by the process, the mapped files, the memory shared with other processes, and so on. RES identifies the actual amount of memory consumed by the process. SHR identifies the memory and library size that can be shared with other processes.

Example: specify root as the user name to view the usage of each process

Top-U root

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report