{"id":1316,"date":"2026-10-06T22:36:03","date_gmt":"2026-10-06T22:36:03","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=1316"},"modified":"2026-10-06T22:36:03","modified_gmt":"2026-10-06T22:36:03","slug":"linux-kernel-entropy-high-connection-tuning","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/","title":{"rendered":"Tuning Linux Kernel Entropy for High-Connection Servers"},"content":{"rendered":"\n\n<p class=\"wp-block-paragraph\">On a busy connection-handling server, the kernel&#8217;s random number generator is a shared resource that most operators never think about \u2014 until TLS handshakes stall or a service blocks reading <code>\/dev\/random<\/code>. High-connection workloads consume entropy faster than casual servers do: every <code>getrandom()<\/code> call for a session key, nonce, or TCP initial sequence number taps the pool. This guide explains how the modern Linux RNG works, how to measure it, and how to make sure high-connection instances never block on randomness.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Changed in Modern Kernels<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For years, <code>\/dev\/random<\/code> blocked once the estimated entropy count was exhausted. Since Linux 5.6, the ChaCha20-based CRNG is seeded early and <code>\/dev\/random<\/code> no longer blocks after the pool is initialised \u2014 it behaves like <code>\/dev\/urandom<\/code> once the CRNG is ready. The practical consequence: the only window where randomness can be scarce is <em>early boot<\/em>, before the CRNG is initialised, which matters a lot for VMs that curl secrets or generate keys at startup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reading the Entropy State<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/proc\/sys\/kernel\/random\/entropy_avail\ncat \/proc\/sys\/kernel\/random\/poolsize\ncat \/proc\/sys\/kernel\/random\/urandom_min_reseed_secs\ndmesg | grep -i crng      # \"crng init done\" marks readiness<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>entropy_avail<\/code> below ~128 and no <code>crng init done<\/code> line in the log means the pool is not yet ready. On a physical server this is a boot-time blip; on a freshly cloned VM with no hardware RNG and a fixed disk image, the same state can persist for seconds and stall anything that needs a key. Watch for services logging &#8220;waiting for random&#8221; during startup, and correlate any first-minute latency spike with this window.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Right Fix: Hardware and Paravirtual RNG<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The clean solution is a real entropy source, not a userspace shuffler. Modern CPUs expose <code>RDSEED<\/code>\/<code>RDRAND<\/code>, and virtualized hosts expose <code>virtio-rng<\/code> or the analogous hypervisor RNG device. Verify what the guest sees:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -m1 rng \/proc\/crypto\nls \/sys\/devices\/virtual\/misc\/ | grep -i hwrng\ncat \/sys\/devices\/virtual\/misc\/hw_random\/rng_available 2&gt;\/dev\/null\ndmesg | grep -Ei 'virtio_rng|hwrng|rng_core'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If no hardware RNG is present, ask the provider to attach a virtual RNG device \u2014 it is a one-line hypervisor setting and eliminates the boot-time stall entirely. Relying on <code>haveged<\/code> or <code>rng-tools<\/code> to top up the pool is a workaround for environments that cannot expose a real source; it works, but a paravirtual RNG is strictly better because it feeds the kernel&#8217;s own CRNG rather than a userspace estimate of entropy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sizing for High-Connection Workloads<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once the CRNG is seeded, throughput is not the bottleneck \u2014 a single core can generate hundreds of megabytes of output per second, far beyond any TLS workload. The failure mode is never &#8220;ran out of entropy during steady state&#8221;; it is &#8220;booted without a seed and blocked once.&#8221; Two habits prevent it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Persist the seed across reboots.<\/strong> <code>systemd-random-seed<\/code> saves the CRNG state to disk on shutdown and restores it early on boot, so a well-behaved VM starts with a primed pool. Ensure the save happens on every clean shutdown.<\/li>\n<li><strong>Seed early, not lazily.<\/strong> Services that generate keys at first start should wait for CRNG readiness, not run before it. Mark such units to start after <code>systemd-random-seed.service<\/code>.<\/li>\n<li><strong>Avoid cloned-image duplication.<\/strong> Two VMs cloned from the same snapshot can inherit identical seed state; make sure each restores a distinct seed rather than sharing one image&#8217;s entropy.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Verifying Under Load<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Test the real path your workload uses. A quick loop that pulls random bytes at connection rate confirms nothing blocks, and a bulk read confirms sustained throughput is far above any realistic TLS demand:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for i in $(seq 1 10000); do head -c 32 \/dev\/urandom &gt; \/dev\/null; done\ntime dd if=\/dev\/urandom of=\/dev\/null bs=1M count=256<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If a TLS termination tier occasionally shows handshake latency spikes that correlate with instance startup, suspect CRNG readiness on freshly booted nodes rather than entropy exhaustion in steady state. That correlation is the giveaway: spikes clustered at instance launch point to boot-time seeding, not to sustained load. On ephemeral or rapidly scaled fleets this is especially likely, and it is another reason to prefer hosts that expose a virtual RNG and give each instance a persistent seed. When you evaluate providers, check whether the platform documents its RNG device and per-instance resource guarantees \u2014 details like these are listed on the <a href=\"https:\/\/www.virtualserversvps.com\/\">plan specifications page<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary Checklist<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Treat entropy as a boot-time concern first and a steady-state concern second. On modern kernels the CRNG will not starve under normal connection load, but a VM with no hardware RNG and a duplicated seed can block exactly when it matters \u2014 during startup, when keys and session secrets are first generated. A virtual RNG device plus a persistent, per-instance seed removes that risk permanently. Because this failure mode is intermittent and correlated with instance launch, it is easy to misattribute to the network; the checklist below keeps the diagnosis grounded.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Confirm <code>crng init done<\/code> appears early in <code>dmesg<\/code>.<\/li>\n<li>Expose <code>virtio-rng<\/code> or CPU RDRAND to the guest where possible.<\/li>\n<li>Let <code>systemd-random-seed<\/code> persist and restore the CRNG state.<\/li>\n<li>Order key-generating services after the random-seed unit.<\/li>\n<li>Benchmark <code>\/dev\/urandom<\/code> and a realistic handshake loop before and after changes \u2014 measure, do not assume.<\/li>\n<li>Alert on handshake latency spikes that correlate with instance startup.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For the broader tuning picture that surrounds this \u2014 CPU, memory, and network knobs that shape high-connection performance \u2014 start from the <a href=\"https:\/\/www.virtualserversvps.com\/\">main hosting overview<\/a>.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Why modern Linux CRNG rarely blocks in steady state, the boot-time stall that actually bites VMs, and how virtio-rng plus a persistent seed fixes it.<\/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-1316","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>Tuning Linux Kernel Entropy for High-Connection Servers - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"Why modern Linux CRNG rarely blocks in steady state, the boot-time stall that actually bites VMs, and how virtio-rng plus a persistent seed fixes it.\" \/>\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\/linux-kernel-entropy-high-connection-tuning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tuning Linux Kernel Entropy for High-Connection Servers\" \/>\n<meta property=\"og:description\" content=\"Tuning Linux Kernel Entropy for High-Connection Servers\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-06T22:36:03+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\/linux-kernel-entropy-high-connection-tuning\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/\",\"name\":\"Tuning Linux Kernel Entropy for High-Connection Servers - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-10-06T22:36:03+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"Why modern Linux CRNG rarely blocks in steady state, the boot-time stall that actually bites VMs, and how virtio-rng plus a persistent seed fixes it.\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tuning Linux Kernel Entropy for High-Connection Servers\"}]},{\"@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":"Tuning Linux Kernel Entropy for High-Connection Servers - Virtual Servers VPS Blog","description":"Why modern Linux CRNG rarely blocks in steady state, the boot-time stall that actually bites VMs, and how virtio-rng plus a persistent seed fixes it.","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\/linux-kernel-entropy-high-connection-tuning\/","og_locale":"en_US","og_type":"article","og_title":"Tuning Linux Kernel Entropy for High-Connection Servers","og_description":"Tuning Linux Kernel Entropy for High-Connection Servers","og_url":"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-10-06T22:36:03+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\/linux-kernel-entropy-high-connection-tuning\/","url":"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/","name":"Tuning Linux Kernel Entropy for High-Connection Servers - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-10-06T22:36:03+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"Why modern Linux CRNG rarely blocks in steady state, the boot-time stall that actually bites VMs, and how virtio-rng plus a persistent seed fixes it.","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/linux-kernel-entropy-high-connection-tuning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tuning Linux Kernel Entropy for High-Connection Servers"}]},{"@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\/1316","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=1316"}],"version-history":[{"count":3,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1316\/revisions"}],"predecessor-version":[{"id":1325,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1316\/revisions\/1325"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}