{"id":1708,"date":"2026-11-13T23:19:50","date_gmt":"2026-11-13T23:19:50","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=1708"},"modified":"2026-11-13T23:19:50","modified_gmt":"2026-11-13T23:19:50","slug":"tcp-retransmits-noisy-neighbour-vps","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/","title":{"rendered":"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Pathological TCP retransmission rates on a VPS are almost never a kernel-tuning problem. A healthy wired link retransmits well under 0.1% of segments; 2\u20138% on a single instance, while the same destination from a laptop is clean, usually means one of three things: a shared host uplink dropping packets during someone else&#8217;s burst, an MTU\/PMTU black hole on one route, or a socket buffer and queue discipline combination that turns host-side drops into congestion-window collapse. Each has a different fix, and the order matters because the measurement you would reach for first (<code>iperf3<\/code>) hides all three.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What follows separates retransmits by cause using <code>ss -ti<\/code>, <code>nstat<\/code> and a short <code>tcpdump<\/code> sample, then maps each cause to a fix you can apply without a reboot. The same counters also tell you whether the instance itself is misbehaving \u2014 if the numbers are worse than a <a href=\"https:\/\/virtualserversvps.com\/\" target=\"_blank\" rel=\"noopener\">standard KVM VPS baseline network test<\/a> suggests they should be, that is a support ticket rather than a sysctl.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Measure the retransmit rate correctly<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two counters matter and they are not the same: <code>TCPRetransSegs<\/code> (segments retransmitted) and <code>TCPLostRetransmit<\/code> (retransmissions that were themselves lost). A high <code>TCPLostRetransmit<\/code> relative to <code>TCPRetransSegs<\/code> means the path is dropping retransmits too, which points at the uplink rather than at your configuration.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># snapshot counters, wait, snapshot again\nnstat -az &gt; \/tmp\/n1.txt; sleep 300; nstat -az &gt; \/tmp\/n2.txt\ndiff \/tmp\/n1.txt \/tmp\/n2.txt | grep -iE \"retrans|lost|timeout|resets\"\n\n# per-connection view: retransmits, RTT, cwnd, unacked\nss -tin state established | head -40<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Read the per-connection line as follows: <code>retrans:2\/120<\/code> means two segments retransmitted out of 120 in flight at peak; <code>lost:1<\/code> is the ones lost again; <code>cwnd:14<\/code> with <code>ssthresh:7<\/code> means you were recently cut back. A <code>rtt<\/code> of 0.6 ms with <code>rttvar<\/code> jumping to 40 ms is the signature of queue buildup on the host uplink, not of congestion on the public path.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Establish a denominator<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A ratio needs a total. Compute it from <code>nstat<\/code> deltas over a fixed window rather than eyeballing a percentage in a dashboard.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>awk '\n  FNR==NR{ if($2==\"TcpOutSegs\"||$2==\"TcpRetransSegs\") a[$2]=$3; next }\n  $2==\"TcpOutSegs\"{ out=$3 } $2==\"TcpRetransSegs\"{ rt=$3 }\n  END{ printf \"out=%d retrans=%d rate=%.3f%%\\n\", out-a[\"TcpOutSegs\"], rt-a[\"TcpRetransSegs\"], 100*(rt-a[\"TcpRetransSegs\"])\/(out-a[\"TcpOutSegs\"]) }\n' \/tmp\/n1.txt \/tmp\/n2.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Benchmarks to hold yourself to: below 0.05% is clean on a wired path; 0.1\u20130.5% is tolerable for long-haul but worth a look; above 1% is a defect for typical web traffic. Under 5% packet loss, TCP throughput collapses roughly in proportion to <code>1\/sqrt(p)<\/code>, so 2% loss costs you about a third of your achievable bandwidth.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Separate host-side drops from path loss<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Host-side drops never leave the machine, so a packet capture on the public interface will show them as gaps with no corresponding ICMP. Compare the virtio interface counters with what actually went out.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip -s link show dev eth0\n# tx dropped \/ tx errors \/ carrier should be flat\nethtool -S eth0 2&gt;\/dev\/null | grep -iE \"drop|miss|discard|tx_queue\"\n\n# softnet backlog drops: per-CPU, the quiet killer on small VPS\ngrep -E \"^(smp|net)\" \/proc\/net\/softnet_stat | awk '{print \"drops:\"$2\" time_squeeze:\"$3}'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The second column of <code>\/proc\/net\/softnet_stat<\/code> is the per-CPU backlog drop counter. Any nonzero value on a 1\u20132 vCPU instance means the packet-processing path is saturating: the NIC receives frames faster than softirq can drain them. That produces retransmits with zero loss on the wire, and no amount of <code>tcp_*<\/code> tuning fixes it \u2014 the queues need to be smaller or the receiver needs more CPU budget.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Confirm with a targeted capture<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When the counters disagree, one 10-second capture settles it. Filter to a single busy connection so tshark&#8217;s analysis is meaningful.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo timeout 10 tcpdump -i eth0 -s 96 -w \/tmp\/rt.pcap \\\n  'tcp and host 198.51.100.20 and port 443'\ntshark -r \/tmp\/rt.pcap -q -z io,stat,0 \\\n  -z \"io,stat,0,COUNT(tcp.analysis.retransmission)tcp.analysis.retransmission\" \\\n  -z \"io,stat,0,COUNT(tcp.analysis.fast_retransmission)tcp.analysis.fast_retransmission\" \\\n  -z \"io,stat,0,COUNT(tcp.analysis.lost_segment)tcp.analysis.lost_segment\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Fast retransmissions triggered by three duplicate ACKs with the same sequence numbers repeating every few hundred ms indicate a single persistent drop point. Retransmissions spread evenly with wildly varying sequence gaps indicate congestion, and a capture showing retransmits only for packets above 1400 bytes indicates PMTU. Check the last case with <code>ping -M do -s 1472 198.51.100.20<\/code>: silence plus a working smaller size confirms it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fix 1: smaller buffers on a shared uplink<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If queuing delay appears in <code>rttvar<\/code> and softnet drops are climbing, the fix is to stop buffering so much on the way out. A smaller <code>txqueuelen<\/code> plus fq_codel keeps latency bounded; <code>tcp_notsent_lowat<\/code> stops the kernel from holding large unsent windows in memory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sysctl -w net.ipv4.tcp_notsent_lowat=131072\nsudo tc qdisc replace dev eth0 root fq_codel limit 1024\nsudo ip link set eth0 txqueuelen 500\ntc -s qdisc show dev eth0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fix 2: repair PMTU black holes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If only full-size segments are lost and ICMP &#8220;fragmentation needed&#8221; never arrives (common where icmp is filtered), TCP stalls until the retransmit timer fires. Clamp the MSS to the path you can actually reach \u2014 the standard fix behind VXLAN, WireGuard and many provider overlays.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># verify the path MTU first (wireguard\/wg0 usually needs 1420)\nping -M do -s 1420 -c 2 198.51.100.20\nsudo iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN \\\n  -j TCPMSS --clamp-mss-to-pmtu<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fix 3: escalate when the evidence points upstream<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two findings indicate a host problem rather than a guest configuration problem: retransmits that correlate with hours of the day and other tenants&#8217; behaviour, and <code>tx dropped<\/code> on the virtio interface rising while softirq is idle. In that state, your packets are being discarded after the guest&#8217;s queue and there is nothing in a sysctl that can recover them. Collect <code>nstat<\/code> deltas, the <code>ip -s link<\/code> counters and a filtered capture, and hand them over \u2014 with numbers, providers respond far faster than to &#8220;the network is slow&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whatever the outcome, keep the measurement running. A cron job that snapshots <code>nstat -az<\/code> every five minutes and appends the delta to a TSV gives you a week of history, which is the only reliable way to tell a persistent defect from a twenty-minute neighbour burst. And if the pattern turns out to be sustained host contention rather than path loss, moving to a <a href=\"https:\/\/virtualserversvps.com\/\" target=\"_blank\" rel=\"noopener\">VPS with dedicated or guaranteed network resources<\/a> solves it in an afternoon whereas tuning will not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pathological TCP retransmission rates on a VPS are almost never a kernel-tuning problem. A healthy wired link retransmits well under 0.1% of segments; 2\u20138% on a single instance, while 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":1,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1708","post","type-post","status-publish","format-standard","hentry","category-performance-optimization"],"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>TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"Pathological TCP retransmission rates on a VPS are almost never a kernel-tuning problem. A healthy wired link retransmits well under 0.1% of segments;\" \/>\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\/tcp-retransmits-noisy-neighbour-vps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause\" \/>\n<meta property=\"og:description\" content=\"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-13T23:19:50+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\/tcp-retransmits-noisy-neighbour-vps\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/\",\"name\":\"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-11-13T23:19:50+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"Pathological TCP retransmission rates on a VPS are almost never a kernel-tuning problem. A healthy wired link retransmits well under 0.1% of segments;\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause\"}]},{\"@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":"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause - Virtual Servers VPS Blog","description":"Pathological TCP retransmission rates on a VPS are almost never a kernel-tuning problem. A healthy wired link retransmits well under 0.1% of segments;","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\/tcp-retransmits-noisy-neighbour-vps\/","og_locale":"en_US","og_type":"article","og_title":"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause","og_description":"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause","og_url":"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-11-13T23:19:50+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\/tcp-retransmits-noisy-neighbour-vps\/","url":"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/","name":"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-11-13T23:19:50+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"Pathological TCP retransmission rates on a VPS are almost never a kernel-tuning problem. A healthy wired link retransmits well under 0.1% of segments;","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/tcp-retransmits-noisy-neighbour-vps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"TCP Retransmits on a Noisy-Neighbour VPS: Measuring the Rate and Fixing the Cause"}]},{"@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\/1708","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=1708"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1708\/revisions"}],"predecessor-version":[{"id":1711,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1708\/revisions\/1711"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}