When learning swoole, it is recommended that the number of worker processes opened is 1-4 times the number of CPU cores. So I learned how to check the number of CPU cores
# 查看物理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># 查看CPU信息(型号)<br>cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
The above introduces how to check the number of physical CPUs, cores, and logical CPUs in Linux, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.