- 论坛徽章:
- 3
|
今天安装了9台Linux服务器,型号完全不一样(有DELL、HP和IBM服务器),又懒得去对清单,如何在Linux下cpu的个数和核数呢?另外,nginx的cpu工作模式也需要确切的知道linux服务器到底有多少个逻辑cpu,不过现在服务器那是相当的彪悍,直接上worker_processes 8吧。
判断依据:
1.具有相同core id的cpu是同一个core的超线程。(Physical id and core id are not necessarily consecutive but they are unique. Any cpu with the same core id are hyperthreads in the same core.)
2.具有相同physical id的cpu是同一颗cpu封装的线程或者cores。(Any cpu with the same physical id are threads or cores in the same physical socket.)
以自己的惠普DL380G6为例说明:
①物理cpu个数:[root@localhost ~]# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
②每个物理cpu中core的个数(即核数)[root@localhost ~]# cat /proc/cpuinfo | grep "cpu cores" | uniqcpu cores : 4
这样可以推算出自己服务器的逻辑CPU为物理个数*核数,如果你的服务器是server2003,你可以在你的资源管理器里以图形化方式看到你的逻辑CPU个数。
QQ: 326527167
TEL: 18666828617
香港特价服务器租用托管,香港葵芳7*24小时专业高效技术支持,一站式服务,免备案,CN2直连,BGP多线路备份,不限流量,带宽增减灵活,性价比高,满足企业定制化需求。放心租用,安心托管!
整合海外优质资源,提供贴心制定服务
|
|