View Ubuntu System Resource Usage commands encyclopedia

Source: Internet
Author: User
Tags memory usage resource safe mode cpu usage

View Ubuntu's Resource Occupancy command as $: top

The top command can view memory, CPU, and process

Top

Main parameters

D: Specifies the interval of the update, measured in seconds.

Q: No delayed updates. If the consumer has superuser, the top command executes with the highest precedence.

C: Displays the full path and name of the process.

S: Cumulative mode, which accumulates the CPU time of a completed or missing child stroke.

S: Safe mode.

I: Do not show any idle (Idle) or useless (Zombie) journeys.

N: Shows the number of updates, when completed will exit to

Display parameters:

PID (Process ID): progress indicator number.

User: The username of the process owner.

PR: The priority level of the process.

NI: The priority value of the process.

Virt: The virtual memory value that the process occupies.

RES: The physical memory value that the process occupies.

SHR: The shared memory value that the process uses.

S: The state of the process where s indicates hibernation, R indicates that it is running, Z indicates zombie state, n indicates that process priority is negative.

%CPU: The CPU usage that the process occupies.

%mem: The percentage of physical memory and total memory consumed by the process.

Time+: The total CPU time that was consumed by the process after it was started.

Command: The name of the startup command that the process starts, and if this line does not appear, the process will have a complete command line.

Top command

Space: Refresh immediately.

P: Sort According to CPU usage size.

T: Sorted by Time, cumulative time.

Q: Exit Top command.

M: Toggle display memory information.

T: Toggles the display of process and CPU state information.

C: Toggle display command name and full command line.

M: Sort based on the size of memory used.

W: Writes the current settings to the ~/.TOPRC file. This is the recommended method for writing the top configuration file.

Free

1. Role

The free command is used to display memory usage, which is used by all users.

2. Format

free [-b-k-m] [-O] [-s delay] [-t] [-v]

3. Main parameters

-b-k-M: Displays memory usage in bytes (KB, MB), respectively.

-S delay: Displays the number of seconds per second to show memory usage.

-T: Displays the memory sum column.

-O: Buffer throttling columns are not displayed.

Uptime

18:59:15 up min, 2 users, load average:1.23, 1.32, 1.21

Now the time

The time that the system has been powered up to now

Number of users Wired

Last minute, five minutes and 15 minutes of system load

Parameters:-V Displays version information.

Vmstat

Procs ——— –memory ———-— swap–-–io--–system–--cpu--

R b swpd free buff cache si so bi bo in CS US sy ID WA

0 1 24980 10792 8296 47316 5 19 205 52 1161 698 26 3-1 70

1 Observation of disk activity

Disk activity is mainly understood from the following indicators:

BI: Represents the number of blocks (BLOCKS/S) read from disk per second. The larger the number, the more activity it means to read the disk.

Bo: Represents the number of blocks written to disk per second (BLOCKS/S). The larger the number, the more activity it means to write a disk.

Wa:cpu the percentage of time to wait for disk I/O (pending disk IO). The larger the number, the more serious the file system activity is blocking the CPU, because the CPU is waiting for the slow disk system to provide the data. WA is the ideal for 0. If WA is often greater than 10, the file system may require performance tuning.

2 Observation of CPU activity

Vmstat is more reflective of CPU usage than top:

US: The percentage of time that the user program uses the CPU. The larger the number, the busier the user process is.

SY: The percentage of time the system calls use CPU. Note that NFS is running in the kernel, so the CPU time consumed by the NFS activity is reflected in SY. This number is often very large, you need to pay attention to whether a kernel process, such as NFS task is more onerous. If us and Sy are both large, we need to consider separating some of the user programs from other servers to avoid interacting with each other.

The proportion of ID:CPU idle time.

Wa:cpu the time scale for pending disk IO.

Iostat

Used to count CPU usage and i/0 of TTY devices, hard drives, and CD-ROMs

Parameters:

-C shows only CPU rows

-D Display Disk line

-k displays disk output in kilobytes

-T include timestamp in output

-X includes extended disk metrics in the output

AVG-CPU:%user%nice%sys%iowait%idle

20.25 0.18 2.61 76.39 0.57

%iowait% CPU idle time while waiting for local I/O

%idle% CPU idle time without waiting for local I/O

Device:tps blk_read/s blk_wrtn/s Blk_read Blk_wrtn

HDA 9.86 284.34 84.48 685407 2036

Total number of transfers per second (TPS), 512-byte block reads per second (BLK_READ/S), 512-byte block writes per second (BLK_WRTN/S), and 512-byte block reads (Blk_read) and writes (BLK_WRTN).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.