{"id":556,"date":"2026-07-24T19:01:18","date_gmt":"2026-07-24T19:01:18","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=556"},"modified":"2026-08-01T22:11:58","modified_gmt":"2026-08-01T22:11:58","slug":"vps-performance-tuning-cpu-governor-io-scheduler-kernel","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/","title":{"rendered":"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Your VPS boots with conservative defaults: an <code>ondemand<\/code> CPU governor that ramps clock speed lazily, and a generic I\/O scheduler that reorders disk requests even when your storage is a low-latency NVMe device. On a shared hypervisor, those two settings alone can add tens of milliseconds of latency at the worst possible moments \u2014 right when a traffic spike hits. The good news: both are tunable in minutes, and the gains are measurable with the same benchmark tools you already use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Capture a Baseline Before You Touch Anything<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tuning without a baseline is guesswork. Record your current governor, scheduler, and a quick performance score first:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Current CPU governor per core\ncat \/sys\/devices\/system\/cpu\/cpu*\/cpufreq\/scaling_governor\n\n# Active I\/O scheduler (the one in brackets)\ncat \/sys\/block\/sda\/queue\/scheduler\n\n# Storage type: 0 = SSD\/NVMe, 1 = spinning disk\nlsblk -d -o name,rota,size,model\n\n# CPU score baseline (30 seconds, 4 threads)\nsysbench cpu --threads=4 --time=30 --cpu-max-prime=20000 run<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Write down the <code>events per second<\/code> figure from sysbench. After you change the governor, rerun the identical command \u2014 the delta is your proof of improvement, not a vendor&#8217;s marketing page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why the Performance Governor Beats ondemand on a VPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ondemand<\/code> and <code>powersave<\/code> governors let the CPU drop to lower frequencies when idle, which saves power on laptops. On a rack-mounted server in a data center, that power saving is meaningless, but the ramp-up latency is real: when a request arrives, the kernel must raise the frequency before the CPU can execute at full speed, adding jitter to every burst of traffic. Setting the governor to <code>performance<\/code> pins the CPU at its maximum frequency so response times stay flat under load.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install cpufrequtils -y\necho 'GOVERNOR=\"performance\"' | sudo tee \/etc\/default\/cpufrequtils\nsudo systemctl disable ondemand\nsudo cpufreq-set -g performance\n\n# Verify: every core should report \"performance\"\ncat \/sys\/devices\/system\/cpu\/cpu*\/cpufreq\/scaling_governor<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">One caveat: some cloud providers don&#8217;t expose the cpufreq driver inside the guest at all (the <code>scaling_governor<\/code> file won&#8217;t exist). In that case the hypervisor governs frequency, and your lever is elsewhere \u2014 CPU-steal monitoring and scheduler choice, covered below. Also check <code>cpupower frequency-info<\/code> to confirm the driver is active.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pick the I\/O Scheduler That Matches Your Storage<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The I\/O scheduler decides how the kernel queues read and write requests. On a spinning disk, sorting requests minimizes head movement, which is why old schedulers like <code>cfq<\/code> existed. On SSD and NVMe-backed VPS storage there is no mechanical seek cost \u2014 a scheduler is pure CPU overhead that adds latency instead of removing it.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Scheduler<\/th><th>Best for<\/th><th>Trade-off<\/th><\/tr><\/thead><tbody><tr><td><code>none<\/code> (multiqueue)<\/td><td>NVMe \/ SSD \/ cloud block storage<\/td><td>Lowest latency, no fairness guarantees<\/td><\/tr><tr><td><code>mq-deadline<\/code><\/td><td>Mixed SSD workloads with read\/write mixing<\/td><td>Enforces per-request deadlines, slight overhead<\/td><\/tr><tr><td><code>kyber<\/code><\/td><td>Latency-sensitive apps on fast storage<\/td><td>Tunes itself to observed latencies<\/td><\/tr><tr><td><code>bfq<\/code><\/td><td>Spinning disks, shared\/VPS with noisy neighbors<\/td><td>Fairness first; highest CPU cost<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Most modern VPS storage behaves like an SSD, so start with <code>none<\/code> and benchmark. If your <code>lsblk<\/code> output shows <code>rota=1<\/code>, use <code>bfq<\/code> instead. Apply the change and make it permanent with a udev rule:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Apply immediately\necho 'none' | sudo tee \/sys\/block\/sda\/queue\/scheduler\n\n# Persist across reboots\necho 'ACTION==\"add|change\", KERNEL==\"sd*\", ATTR{queue\/scheduler}=\"none\"' \\\n  | sudo tee \/etc\/udev\/rules.d\/60-iosched.rules\n\n# Raise the queue depth for NVMe devices\necho 256 | sudo tee \/sys\/block\/nvme0n1\/queue\/nr_requests<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify with <code>cat \/sys\/block\/sda\/queue\/scheduler<\/code> \u2014 the active scheduler is shown in square brackets.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Measure the Real-World Difference with fio<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t trust feelings; run a 4 KiB random-read test before and after switching schedulers. This is the access pattern that dominates database and web workloads:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install fio -y\nfio --name=randread --ioengine=libaio --iodepth=32 --rw=randread \\\n    --bs=4k --size=512M --numjobs=4 --runtime=30 \\\n    --group_reporting --direct=1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Watch two numbers: <code>IOPS<\/code> and <code>latency (usec)<\/code> (p99 in particular). On a typical cloud SSD you should see thousands of IOPS at sub-millisecond p99 latency. If p99 latency is above 2\u20135 ms on an SSD-backed plan, either the scheduler is adding overhead or the host is throttling \u2014 the latter is worth verifying with <code>iostat -x 2<\/code> to check <code>%util<\/code> and <code>await<\/code> during the run.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When Tuning Hits the Ceiling: What to Check Next<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Governor and scheduler tuning helps, but if <code>%steal<\/code> in <code>top<\/code> is consistently above 5\u201310%, the problem is neighbor contention on the host \u2014 no guest-side setting fixes that. That&#8217;s the moment to look at the CPU-to-RAM ratio and storage tier of the plan you&#8217;re actually paying for. Rather than upgrading blindly, <a href=\"https:\/\/virtualserversvps.com\/#providers\" target=\"_blank\" rel=\"noreferrer noopener\">compare VPS providers on our comparison table<\/a> to see which ones publish real CPU model and storage type specs instead of vague &#8220;vCPU&#8221; claims.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need guaranteed, dedicated CPU resources on a budget, InterServer&#8217;s VPS lineup offers dedicated-core options at prices close to shared plans \u2014 <a href=\"https:\/\/interserver.net\/vps?id=1067805&amp;sid=virtualserversvps\" target=\"_blank\" rel=\"noreferrer noopener sponsored\">check current InterServer VPS pricing<\/a> before you commit to a more expensive tier elsewhere. For teams that would rather skip kernel-level tuning entirely, a managed platform like Cloudways applies the same performance defaults for you \u2014 <a href=\"https:\/\/cloudways.com\/en\/?id=2010927&amp;data1=virtualserversvps\" target=\"_blank\" rel=\"noreferrer noopener sponsored\">see Cloudways managed VPS plans<\/a> if automation beats DIY.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Putting It All Together<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Set the CPU governor to <code>performance<\/code> via <code>\/etc\/default\/cpufrequtils<\/code> and disable the <code>ondemand<\/code> service.<\/li><li>Match the I\/O scheduler to your storage: <code>none<\/code> for SSD\/NVMe, <code>bfq<\/code> for spinning disks, and persist it with a udev rule.<\/li><li>Benchmark before and after with <code>sysbench cpu<\/code> and <code>fio<\/code>; keep the results in a file for future reference.<\/li><li>If <code>%steal<\/code> stays high after tuning, the bottleneck is the host \u2014 time to <a href=\"https:\/\/virtualserversvps.com\/#providers\" target=\"_blank\" rel=\"noreferrer noopener\">see the full specs and pricing across providers<\/a> and move to a less contended plan.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These two settings take ten minutes to apply and are the cheapest latency reduction available on any unmanaged VPS. Do the baseline first, apply the changes, and let the benchmark numbers decide whether your current plan \u2014 or your current provider \u2014 is the real bottleneck.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Your VPS boots with conservative defaults: an ondemand CPU governor that ramps clock speed lazily, and a generic I\/O scheduler that reorders disk requests even when your storage is a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-vps-guides-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes - Virtual Servers VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes\" \/>\n<meta property=\"og:description\" content=\"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-24T19:01:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-01T22:11:58+00:00\" \/>\n<meta name=\"author\" content=\"Virtual-Servers-Vps-Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virtual-Servers-Vps-Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/\",\"name\":\"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-07-24T19:01:18+00:00\",\"dateModified\":\"2026-08-01T22:11:58+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/\",\"name\":\"Virtual Servers VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\",\"name\":\"Virtual-Servers-Vps-Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"caption\":\"Virtual-Servers-Vps-Editor\"},\"sameAs\":[\"https:\/\/virtualserversvps.com\/blog\"],\"url\":\"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes - Virtual Servers VPS Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/","og_locale":"en_US","og_type":"article","og_title":"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes","og_description":"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes","og_url":"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-07-24T19:01:18+00:00","article_modified_time":"2026-08-01T22:11:58+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/","url":"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/","name":"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-07-24T19:01:18+00:00","dateModified":"2026-08-01T22:11:58+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/vps-performance-tuning-cpu-governor-io-scheduler-kernel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VPS CPU Governor and I\/O Scheduler Tuning That Cuts Latency Spikes"}]},{"@type":"WebSite","@id":"https:\/\/virtualserversvps.com\/blog\/#website","url":"https:\/\/virtualserversvps.com\/blog\/","name":"Virtual Servers VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0","name":"Virtual-Servers-Vps-Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","caption":"Virtual-Servers-Vps-Editor"},"sameAs":["https:\/\/virtualserversvps.com\/blog"],"url":"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/"}]}},"_links":{"self":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":3,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":767,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/556\/revisions\/767"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}