{"id":221,"date":"2026-01-01T02:00:03","date_gmt":"2026-01-01T02:00:03","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=221"},"modified":"2026-11-02T22:04:55","modified_gmt":"2026-11-02T22:04:55","slug":"linux-vps-sysctl-tuning-throughput-parameters","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/","title":{"rendered":"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput"},"content":{"rendered":"<div style=\"padding:20px\">\n<p>Default sysctl values on a Linux VPS are tuned for a general-purpose machine that does not exist. Distros ship conservative network buffers, small connection backlogs, and modest file descriptor ceilings so that a fresh install behaves predictably across every possible environment. That is a reasonable default, but it means a busy web stack or a database on a modest instance will begin queueing and dropping long before the CPU is saturated. The parameters below are the ones that produce measurable changes, in the order worth applying, with the reasoning behind each so you can size them for your own workload rather than pasting a forum tuning script. Every value here should be justified by an observation; if you cannot name the counter that improves, skip the change. For broader context on how these limits interact with plan choice, the <a href=\"https:\/\/virtualserversvps.com\/\">VPS architecture overview on this site<\/a> is a useful starting point.<\/p>\n<h2>Baseline first, and keep a rollback path<\/h2>\n<p>Before changing anything, capture current behaviour and the running configuration. A sysctl change that helps throughput can quietly hurt tail latency, and without a before-picture you cannot tell.<\/p>\n<pre><code>sysctl -a > \/tmp\/sysctl.before\ncp \/etc\/sysctl.conf \/etc\/sysctl.conf.bak\nss -s; nstat -az > \/tmp\/nstat.before<\/code><\/pre>\n<p>Load-test the workload with a realistic concurrency profile, note the p50 and p99 latency and the retransmission counters, then change one parameter group at a time. Grouping changes by subsystem &mdash; network, file descriptors, memory &mdash; keeps the attribution clean.<\/p>\n<h2>Connection backlog and accept queue depth<\/h2>\n<p>When a burst of new connections arrives faster than the application accepts them, the kernel queues them in the socket&#8217;s backlog. If that queue fills, further SYNs are dropped and clients retry after a timeout, which shows up as multi-second connection spikes that look nothing like server overload.<\/p>\n<pre><code>net.core.somaxconn = 4096\nnet.ipv4.tcp_max_syn_backlog = 8192\nnet.core.netdev_max_backlog = 4096<\/code><\/pre>\n<p><code>somaxconn<\/code> caps the listen backlog; the application&#8217;s own <code>listen()<\/code> argument must match it or the smaller value wins. Raising it without raising the application value accomplishes nothing, which is why so many &#8220;tuned&#8221; servers still drop connections. Watch <code>ListenOverflows<\/code> and <code>ListenDrops<\/code> in <code>nstat<\/code>; both should stay at zero during your normal peak.<\/p>\n<h2>File descriptors before socket buffers<\/h2>\n<p>Long before kernel network buffers become the constraint, a single-process server hits its open-file limit. Every accepted socket, every log file, and every open cache handle consumes one descriptor, and the ceiling is inherited from the systemd unit rather than from <code>\/etc\/security\/limits.conf<\/code> on modern distributions.<\/p>\n<pre><code>systemctl show nginx -p LimitNOFILE\ncat \/proc\/$(pgrep -o nginx)\/limits | grep \"open files\"<\/code><\/pre>\n<p>Set the unit&#8217;s <code>LimitNOFILE<\/code> to a value your workload genuinely needs, then confirm the running process reports it. Raising the limit far beyond the workload only increases the worst-case memory if a connection flood ever occurs.<\/p>\n<h2>Socket buffer sizing for high-latency links<\/h2>\n<p>The receive window a TCP connection can advertise is bounded by the socket buffer. On a link with meaningful round-trip time, an undersized buffer caps throughput regardless of available bandwidth: the bandwidth-delay product for a 150 ms path at 100 Mbps is roughly 1.9 MB in flight.<\/p>\n<pre><code>net.core.rmem_max = 16777216\nnet.core.wmem_max = 16777216\nnet.ipv4.tcp_rmem = 4096 262144 16777216\nnet.ipv4.tcp_wmem = 4096 262144 16777216<\/code><\/pre>\n<p>The three values are minimum, default, and maximum. Leave the defaults modest; only the maximum needs to be generous. Oversized defaults let a single idle connection pin megabytes of kernel memory, which on a 2 GB instance is a real cost.<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Symptom it addresses<\/th>\n<th>Counter to watch<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>somaxconn<\/code><\/td>\n<td>Connection timeouts during bursts<\/td>\n<td><code>ListenOverflows<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>tcp_rmem<\/code> max<\/td>\n<td>Throughput capped on long RTT<\/td>\n<td>Measured BDP vs window<\/td>\n<\/tr>\n<tr>\n<td><code>tcp_tw_reuse<\/code><\/td>\n<td>Ephemeral port exhaustion<\/td>\n<td><code>TCPAbortOnMemory<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>netdev_max_backlog<\/code><\/td>\n<td>Packet drops under bursts<\/td>\n<td><code>softnet_stat<\/code> drops<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Connection churn and TIME_WAIT accumulation<\/h2>\n<p>A proxy or crawler-heavy workload creates thousands of short-lived outbound connections. Each one that closes from your side leaves a TIME_WAIT entry for twice the maximum segment lifetime, and on a single IP the ephemeral port range can be exhausted within minutes.<\/p>\n<pre><code>net.ipv4.ip_local_port_range = 10240 65535\nnet.ipv4.tcp_tw_reuse = 1\nnet.ipv4.tcp_fin_timeout = 15<\/code><\/pre>\n<p><code>tcp_tw_reuse<\/code> is safe on outbound connections for Linux clients; it lets the kernel recycle a TIME_WAIT socket for a new connection when the timestamp guarantees no confusion. Avoid the old <code>tcp_tw_recycle<\/code>, which was removed for good reason and breaks clients behind NAT.<\/p>\n<h2>Backlog and accept-queue hygiene in the proxy<\/h2>\n<p>Kernel tuning only buys time. If your reverse proxy runs with a worker connection limit of 1,024 and you are pushing 5,000 concurrent sockets, the kernel will happily accept them and the proxy will refuse to read them, producing the same timeout symptoms as a kernel-level drop.<\/p>\n<p>Align three numbers before touching anything else: worker connections, the listen backlog in the server configuration, and the kernel&#8217;s <code>somaxconn<\/code>. When all three agree, connection spikes stop being an availability problem and become a capacity planning question.<\/p>\n<h2>Validate, then decide what to keep<\/h2>\n<p>Re-run the same load test after each change and compare p99 latency and retransmission rates, not just throughput. A tuning change that lifts requests per second by 8% but doubles tail latency is usually a bad trade for interactive workloads. Keep a short note in the repository describing each parameter, the measurement that motivated it, and the date it was reviewed. Six months later, when the application has changed, that note is the only thing that will tell you whether a value is still justified.<\/p>\n<p>Finally, remember that sysctl tuning operates at the margins. It cannot compensate for a host with high steal time, a saturated disk, or a server placed far from its users. Treat it as the last 10% of performance work, applied after the architecture is right &mdash; and verify it with data every time. For further measurement-first kernel and networking walkthroughs, browse the <a href=\"https:\/\/virtualserversvps.com\/\">tuning and benchmarking articles on virtualserversvps.com<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re considering hosting options, a Linux VPS Virtual Private Server might be the perfect solution for your needs. With its blend of flexibility, control, and cost-effectiveness, a Linux VPS can cater to a variety of applications, from hosting websites to running complex applications. For a great selection of Linux VPS options, check out\u00a0Virtual Servers VPS.<\/p>\n","protected":false},"author":1,"featured_media":222,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":13,"footnotes":""},"categories":[3,1],"tags":[],"class_list":["post-221","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-performance-optimization","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>Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"If you&#039;re considering hosting options, a Linux VPS Virtual Private Server might be the perfect solution for your needs. With its blend of flexibility, control, and cost-effectiveness, a Linux VPS can cater to a variety of applications, from hosting websites to running complex applications. For a great selection of Linux VPS options, check out\u00a0Virtual Servers VPS.\" \/>\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-vps-sysctl-tuning-throughput-parameters\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput\" \/>\n<meta property=\"og:description\" content=\"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-01T02:00:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-02T22:04:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"426\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/\",\"name\":\"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg\",\"datePublished\":\"2026-01-01T02:00:03+00:00\",\"dateModified\":\"2026-11-02T22:04:55+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"If you're considering hosting options, a Linux VPS Virtual Private Server might be the perfect solution for your needs. With its blend of flexibility, control, and cost-effectiveness, a Linux VPS can cater to a variety of applications, from hosting websites to running complex applications. For a great selection of Linux VPS options, check out\u00a0Virtual Servers VPS.\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#primaryimage\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg\",\"contentUrl\":\"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg\",\"width\":640,\"height\":426},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput\"}]},{\"@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":"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput - Virtual Servers VPS Blog","description":"If you're considering hosting options, a Linux VPS Virtual Private Server might be the perfect solution for your needs. With its blend of flexibility, control, and cost-effectiveness, a Linux VPS can cater to a variety of applications, from hosting websites to running complex applications. For a great selection of Linux VPS options, check out\u00a0Virtual Servers VPS.","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-vps-sysctl-tuning-throughput-parameters\/","og_locale":"en_US","og_type":"article","og_title":"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput","og_description":"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput","og_url":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-01-01T02:00:03+00:00","article_modified_time":"2026-11-02T22:04:55+00:00","og_image":[{"width":640,"height":426,"url":"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg","type":"image\/jpeg"}],"author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/","url":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/","name":"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#primaryimage"},"image":{"@id":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#primaryimage"},"thumbnailUrl":"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg","datePublished":"2026-01-01T02:00:03+00:00","dateModified":"2026-11-02T22:04:55+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"If you're considering hosting options, a Linux VPS Virtual Private Server might be the perfect solution for your needs. With its blend of flexibility, control, and cost-effectiveness, a Linux VPS can cater to a variety of applications, from hosting websites to running complex applications. For a great selection of Linux VPS options, check out\u00a0Virtual Servers VPS.","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#primaryimage","url":"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg","contentUrl":"https:\/\/virtualserversvps.com\/blog\/wp-content\/uploads\/2025\/12\/pexels-brett-sayles-2425567-1.jpg","width":640,"height":426},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/linux-vps-sysctl-tuning-throughput-parameters\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Linux VPS Kernel Tuning: sysctl Parameters That Actually Improve Throughput"}]},{"@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\/221","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=221"}],"version-history":[{"count":5,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"predecessor-version":[{"id":1581,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/221\/revisions\/1581"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media\/222"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}