In Linux, you can view the number of physical CPUs, cores, logical CPUs, and linux. In Linux, when you view the number of physical CPUs, cores, and logical CPUs, we recommend that you enable the number of worker processes to 1 to 4 times the number of CPU cores. So I learned how to view the number of CPU cores. in Linux, I checked the number of physical CPUs, the number of cores, the number of logical CPUs, and the number of linux.
When learning swoole, it is recommended that the number of worker processes enabled is1-4Times. So I learned how to view the number of CPU cores.
# View the number of physical CPUs cat/proc/cpuinfo | grep "physical id" | sort | uniq | wc-l # view the number of each physical CPU core cat/proc/cpuinfo | grep "CPU cores "| uniq # check the number of logical CPUs cat/proc/cpuinfo | grep" processor "| wc-l
# View CPU information (model)
Cat/proc/cpuinfo | grep name | cut-f2-d: | uniq-c
When swoole is learned by worker, it is recommended that the number of worker processes enabled be 1-4 times the number of cpu cores. So I learned how to view the number of CPU cores...