
Configure Tuned and cpufreq for Server Performance Optimization
Why Server Performance Optimization Matters (and Why You Should Care)
If you’re running anything from a tiny Docker container to a beefy dedicated server, you’ve probably heard the phrase “performance optimization” thrown around. But what does it actually mean for you? Well, think about this: slow servers mean slow websites, laggy APIs, and unhappy users. Whether you’re hosting your own blog, running a SaaS, or managing a fleet of microservices, squeezing every drop of performance out of your hardware is money in your pocket (or at least fewer headaches).
Enter Tuned and cpufreq — two tools that can help you get the most out of your server’s CPU without having to swap out hardware or pay for a bigger VPS. In this post, I’ll break down what these tools do, why they’re awesome, and how you can set them up in minutes. Plus, I’ll share some real-world examples, common mistakes, and even a few geeky tricks you might not have thought of.
The Big Three Questions
- How do Tuned and cpufreq actually work?
- How do you set them up quickly (without reading a novel)?
- What are the real-world pros and cons? (And what should you avoid?)
How Does It Work? (Algorithms, Structure, and a Bit of Magic)
Tuned: The Smart Auto-Optimizer
Tuned is like having a sysadmin buddy who tweaks your server settings for you, based on what you’re actually doing. It’s a dynamic tuning daemon that applies “profiles” — sets of kernel and system settings — to optimize for different workloads. For example, there’s a profile for virtual guests, another for throughput, and even one for low-latency workloads.
Under the hood, Tuned can adjust:
- CPU governor (performance, powersave, etc.)
- Disk I/O scheduler
- Network stack parameters
- Kernel sysctl values
- And more (it’s modular!)
It’s like a Swiss Army knife for server tuning.
cpufreq: The CPU Governor Whisperer
cpufreq is all about controlling how your CPU scales its frequency. Modern CPUs can change their clock speed on the fly, trading off performance for power savings. The “governor” decides how aggressive this scaling is. The main ones:
- performance – Always runs at max speed. Great for servers, not so much for laptops.
- powersave – Prioritizes energy savings. Good for battery life, not for benchmarks.
- ondemand – Scales up when needed, down when idle. The default on many distros.
- conservative – Like ondemand, but less aggressive.
- schedutil – Uses the Linux scheduler for smarter scaling (newer kernels).
By picking the right governor, you can make your server snappier or save on your power bill (or both, if you’re clever).
How to Set Up Tuned and cpufreq (The Fast Way)
Let’s get practical. Here’s how you can get both tools working on your server in less time than it takes to order a pizza.
Step 1: Install Tuned and cpufrequtils
- On CentOS / RHEL / Fedora:
sudo dnf install tuned tuned-utils tuned-gtk
sudo systemctl enable --now tuned
- On Ubuntu / Debian:
sudo apt update
sudo apt install tuned cpufrequtils
sudo systemctl enable --now tuned
Step 2: List Available Tuned Profiles
tuned-adm list
You’ll see something like:
Available profiles:
- balanced
- throughput-performance
- latency-performance
- virtual-guest
- powersave
- ... (and more)
Step 3: Pick and Apply a Profile
For most servers, throughput-performance is a great starting point:
sudo tuned-adm profile throughput-performance
For low-latency workloads (like VoIP or gaming servers):
sudo tuned-adm profile latency-performance
For VPS or cloud guests:
sudo tuned-adm profile virtual-guest
Want to go full eco-mode? Try powersave (not recommended for production servers).
Step 4: Check Your CPU Governor
cpufreq-info
Or, for a quick look:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
To set all CPUs to “performance”:
sudo cpufreq-set -r -g performance
Or, let Tuned handle it (recommended — it’ll keep it persistent and profile-based).
Step 5: Automate It (Because Who Likes Manual Work?)
Once you’ve set your profile, Tuned will keep it applied across reboots. If you want to switch profiles based on time of day, workload, or even temperature, you can script tuned-adm profile
calls in your cron jobs or systemd timers. Geeky, but powerful!
Examples, Cases, and a Quick Comparison Table
Scenario | Profile / Governor | Result | Advice |
---|---|---|---|
Web server (Nginx, Apache) | throughput-performance / performance | Faster response times, higher throughput | Best for busy sites, may use more power |
Database server (MySQL, PostgreSQL) | latency-performance / performance | Lower query latency, more consistent | Great for transactional DBs |
VPS in the cloud | virtual-guest / ondemand | Good balance, avoids noisy neighbor issues | Recommended for shared environments |
Development / Test server | balanced / ondemand | Energy savings, reasonable speed | Fine for non-production |
IoT / Home server | powersave / powersave | Lowest power, slowest performance | Only use if you’re really power-conscious |
Positive Example
Case: A SaaS startup switched their production API servers from the default “balanced” profile to “throughput-performance”. Result? 20% lower average response times, and they delayed a costly hardware upgrade by six months. (True story!)
Negative Example
Case: A developer set their home server to “performance” and left it running 24/7. Their electric bill jumped, and the CPU fan never shut up. Lesson: Don’t use “performance” unless you need it, and monitor your temps!
Beginner Mistakes, Myths, and Other Tools
- Mistake: Setting the governor manually, then wondering why it resets after reboot. (Tuned manages it, so let it!)
- Myth: “Performance” governor always makes everything faster. Not true for all workloads — sometimes “ondemand” is just as good, with less heat and noise.
- Myth: You need to reboot after changing profiles. Nope! Tuned applies changes live.
- Alternative tools: TLP (great for laptops), pm-graph (for power debugging), cpupower (more advanced CPU tweaks).
Statistics, Comparisons, and Geeky Facts
- On a typical 8-core server, switching from “ondemand” to “performance” can boost CPU benchmarks by 10-15% (at the cost of about 20-30% more power draw).
- Tuned is included by default in RHEL, CentOS, Fedora, and many cloud images — but often not enabled!
- cpufreq is supported on almost all modern x86 and ARM CPUs, including Raspberry Pi and cloud VMs.
- Some cloud providers (like AWS, GCP) may restrict low-level CPU scaling — but you can still use Tuned for network and I/O tuning.
Non-Standard Usage and Automation Opportunities
- Dynamic switching: Use scripts to change profiles based on time (e.g., “throughput-performance” during business hours, “powersave” at night).
- Docker and containers: While you can’t change the host governor from inside a container, you can run Tuned on the host to optimize for container workloads.
- Monitoring: Combine with Prometheus or Grafana to graph CPU frequency and see the real impact of your changes.
- Self-healing scripts: If your server gets too hot, automatically switch to “powersave” until temps drop. (Great for home labs!)
What New Opportunities Will Open Up?
- Automate performance tuning as part of your CI/CD pipeline. Imagine spinning up a new VPS and having it auto-tuned for your workload in seconds.
- Save on cloud costs by running more efficiently — or delay hardware upgrades by getting more out of what you already have.
- Integrate with Ansible, Chef, or Puppet for fleet-wide optimization.
- Write custom Tuned profiles for weird workloads (e.g., crypto mining, scientific computing, or even retro gaming servers!).
Conclusion: Why, How, and Where to Use Tuned and cpufreq
Server performance isn’t just about buying more CPU cores or RAM — it’s about making the most of what you’ve got. Tuned and cpufreq are simple, powerful tools that let you do just that, whether you’re running on a $5 VPS or a monster dedicated box.
- Why use them? Because every millisecond counts, and every watt saved is money in your pocket.
- How to use them? Install, pick a profile, and let them do the heavy lifting. Tweak as needed for your workload.
- Where to use them? On any Linux server — cloud, VPS, dedicated, or even your Raspberry Pi lab.
So, next time you’re spinning up a new server (maybe from here or here), don’t just accept the defaults. Tune it up, and watch your performance (and your geek cred) soar!
Official resources:
Happy tuning! 🚀

This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.
This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.