linux下查看逻辑cpu数和物理cpu数

摘自余洪春《构建高可用Linux服务器》

  逻辑CPU数:cat /proc/cpuinfo |grep "processor" |wc -l

  物理CPU数:cat /proc/cpuinfo |grep "physical id" |wc -l

  每个CPU的核数: cat /proc/cpuinfo |grep "cpu cores" |uniq

  逻辑CPU数 未必等于 物理CPU个数 * 核数 (比如超线程的CPU)

  评估服务器性能时,应以逻辑CPU数为主要参考

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.