Subscribe to receive notifications of new posts:

Stayin' Alive

2011-10-19

1 min read
Stayin' Alive

We've been making a lot of improvements deep within CloudFlare that you'll start to see the benefits of over the coming weeks. As the changes graduate from our tests to full production, we'll try and give you a sense of what they are and why they're important. Today I wanted to tell you about one that I'm particularly excited about: end-to-end Keep Alives.

TCP Latency

CloudFlare acts as a reverse proxy. What that means is traffic passes from a visitor through our network of global data centers and then to a website's origin server. CloudFlare used to open a new connection from its network to the origin server for each item requested. While this is the standard behavior for most reverse proxies, it isn't particularly efficient. Each new TCP connection has a certain amount of overhead. By opening new connections for each resource, the TCP overhead can add up and add latency.

Ideally, what you'd want to do is open a connection to the origin server and, assuming that server is getting a constant stream of traffic, hold it open and pass all new requests over it. This not only lessens the TCP overhead, but also decreases the load on the origin server from having to setup and tear down a number of new connections -- something that can particularly slow in Apache.

Johnny 5 Is Alive

So that's exactly what we build. For the last month we've been testing the new Keep Alive setup in Singapore where it performed extremely well. This week we rolled it out across our entire network. For sites that get a constant stream of traffic, there is a significant improvement in the time to the first byte. Even for sites that don't get enough traffic to always hold open a persistent connection there is benefit because most page loads request multiple resources which are all pulled down over a single connection.

Stayin'
Alive

Overall our testing shows that this has improved CloudFlare's overall snappiness on average by another 10% or so. There is nothing you need to change in your settings; if your origin server supports Keep Alive connections you're already seeing the benefit. If your CloudFlare powered site seemed a bit faster the last few days, now you know why.

Stay tuned... more cool stuff to come!

Cloudflare's connectivity cloud protects entire corporate networks, helps customers build Internet-scale applications efficiently, accelerates any website or Internet application, wards off DDoS attacks, keeps hackers at bay, and can help you on your journey to Zero Trust.

Visit 1.1.1.1 from any device to get started with our free app that makes your Internet faster and safer.

To learn more about our mission to help build a better Internet, start here. If you're looking for a new career direction, check out our open positions.
TCPSpeedProduct NewsSpeed & Reliability

Follow on X

Matthew Prince|@eastdakota
Cloudflare|@cloudflare

Related posts

October 24, 2024 1:00 PM

Durable Objects aren't just durable, they're fast: a 10x speedup for Cloudflare Queues

Learn how we built Cloudflare Queues using our own Developer Platform and how it evolved to a geographically-distributed, horizontally-scalable architecture built on Durable Objects. Our new architecture supports over 10x more throughput and over 3x lower latency compared to the previous version....

October 08, 2024 1:00 PM

Cloudflare acquires Kivera to add simple, preventive cloud security to Cloudflare One

The acquisition and integration of Kivera broadens the scope of Cloudflare’s SASE platform beyond just apps, incorporating increased cloud security through proactive configuration management of cloud services. ...