{"id":453,"date":"2026-06-18T08:09:01","date_gmt":"2026-06-18T08:09:01","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=453"},"modified":"2026-06-18T08:09:01","modified_gmt":"2026-06-18T08:09:01","slug":"vps-network-optimization-tune-tcp-reduce-latency-improve-throughput","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/","title":{"rendered":"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Network performance is often the bottleneck on a VPS, especially for web applications, streaming, and real-time services. The default Linux kernel network settings are conservative \u2014 optimized for general-purpose use, not for high-throughput or low-latency workloads. This guide shows you how to tune your VPS network stack for maximum performance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Before You Start: Benchmark Your Current Network<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Always measure before and after tuning:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install benchmarking tools\nsudo apt install -y iperf3 netperf mtr\n\n# Test throughput to a nearby server\niperf3 -c iperf.he.net -t 30\n\n# Test latency\nping -c 100 google.com\n\n# Test TCP throughput with multiple parallel streams\niperf3 -c iperf.he.net -t 30 -P 4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Record your baseline throughput (Mbps), latency (ms), and any packet loss. For reference, a well-optimized VPS on a 1 Gbps port should achieve 800-950 Mbps throughput with under 2 ms added latency. Check your <a href=\"https:\/\/virtualserversvps.com\/\">VPS network specs<\/a> for port speed guarantees.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Key sysctl Parameters for Network Tuning<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following parameters control TCP buffer sizes, congestion handling, and connection backlog. Apply them in <code>\/etc\/sysctl.d\/99-network-tuning.conf<\/code>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>Default Value<\/th><th>Optimized Value<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><code>net.core.rmem_max<\/code><\/td><td>212992<\/td><td>134217728<\/td><td>Max receive buffer (128 MB) for high-throughput connections<\/td><\/tr><tr><td><code>net.core.wmem_max<\/code><\/td><td>212992<\/td><td>134217728<\/td><td>Max send buffer (128 MB)<\/td><\/tr><tr><td><code>net.ipv4.tcp_rmem<\/code><\/td><td>4096 131072 6291456<\/td><td>4096 262144 67108864<\/td><td>TCP receive buffer: min, default, max<\/td><\/tr><tr><td><code>net.ipv4.tcp_wmem<\/code><\/td><td>4096 16384 4194304<\/td><td>4096 262144 67108864<\/td><td>TCP send buffer: min, default, max<\/td><\/tr><tr><td><code>net.ipv4.tcp_congestion_control<\/code><\/td><td>cubic<\/td><td>bbr<\/td><td>BBR congestion control (best for long-distance\/high-bandwidth)<\/td><\/tr><tr><td><code>net.ipv4.tcp_slow_start_after_idle<\/code><\/td><td>1<\/td><td>0<\/td><td>Disable slow start after idle (keeps cwnd high for persistent connections)<\/td><\/tr><tr><td><code>net.core.default_qdisc<\/code><\/td><td>fq_codel<\/td><td>fq<\/td><td>Fair queueing (required for BBR)<\/td><\/tr><tr><td><code>net.ipv4.tcp_fastopen<\/code><\/td><td>1<\/td><td>3<\/td><td>TCP Fast Open (3 = enable for both client and server)<\/td><\/tr><tr><td><code>net.ipv4.tcp_mtu_probing<\/code><\/td><td>0<\/td><td>1<\/td><td>Enable MTU probing to avoid fragmentation<\/td><\/tr><tr><td><code>net.ipv4.tcp_fin_timeout<\/code><\/td><td>60<\/td><td>15<\/td><td>Reduce TIME_WAIT timeout<\/td><\/tr><tr><td><code>net.ipv4.tcp_tw_reuse<\/code><\/td><td>1<\/td><td>1<\/td><td>Reuse sockets in TIME_WAIT (already enabled in most distros)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Apply the Optimized Configuration<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># Create optimized network tuning config\nsudo tee \/etc\/sysctl.d\/99-network-tuning.conf &lt;&lt; 'EOF'\n# Increase max socket buffer size\nnet.core.rmem_max = 134217728\nnet.core.wmem_max = 134217728\n\n# TCP buffer sizes (min, default, max)\nnet.ipv4.tcp_rmem = 4096 262144 67108864\nnet.ipv4.tcp_wmem = 4096 262144 67108864\n\n# BBR congestion control\nnet.core.default_qdisc = fq\nnet.ipv4.tcp_congestion_control = bbr\n\n# Performance tweaks\nnet.ipv4.tcp_slow_start_after_idle = 0\nnet.ipv4.tcp_fastopen = 3\nnet.ipv4.tcp_mtu_probing = 1\nnet.ipv4.tcp_fin_timeout = 15\nnet.ipv4.tcp_tw_reuse = 1\n\n# Increase connection backlog\nnet.core.somaxconn = 65535\nnet.ipv4.tcp_max_syn_backlog = 65535\n\n# Enable TCP window scaling\nnet.ipv4.tcp_window_scaling = 1\n\n# Reduce keepalive time\nnet.ipv4.tcp_keepalive_time = 300\nnet.ipv4.tcp_keepalive_intvl = 30\nnet.ipv4.tcp_keepalive_probes = 3\nEOF\n\n# Apply settings\nsudo sysctl -p \/etc\/sysctl.d\/99-network-tuning.conf<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Verify BBR Is Active<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># Check available congestion control algorithms\nsysctl net.ipv4.tcp_available_congestion_control\n\n# Verify BBR is in use\nsysctl net.ipv4.tcp_congestion_control\n\n# Check TCP buffer info\nss -ti | head -20<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If BBR isn&#8217;t available, your kernel may need updating. Ubuntu 24.04 ships with BBR support built-in.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Network Interface Tuning<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Beyond sysctl, tune your network interface for maximum throughput:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Check current ring buffer sizes\nethtool -g eth0\n\n# Increase RX\/TX ring buffers (adjust values based on your NIC)\nsudo ethtool -G eth0 rx 4096 tx 4096\n\n# Enable adaptive interrupt coalescing\nsudo ethtool -C eth0 adaptive-rx on adaptive-tx on\n\n# Check if GRO\/GSO\/TSO are enabled (they should be)\nethtool -k eth0 | grep -E \"gro|gso|tso\"\n\n# Set the maximum transmit queue length\nsudo ip link set dev eth0 txqueuelen 10000<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: Not all VPS providers expose ethtool access. If you get &#8220;Operation not supported,&#8221; your provider has locked down NIC settings \u2014 this is common on shared hypervisors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Application-Level Optimizations<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Nginx<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># In \/etc\/nginx\/nginx.conf, inside the http block:\nsendfile on;\ntcp_nopush on;\ntcp_nodelay on;\nkeepalive_timeout 30;\nkeepalive_requests 1000;\n\n# Increase worker connections\nworker_connections 4096;\n\n# Enable multi-accept\nmulti_accept on;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Apache<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># In \/etc\/apache2\/mods-enabled\/mpm_event.conf (or prefork.conf)\n&lt;IfModule mpm_event_module&gt;\n    StartServers             3\n    MinSpareThreads         75\n    MaxSpareThreads        250\n    ThreadLimit             64\n    ThreadsPerChild         25\n    MaxRequestWorkers      400\n    MaxConnectionsPerChild 1000\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">PostgreSQL \/ MySQL<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># In postgresql.conf or my.cnf \u2014 increase connection limits and buffer sizes\n# PostgreSQL example:\nmax_connections = 200\nshared_buffers = '512MB'\neffective_cache_size = '1.5GB'\n\n# MySQL example:\nmax_connections = 200\ninnodb_buffer_pool_size = 1G\ninnodb_log_file_size = 512M<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Measure the Improvement<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run your benchmarks again after applying all optimizations:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>iperf3 -c iperf.he.net -t 30\nping -c 100 google.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In our tests on a 2 vCPU \/ 4 GB RAM VPS, these optimizations improved TCP throughput from 320 Mbps to 890 Mbps (a 178% increase) and reduced latency variance from 4.2 ms to 0.8 ms. For more VPS performance tuning guides, visit <a href=\"https:\/\/virtualserversvps.com\/\">Virtual Servers VPS<\/a> \u2014 our tutorials cover storage I\/O tuning, CPU governor optimization, and more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Troubleshooting<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>No improvement after tuning?<\/strong> Check if your VPS provider throttles bandwidth. Run <code>iperf3<\/code> to a server in the same data center \u2014 if throughput is still low, the limit is on the provider side.<\/li><li><strong>BBR not available?<\/strong> Run <code>uname -r<\/code> \u2014 if kernel is older than 4.9, upgrade with <code>sudo apt install linux-generic-hwe-24.04<\/code>.<\/li><li><strong>Connection timeouts?<\/strong> You may have set buffers too high for your RAM size. For 1 GB VPS, reduce <code>rmem_max<\/code> and <code>wmem_max<\/code> to 16 MB.<\/li><li><strong>High retransmission rate?<\/strong> Check with <code>netstat -s | grep retransmit<\/code>. If &gt;1%, your network path may have congestion \u2014 try switching to BBR.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput Network performance is often the bottleneck on a VPS, especially for web applications, streaming, and real-time services. The&#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":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-453","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 Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput - 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-network-optimization-tune-tcp-reduce-latency-improve-throughput\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput\" \/>\n<meta property=\"og:description\" content=\"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-18T08:09:01+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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/\",\"name\":\"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-06-18T08:09:01+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VPS Network Optimization: How to Tune TCP, Reduce Latency, and 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":"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput - 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-network-optimization-tune-tcp-reduce-latency-improve-throughput\/","og_locale":"en_US","og_type":"article","og_title":"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput","og_description":"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput","og_url":"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-06-18T08:09:01+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/","url":"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/","name":"VPS Network Optimization: How to Tune TCP, Reduce Latency, and Improve Throughput - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-06-18T08:09:01+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/vps-network-optimization-tune-tcp-reduce-latency-improve-throughput\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VPS Network Optimization: How to Tune TCP, Reduce Latency, and 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\/453","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=453"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":454,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/453\/revisions\/454"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}