V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
twl007
V2EX  ›  问与答

Cpu 三级缓存对 Esxi 的影响大么

  •  
  •   twl007 · 2015-01-28 14:17:07 +08:00 · 5785 次点击
    这是一个创建于 3366 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题~~ 在纠结主频差不多的Xeon是选择15MB的三级缓存还是20MB的三级缓存 以前没有关注过CPU的三级缓存是不是会对Esxi产生很大的影响
    运行的虚拟机规模大概是一个双路服务器60台左右的规模~~

    20 条回复    2015-01-29 13:16:46 +08:00
    myliyifei
        1
    myliyifei  
       2015-01-28 14:38:24 +08:00
    一般而言 VM是内存密集型,CPU一般过剩。
    twl007
        2
    twl007  
    OP
       2015-01-28 15:07:23 +08:00 via Android
    @myliyifei 唔 那就好 因为在纠结预算怎么买 内存配置到了192GB 然后IO靠存储 就是cpu拿不准…… 囧……
    cyang
        3
    cyang  
       2015-01-28 15:18:56 +08:00
    对于IU来说三缓还是很重要的
    bellchu
        4
    bellchu  
       2015-01-28 15:22:15 +08:00
    L2-L3对多VM的ESXi性能影响蛮大的,关系到vCPU的load balancing,vCPU都是share的L2-L3的缓存,用它们来做CPU资源的迁移,当然也有LLC调内存处理权重低的作业。

    如果你的服务不涉及大CPU负载的话15和20MB的缓存区别不会太明显。

    但是对于CPU需求高的服务,最明显的一点,对于我自己的一个vcenter cluster,相同内存,主频类似的几个host,host所跑的负载也类似,缓存少的那几台host上的VM更多的报CPU usage不足的警告。

    xenme
        5
    xenme  
       2015-01-28 15:36:29 +08:00
    看负载了。
    一台服务器60个VM,如果高CPU负载,就是神也跑不动啊。
    要是负载都很低,CPU烂也无所谓啊。
    就比如我的LAB,L5520这种垃圾U,跑个几十个VM也不在话下,没压力嘛。
    xenme
        6
    xenme  
       2015-01-28 15:39:50 +08:00
    相对来说,对于VM性能的影响,CPU应该是排最后:
    1. 磁盘IO
    2. 内存
    3. 网络
    4. CPU
    4.1 CPU Cache size
    myliyifei
        7
    myliyifei  
       2015-01-28 15:56:04 +08:00 via Android
    @bellchu 你这个是经验结论还是有官方文档说明的?方便给出出处么
    bellchu
        8
    bellchu  
       2015-01-28 16:52:33 +08:00   ❤️ 1
    @myliyifei 经验,文档应该也有的吧,但是首先要确定你自己要跑什么服务,你拿它来做存储服务的话CPU当然不要紧,vCPU本来就一直处于Idle状态,不需要调配。 如果是CPU要求高的服务那这个cache对性能影响很关键。

    随便找了一个
    http://www.vmware.com/files/pdf/techpaper/VMware-vSphere-CPU-Sched-Perf.pdf

    ----------------------------
    Load Balancing
    ESXi is typically deployed on multiprocessor systems. On multiprocessor systems, balancing CPU load across
    processors, or load balancing, is critical to the performance. Load balancing is achieved by having a world migrate
    from a busy pCPU to a less loaded pCPU. Generally, the world migration improves the responsiveness of a system
    and its overall CPU utilization.
    Consider a system that has only two pCPUs, where a number of worlds are ready to run on one pCPU while none
    on the other. Without load balancing, such imbalance would persist. As a result, the ready worlds accrue
    unnecessary scheduling latency and the CPU utilization becomes only half of what could be attainable.
    On ESXi, the world migration can be initiated by either a pCPU, which becomes idle, or a world, which becomes
    ready to be scheduled. The former is also referred to as pull migration while the latter is referred to as push
    migration. With these migration policies, ESXi achieves high utilization and low scheduling latency.
    The cost of world migration is also carefully evaluated when making a migration decision. When a world migrates
    away from the source pCPU, where it has run awhile and brought instructions and data (the working set*
    ) into the
    on-chip cache, the world has to bring the working set back into the cache†
    of the destination pCPU. For a
    workload that benefits from caching, frequent migrations can be detrimental.
    There are many other factors that need to be considered to make optimal scheduling decision. In vSphere 5.x, the
    goodness load balancing algorithm is introduced.
    xenme
        9
    xenme  
       2015-01-28 17:12:43 +08:00
    @bellchu 这个只能说明cache是一个factor。
    完全没法说明cache大小的重要性。而且看文档提高性能的最大方法就是减少world migration来提供性能。
    bellchu
        10
    bellchu  
       2015-01-28 18:06:49 +08:00
    @xenme When a world migrates away from the source pCPU, where it has run awhile and brought instructions and data (the working set*) into the on-chip cache, the world has to bring the working set back into the cache†of the destination pCPU.

    假设60M的一个world,15M on-chip cache需要migrate 4次,20M on-chip cache需要migrate 3次,L5520需要migrate 7.5次,那是不是cache越大migration越少,性能越高呢?
    xenme
        11
    xenme  
       2015-01-28 20:01:43 +08:00
    @bellchu On modern CPU architectures, multiple cores share last-level cache (LLC), where LLC is the last cache available
    按照这种说法,在多个core(pCPU)之前migrate根本不需要migrate cache.

    你这个例子不恰当。
    20M的 on-chip cache如果产生了60M的world.
    他自己如何保存着60M的world呢?他只能45M保存在memory上,为了migrate这60M得world,他可能需要访问3次memory,这延迟不更大?
    所以,按理来说,这个world只会比他的cache小,20M的L3,他的world可能是20M,我8M的L3,world小点嘛,就8M,你migrate需要一次,我也是一次。

    在考虑另外一种情况,
    至强也就4/6 core per socket居多,按照60个VM来算,每个VM都分一个vcpu,就算普遍点的双路服务器,也就是8/12个physical core,一个core基本是5~8个VM来共享,8个VM基本都要同时运行,CPU在不断切换context,L3里面不可能为每一个VM保存满20M。如果只一个VM的负载发生变化,需要migrate,那么如果是migrate一个context data估计程序也分不清。所以只能是整个core的L3全部migrate,这是好事还是坏事呢?可能这个VM命中的不多,迁移了,发现还不好。你20M可能需要10个时间,我8M可能更快呢。

    所以,我个人指示觉得L3大,肯定有好处。
    但vcenter的performance alert也不能说明就是L3导致的。
    load balance也只能说明L3是一个影响因素,也不能说明L3对整个虚拟化的重要性
    60M的world,几倍几倍,更不鞥你说明问题,访问内存更慢。

    ------
    再有,现在的虚拟化,总体CPU使用率大多都不超过50%,L3大可不必折腾这个。
    真到了需要压榨CPU和系统性能时再考虑不迟。
    bellchu
        12
    bellchu  
       2015-01-28 21:17:12 +08:00
    @xenme 虚拟化的最终目的就是要压榨CPU和系统性能,在保证系统正常运作的情况下,少花钱多办事。大多数情况都用不到50%说明你对项目的评估和设备的采购选型不对称,或者是你不差钱,但是看你所说的这些都是建立在在你的LAB里面创建VM的情况下的,没有实际的”业务“在跑。虚拟化的目的不是为了创建VM而虚拟化。除非你是做小鸡生意的,超卖的话想创建几个VM创建几个,但是对于用户来说,性能就一塌糊涂了。
    xenme
        13
    xenme  
       2015-01-28 22:32:33 +08:00
    @bellchu 5000台左右Physical Server。
    XenServer/vSphere/Hyper-v都在生产中。

    不知道要什么样的才算有实际业务,真没看到做虚拟化的,Host Server CPU常年在80%以上的。
    L3 Cache带来的性能,还不如Hypervisor调度失败导致的性能损耗更多呢。

    至少到现在没看到项目中有单独比较L3对性能的影响。
    可见,这个对整个性能的影响极小,否则,必然是一个metric。
    twl007
        14
    twl007  
    OP
       2015-01-29 08:39:33 +08:00
    @myliyifei
    @cyang
    @bellchu
    @xenme

    谢谢大家回复~~~~
    情况是这样的 教授打算买两台服务器弄一个小的Vmware环境来让学生上课 每个学生大概是有3台虚拟机然后模拟一个小网络赖练习

    主要负载应该还是在刚上课的时候 那个时候大家都要启动虚拟机估计负载很大 CPU的话如果只进行一般的操作貌似Windows也不会占用多少 而且课程不涉及Sql Server这种重型应用

    貌似没有地方可以放机架…… 所以最后还是选了大缓存CPU和192GB内存的配置了 后面的虚拟机就全部都在存储上了~~~
    myliyifei
        15
    myliyifei  
       2015-01-29 10:56:32 +08:00
    @twl007 同时启动的话,设置一个随机启动的时间就好了。。
    twl007
        16
    twl007  
    OP
       2015-01-29 11:27:56 +08:00
    @myliyifei 嗯~~~ 到时都得弄~~ 囧 要不一起启动服务器得爆炸了 = = |||||
    myliyifei
        17
    myliyifei  
       2015-01-29 12:04:15 +08:00
    @xenme 赞成,如果是对CPU要求高,直接对虚拟机的vcpu设置affinity
    myliyifei
        18
    myliyifei  
       2015-01-29 12:05:32 +08:00
    @twl007 一起启动,最大的问题根本不是CPU,而是io storm. esxi 新版本,可以用memory和主机ssd做cache了
    twl007
        19
    twl007  
    OP
       2015-01-29 12:08:33 +08:00
    @myliyifei 额 是么 这么好…… 改天去研究下 因为192GB的内存算了一下全开的话应该还能有个几十G的空余

    后端的SAN应该已经有了SSD来做缓存了 唔 应该还能撑得住 就是担心网络撑不住…… 因为vsphere还是要占不少带宽来传输桌面的
    myliyifei
        20
    myliyifei  
       2015-01-29 13:16:46 +08:00
    @twl007 传输桌面,什么协议?你是要做VDI还是什么。RDP内网也很流畅了。ICA或者PCOIP更好了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   944 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 20:41 · PVG 04:41 · LAX 13:41 · JFK 16:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.