Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Tuning CPUs and Hugepages on a Linux System

This hands-on lab will focus on CPU tuning and configuring `hugepages` on a lab system. You will be using `tuna` to view open CPU threads, filtering the output for a specific script, then isolating the script to a specific CPU. When CPU tuning is complete, you will set a value for `hugepages` and disable transparent `hugepages`, then confirm the changes after loading the new configuration. *This course is not approved or sponsored by Red Hat.*

Google Cloud Platform icon
Lab platform
Lab Info
Level
Advanced
Last updated
Sep 20, 2025
Duration
45m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Manage CPU Affinity Using a PID or Process Name
    1. Install the tuna package.
    2. Launch the affinity.sh script in the background.
      • The script spawns a dd process in the background.
    3. Use tuna to show open threads, filtering for dd.
      • Make note of the current thread affinity.
    4. Use tuna to move the dd instance to CPU 0.
    5. Confirm the process has moved using tuna, filtering for dd.
      • Verify the current thread affinity is set to 0.
    6. Kill the dd process.
  2. Challenge

    Manage CPU Affinity Using Systemd
    1. Enable and start the evodd service.
      • The service spawns a dd process in the background.
    2. Use systecmctl to create an override file for the evodd service.
      • Under [Service], and an entry CPUAffinity and set the value to CPU 0.
      • Execute the daemon-reload.
      • Cycle the evodd service.
    3. Confirm the process has moved using tuna, filtering for dd.
      • Verify the current thread affinity is set to 0.
    4. Stop and disable the evodd service.
  3. Challenge

    Review the System's Hugepages Configuration
    1. Check for any kernel configurations.
      • Check the values in /proc/cmdline.
      • Check the grub configuration file.
    2. Review the current hugepages values.
      • Review the values in /proc/meminfo.
      • Check the values using sysctl.
    3. Determine if transparent hugepages are enabled.
      • Check the value of /sys/kernel/mm/transparent_hugepage/enabled.
  4. Challenge

    Configure a Hugepages Value and Disable Transparent Hugepages
    1. Option 1: Create a control file in /etc/sysctl.d/.
      • Enter new hugepages value.
      • Save the file.
      • Load changes using sysctl -p
      • Not the solution used in this lab.
    2. Option 2: Add the kernel options to the grub configuration.
      • Edit /etc/default/grub.
      • Scroll down to the GRUB_CMDLINE_LINUX row in the file.
        • To enable and set the number of hugepages, scroll to the end of the line and add hugepages=, followed by the value.
        • To set the default hugepages size, you can added default_hugepagesz=.
        • To disable transparent hugepages, you would add transparent_hugepages=never.
      • Save the file and complete the grub updates steps, then reboot the system to pick up the changes.
      • Not the final solution for the lab.
    3. Option 3: Use tuned to manage hugepages.
      • Create a tuned profile called huge_profile.
      • Create the configuration file and open it for editing.
        • Create the [main] section and include the virtual-guest profile.
        • To enable huge pages, go to the [sysctl] section, add the vm.nr_hugepages entry and set the value to 10.
        • To disable transparent huge pages, add a section called [vm], add an entry called transparent_hugepages and set the value to never.
      • Enable and validate the custom profile.
        • Using the appropriate tuned command, enable the profile.
        • Verify the profile has been loaded and settings applied using the appropriate tuned command.
      • Validate the changes on the system.
    4. Review the current hugepages values.
      • Review the values in /proc/meminfo.
      • Check the values using sysctl.
    5. Confirm transparent hugepages are disabled.
    6. This will be the option focused on for the lab.
  5. Challenge

    Reboot the Lab and Confirm Changes Persist
    1. Verify the custom profile is active.
    2. Validate the changes on the system.
      • Review the current hugepages values.
        • Review the values in /proc/meminfo.
        • Check the values using sysctl.
      • Confirm transparent hugepages are disabled.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight