Home > php教程 > php手册 > Linux查看物理CPU个数、核数,逻辑CPU个数,linux个数

Linux查看物理CPU个数、核数,逻辑CPU个数,linux个数

WBOY
Release: 2016-06-16 09:16:27
Original
1228 people have browsed it

Linux查看物理CPU个数、核数,逻辑CPU个数,linux个数

 学习swoole的时候,建议开启的worker进程数为cpu核数的1-4倍。于是就学习怎么查看CPU核数

# 查看物理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
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template