Linux background Development Common instructions __linux

Source: Internet
Author: User

1, view CPU information

Cat/proc/meminfo

This file gives information about the state of memory. It shows the total amount of free memory in the system, physical memory and swap memory. It also shows the total amount of shared memory and buffers used by the kernel. The format of this information is similar to the result shown by the free command.





2, Cat/proc/cpuinfo

In the Linux operating system, the CPU information is loaded into the Cpuinfo file in the virtual directory/proc under the boot process









Here are some of the more important indicators to analyze:

ID of the processor logical processor.

ID of the processor that is physically encapsulated by the physical ID.

ID of each core ID

The number of cores in the CPU core that are in the same physical package.

Siblings the number of logical processors in processors in the same physical package.

The physical ID in the above figure is 0, indicating that there is only one physical processor;

If the processor has two different numbers and belongs to a phsical ID, and the CPU core value is 2, that means the CPU is dual-core, and each core has only one logical processor.


On this server, ' CPU cores ' has a 4,physical ID, a core ID of 4, a siblings value of 8, and a total of 8 processor.

So this server host's CPU is 1 physically packaged processors, each processor has 4 processing cores (CPU cores), each core of the CPU can be divided into 2 logical processors (Hyper-Threading technology), so There are 8 logical processors (that is, 8 processor) on each physical processor.

http://hanjian861202.iteye.com/blog/964735

To get the logical number of CPUs:

#cat/proc/cpuinfo | grep "Processor" | Wc-l

Get the number of physical CPUs:

#cat/proc/cpuinfo | grep "Physical ID" | Sort | Uniq | Wc-l

Number of core in each physical CPU:
#cat/proc/cpuinfo | grep "CPU Cores" | Wc-l

Is a Hyper-threading.

If there are two logical CPUs with the same "core ID", then the Hyper-threading is turned on.
The number of logical CPUs (possibly core, threads, or both) per physical CPU:
# Cat/proc/cpuinfo | grep "Siblings"




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.