Linux View hardware commands in detail

Source: Internet
Author: User

1, check the memory usage under the Linux server, you can use the command free-m

[[email protected] ~]# free -m              total       used        free     shared    buffers      cachedmem:           988         693        295           0         21         525-/+ buffers/cache:        145         842swap:         1983           0       1983[[ Email protected] ~]#&nBSP; #total     Total Memory #used     The number of memory used #free     the number of free memory # shared   The total amount of memory shared by multiple processes #buffers   is the I/O cache, buffer #cache     cache for memory and hard disk, is a small but high-speed memory located between the CPU and the main memory

concluded that:

How available memory is calculated:

Available Memory =free+buffer+cache


The difference between cache and buffer:


Cache: Caching is a small but high-speed memory that sits between the CPU and the main memory. Because the CPU speed is much higher than the main memory, the CPU accesses the data directly from the memory to wait for a certain period of time, the cache holds the CPU just used or recycled part of the data, when the CPU re-use the part of the data can be directly called from the cache, which reduces the CPU waiting time, Improve the efficiency of the system. The cache is also divided into one-level cache (L1 cache) and level two cache (L2 cache), L1 cache is integrated within the CPU, L2 cache is usually soldered to the motherboard, and is now integrated into the CPU, with a common capacity of 256KB or 512KB L2 Cache.


Buffer: An area where data is transferred between devices that are not synchronized or that have different priority levels. Through buffers, you can reduce the number of waits between processes, so that when you read data from a slow device, the operating process of a fast device is uninterrupted.


Buffer and cache in free: (They are all memory-intensive):


Buffer: Memory as buffer cache, which is the read and write buffer of the block device


Cache: As the page cache memory, the file system cache


If the cache has a large value, it indicates that the cache has a high number of files. If frequently accessed files can be cache, then the disk read IO must be very small.



2. View the average load on the Linux system

[Email protected] ~]# uptime 18:31:33 up 2:28, 3 users, Load average:0.00, 0.00, 0.00 #它所表示的是过去的1分钟, 5 minutes, 15 minutes in process queue flat Process quantity #如果每个cpu (can be calculated as CPU Core) The current number of active processes is not greater than 3, the system performance is good #如果每个cpu当前的活动进程书不大于4, indicating acceptable #如果每个cpu当前的活动进程书大于5, indicating a serious problem

If the CPU is dual-core, 0.00/2= is the average number of processes requested


3, the level of the log

Emerg emergency-System not available

Alert must take immediate action

Crit Fatal condition

Error condition

Warn warning situation

Notice General Important situation

Info General Information

Debug Error level Information

This article is from the "to where" blog, please be sure to keep this source http://xiangfan365.blog.51cto.com/10488391/1696490

Linux View hardware commands in detail

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.