mylesagray
mylesagray

Reputation: 8869

Methods for using HTTP Keep-alive on HTTP requests

I have been reading up on web-site performance lately and along side lowering HTTP-Requests there is another major factor in web-performance.

Keep-alive connections between the server and the client.

Now as I am on shared hosting I very much doubt KA connections are possible but i will soon me setting up my own linux testbed server at home to run my blog off for a few weeks while running different optimisations on the site.

One of those being KA before I take the plunge and buy myself a year of nice shiney hosting from media-temple for myself and my clients.


Does anyone have any experience with KA connections on a normal web-site and if so what are the performance gains (rough figures) you saw from these optimisations?

I would like to know what are the methods of implementing KA from a linux server standpoint and is KA more router/firewall centric, server-side code based or kernel based?

Upvotes: 1

Views: 1813

Answers (1)

penguin359
penguin359

Reputation: 1489

HTTP Keep-Alives are a features of the HTTP Application layer and are not affected by the kernel or normal routers/firewalls. However, NAT routers (any consumer router is an NAT router) impose limits on how long a connection can be idle before it is dropped. Many good NAT routers allow 5 minutes or more, but some particularly bad NAT routers can be 60 seconds or less. In general, HTTP Keep-Alives are best for 15 seconds or less and are used to allow multiple requests to be handled in the same TCP connection such as what happens when a webpage with multiple images, stylesheets, and other content is downloaded. It is especially useful with SSL since it takes a lot more time and resources to start a new SSL connection and Keep-Alives allow the same SSL connection to be used multiple times.

Upvotes: 1

Related Questions