Debian/Ubuntu Tips and Tricks

Debuntu

Debian/Ubuntu Tips and Tricks

Basic Apache Optimizations — page 2

Posted by chantra on September 23rd, 2006

This entry is part 2 of 2 in the series Basic Apache Optimizations

KeepAlive

KeepAlive is a feature that make the server keep each listening connection alive for a certain amount of time, allowing a client and the server to keep the same connection for a certain amount of time. This feature has benefits and drawbacks.
A benefit would be that a client making more than one request won't have to re-initiate a new connection for each request.
A drawback will be that ressources on the server are monopolize for a predefined time, even though the client might not request other pages.

By default, on Debian and Ubuntu, KeepAlive is set to On and the KeepAliveTimeout to 15, so if you get 256 different connections per seconds during 15 seconds, you could (theorically) have to allocate memory for 3840 connections :s .

There is 2 options in order to handle this:

  • Disable KeepAlive connections (by setting KeepAlive to Off)
  • Shorten the KeepAliveTimeout value to something like 3 seconds for instances), reducing the maximum simultaneous opened connections to 768

Compress HTTP Content

If you are running out of bandwidth, it could be worth using mod deflate.
Mod deflate is an Apache module compressing HTTP content on the fly.
Because data will be compressed, your bandwidth will be saved, but as a drawback, you will need more CPU resources per request.

Series Navigation<< Basic Apache Optimizations

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>