logo NodeSeekbeta

教程,检查自己的kvm内存有没有被超售

1234
  • 掃盲貼!支持一下!!

  • 支持洁癖,大项目就该用独享的 ac01

  • 🚫
  • 🚫
  • @DASS #23
    @DASS 的祖坟被拆迁办抹平了,原址改建公共厕所,昨天爆大粪了,@DASS 去祭奠它野妈被喷一脸屎,吮指直呼美味不可阻挡。

  • 谢谢分享好帖子,第一次学到这方面知识

  • 感谢分享

  • @斯大林 #0

    感谢您发布此信息! 我刚刚开始了解 KVM,所以本教程很有帮助!
    Thanks for posting this! I am just beginning to learn about KVM, so this tutorial was helpful!

    如果有人感兴趣,这里是我的教程小提纲以及来自 Google Cloud 和 Oracle Cloud 的 KVM VPSes 的快速测试。
    In case anybody is interested, here is my little outline of the tutorial plus quick tests from KVM VPSes at Google Cloud and at Oracle Cloud.

    KVM memory overbooking

      Memory exchange (swap) 
        - host's swap is used as memory
        - high iowait, memcached causes iowait to explode
        - Check: memory i/o speed is lower than 1G/s (ddr3 ecc is faster than this)
      Balloon -- virtio_balloon kmod installed in VM returns VM memory to host
        - no obvious performance disadvantage
        - Check `lsmod | grep virtio`; if yes, `rmmod virtio_balloon`
      KSM -- Kernel Samepage Merging -- beginning with 2.6.32, kernel scans VM memory area
        - no normal disadvantages
        - full host memory triggers OOM kill of rewrite crashes VM page modification
        - Check: `cat /sys/kernel/mm/ksm/run` ; 0 = off, 1 = on, 2 = forcibly stopped 
      ZRAM -- Memory compression on the host
    

    Oracle Cloud (VM.Standard.E2.1.Micro x86_64)

    [opc@instance-20220717-1620 ~]$ date
    Mon Jun 12 01:36:48 GMT 2023
    [opc@instance-20220717-1620 ~]$ swapon
    NAME        TYPE SIZE   USED PRIO
    /.swapfile  file 1.3G 399.5M   -2
    /.swapfile1 file   2G    12K   -3
    [opc@instance-20220717-1620 ~]$ lsmod | grep virtio
    virtio_net             57344  0
    net_failover           20480  1 virtio_net
    virtio_scsi            24576  3
    virtio_pci             20480  0
    virtio_pci_legacy_dev    16384  1 virtio_pci
    virtio_pci_modern_dev    16384  1 virtio_pci
    [opc@instance-20220717-1620 ~]$ cat /sys/kernel/mm/ksm/run
    0
    [opc@instance-20220717-1620 ~]$ 
    

    Google Cloud (e2 micro Intel Haswell)

    root@gc:~# date
    Mon 12 Jun 2023 01:40:48 AM UTC
    root@gc:~# swapon
    root@gc:~# mount | grep swap
    root@gc:~# lsmod | grep virtio
    virtio_balloon         20480  0
    virtio_rng             16384  0
    rng_core               16384  1 virtio_rng
    virtio_scsi            20480  1
    scsi_mod              249856  3 virtio_scsi,sd_mod,sg
    virtio_net             53248  0
    net_failover           20480  1 virtio_net
    virtio_pci             28672  0
    virtio_ring            28672  5 virtio_rng,virtio_balloon,virtio_scsi,virtio_pci,virtio_net
    virtio                 16384  5 virtio_rng,virtio_balloon,virtio_scsi,virtio_pci,virtio_net
    root@gc:~# cat /sys/kernel/mm/ksm/run
    0
    root@gc:~# 
    

    似乎谷歌正在使用 virtio_balloon,但甲骨文没有。
    It seems like Google is using the virtio_balloon, but Oracle is not.

    记得添加第二个交换文件 到 Oracle 实例。 我想我可能也添加了第一个交换文件,但也许第一个交换文件是实例附带的。 也许我在某处有笔记。
    I remember adding the second swap file to the Oracle instance. I think I might have added the first swap file also, but maybe the first swap file came with the instance. Maybe I have notes somewhere.

    再次感谢发布教程!
    Thanks again for posting the tutorial!


    Tom

  • 大佬们都很专业,谢谢!

  • 牛,学到啦

1234

你好啊,陌生人!

我的朋友,看起来你是新来的,如果想参与到讨论中,点击下面的按钮!

📈用户数目📈

目前论坛共有15856位seeker

🎉欢迎新用户🎉