{"id":948,"date":"2026-08-22T23:16:04","date_gmt":"2026-08-22T23:16:04","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=948"},"modified":"2026-08-22T23:16:04","modified_gmt":"2026-08-22T23:16:04","slug":"tcp-fast-open-vps-latency","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/","title":{"rendered":"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Latency is measured in round trips. Every new TCP connection to your VPS costs one full round trip (SYN, SYN-ACK, ACK) before a single byte of application data moves \u2014 and TLS adds another on top. TCP Fast Open (TFO) is a Linux feature that lets repeat connections skip the handshake round trip by carrying the first data inside the SYN packet itself. It is one of the cheapest latency wins available on a VPS: one sysctl, one nginx directive, and a counter check. This guide covers what it saves, when it helps, and how to verify it is actually working.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What TFO actually saves<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A normal new connection costs two round trips before the first byte of an HTTPS request reaches your application: one for the TCP handshake and one for the TLS handshake. With TFO, a client that already holds a valid cookie sends its first request data inside the SYN, so the server can answer immediately \u2014 the TCP handshake collapses to zero extra round trips for that connection.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Scenario<\/th><th>Without TFO<\/th><th>With TFO<\/th><\/tr><\/thead><tbody><tr><td>First visit (no cookie)<\/td><td>2 RTT to first byte<\/td><td>2 RTT (cookie is learned)<\/td><\/tr><tr><td>Repeat visit<\/td><td>2 RTT<\/td><td>1 RTT<\/td><\/tr><tr><td>Keep-alive reuse<\/td><td>0 extra RTT<\/td><td>0 extra RTT<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The effect is real but bounded: it only applies to new connections, and keep-alive already eliminates handshakes for browsers that hold connections open. TFO pays off most for connection-heavy clients \u2014 mobile apps, API consumers, and short-lived scraping jobs that reconnect constantly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enable it on the server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The kernel switch is a single sysctl. The value is a bitmask: bit 1 enables TFO for outgoing (client) connections, bit 2 for incoming (server) connections. Most distributions default to 1, which is why you must set it explicitly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># enable both client and server side\necho 3 | sudo tee \/proc\/sys\/net\/ipv4\/tcp_fastopen\necho \"net.ipv4.tcp_fastopen = 3\" | sudo tee \/etc\/sysctl.d\/99-tcp-fastopen.conf\nsudo sysctl --system<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Value 2 enables server-side TFO only \u2014 the safe choice if you never want your VPS to initiate TFO connections itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Turn it on in nginx<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">nginx exposes TFO as a <code>listen<\/code> parameter; the number is the pending-SYN queue size for TFO connections:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 443 ssl fastopen=3;\n    listen 80 fastopen=3;\n    # ... rest of the server block\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload with <code>sudo nginx -t &amp;&amp; sudo systemctl reload nginx<\/code>. Reverse proxies in front (HAProxy, and most load balancers) pass TFO through once the kernel supports it, but verify with the counters below rather than assuming.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Client-side behavior<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Modern clients support TFO out of the box or behind a flag: curl has <code>--tcp-fastopen<\/code>, recent Firefox enables it by default on desktop, and Chromium exposes <code>--enable-tcp-fast-open<\/code>. You do not control your visitors&#8217; browsers, which is exactly why the server-side setting matters \u2014 every TFO-capable repeat visitor gets the benefit with zero changes on their end.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where the milliseconds show up<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The clearest wins appear in anything that opens many short connections: mobile apps that sync on launch, payment and API integrations that call your endpoint per request, analytics beacons, and pages that load resources from the same origin without keep-alive. On a page with dozens of same-host requests, TFO removes a full round trip per new connection on repeat views \u2014 often the difference between a 400&nbsp;ms and a 250&nbsp;ms page load on a high-latency link. Measure it with a real client: compare <code>curl -w '%{time_starttransfer}'<\/code> against <code>curl --tcp-fastopen -w '%{time_starttransfer}'<\/code> over a few hundred requests and average the difference.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify with kernel counters<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Do not trust the config; trust the counters. The kernel tracks TFO in <code>nstat<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nstat -az | grep -i fastopen<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Counter<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>TCPFastOpenActive<\/td><td>Outbound TFO connections (client role)<\/td><\/tr><tr><td>TCPFastOpenPassive<\/td><td>Inbound TFO connections accepted (server role)<\/td><\/tr><tr><td>TCPFastOpenFail<\/td><td>Cookie rejected or handshake failed<\/td><\/tr><tr><td>TCPFastOpenListenOverflow<\/td><td>TFO dropped because the accept queue was full<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After enabling the sysctl and reloading nginx, generate traffic with <code>curl --tcp-fastopen https:\/\/your-vps\/<\/code> and watch <code>TCPFastOpenPassive<\/code> climb. If it stays at zero, check that the sysctl survived a reboot and that no firewall is stripping the TFO option from SYN packets. You can also inspect individual packets: a SYN carrying the TFO option (kind 34) is visible in <code>tcpdump<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Caveats and when to skip it<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Middleboxes.<\/strong> A small number of firewalls drop SYN packets that carry data. The kernel detects this and retries without TFO, so the failure mode is a slow first attempt \u2014 measure, but do not fear it.<\/li><li><strong>Repeat connections only.<\/strong> First visits are unchanged; TFO&#8217;s benefit compounds with returning traffic.<\/li><li><strong>No bandwidth effect.<\/strong> TFO removes a round trip; it does not change throughput. Pair it with modern congestion control for the full latency story.<\/li><li><strong>Security.<\/strong> The TFO cookie prevents address spoofing for SYN-carried data; the design has held up in production for years, but keep the kernel updated as usual.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">TFO is one of those rare optimizations where the whole change is a sysctl, a directive, and a counter check. Combined with <a href=\"https:\/\/virtualserversvps.com\/\">solid VPS hosting<\/a>, it shaves measurable milliseconds off every repeat connection \u2014 and if you are still deciding where to deploy, <a href=\"https:\/\/virtualserversvps.com\/#providers\">compare providers on our VPS comparison table<\/a> before you commit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Want to test it on a fresh box? <a href=\"https:\/\/interserver.net\/vps?id=1067805&amp;sid=virtualserversvps\" rel=\"noreferrer noopener sponsored\" target=\"_blank\">InterServer&#8217;s VPS plans<\/a> give you full root access and a stock kernel, so the sysctl and nginx settings above apply exactly as written.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Latency is measured in round trips. Every new TCP connection to your VPS costs one full round trip (SYN, SYN-ACK, ACK) before a single byte of application data moves \u2014&#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":[3],"tags":[],"class_list":["post-948","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 Fast Open on a VPS: Cut a Full Round Trip From Every Connection - 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\/tcp-fast-open-vps-latency\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection\" \/>\n<meta property=\"og:description\" content=\"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-22T23:16:04+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\/tcp-fast-open-vps-latency\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/\",\"name\":\"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-08-22T23:16:04+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection\"}]},{\"@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 Fast Open on a VPS: Cut a Full Round Trip From Every Connection - 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\/tcp-fast-open-vps-latency\/","og_locale":"en_US","og_type":"article","og_title":"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection","og_description":"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection","og_url":"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-08-22T23:16:04+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\/tcp-fast-open-vps-latency\/","url":"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/","name":"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-08-22T23:16:04+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/tcp-fast-open-vps-latency\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"TCP Fast Open on a VPS: Cut a Full Round Trip From Every Connection"}]},{"@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\/948","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=948"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/948\/revisions"}],"predecessor-version":[{"id":951,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/948\/revisions\/951"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}