Search

8.2. Memory Tuning Tips

download PDF
To optimize memory performance in a virtualized environment, consider the following:
  • Do not allocate more resources to guest than it will use.
  • If possible, assign a guest to a single NUMA node, providing that resources are sufficient on that NUMA node. For more information on using NUMA, see Chapter 9, NUMA.
  • When increasing the amount of memory a guest virtual machine can use while the guest is running, also referred to as hot plugging, the memory needs to be manually brought online on the guest by one of the following methods:
    • Create a custom udev rule
      1. Create a file with a name that ends in the .rulessuffix in the /etc/udev/rules.d/ directory:
        # touch /etc/udev/rules.d/rulename.rules
      2. Add the memory onlining to the created file:
        # echo 'SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online"' > /etc/udev/rules.d/rulename.rules
      3. Reload udev rules:
        # udevadm control --reload
    • Bring inactive memory online manually after each hot plug
      # for mblock in /sys/devices/system/memory/memory*; do echo online > $mblock/state; done
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.