Home > Backend Development > PHP Tutorial > Linux Check the number of physical CPUs, cores, logical CPUs, and linux_PHP tutorial

Linux Check the number of physical CPUs, cores, logical CPUs, and linux_PHP tutorial

WBOY
Release: 2016-07-12 09:01:55
Original
905 people have browsed it

Linux check the number of physical CPUs, cores, logical CPUs, and linux

When learning swoole, it is recommended that the number of worker processes opened is the number of cpu cores1-4 times. So let’s learn how to check the CPU core count

# 查看物理CPU个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

# 查看每个物理CPU核数
cat /proc/cpuinfo| grep "cpu cores"| uniq

# 查看逻辑CPU个数
cat /proc/cpuinfo| grep "processor"| wc -l<br /><br /># 查看CPU信息(型号)<br />cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1087778.htmlTechArticleLinux Check the number of physical CPUs, number of cores, number of logical CPUs, and the number of linux. When learning swoole, it is recommended The number of worker processes opened is 1-4 times the number of CPU cores. So I learned how to check the CPU core number...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template