Windows limits of sockets

有的操作系统的license会限制socket的数目 ,如Windows Desktop最多支持2个Socket,Windows Server最多支持4个Socket。另外一般地在不同的core上的2个threads的性能会比2个在同相core上的threads的性能要好。同时vCPU topology, libvirt将一个vCPU在虚机中视为: 1 socket with 1 core and no hyper-threads

简要叙述一下Openstack生成CPU topology的过程:

  • 根据image.metedata得到虚机期望的和最大范围的(Socket、Core、Thread)
    • hw_cpu_max_sockets、hw_cpu_max_cores、hw_cpu_max_threads指定范围
    • hw_cpu_sockets、hw_cpu_sockets、hw_cpu_sockets指定期望
  • 根据flavor.vcpu 列举出所有的socket/core/thread  即vcpu=socket*core*thread
  • 利用指定的期望参数和高性能筛选出合适的socket/core/thread组合 即Thread尽量分配到不同的Socket和Core

Windows limits the number of sockets 的解决方法:

    Openstack版本: Mitaka

    指定Windows image支持的hw_cpu_sockets最大值,如下图:

Windows limits of sockets

参考文档:

      http://blog.csdn.net/quqi99/article/details/50988089

      https://wiki.openstack.org/wiki/VirtDriverGuestCPUMemoryPlacement