Home > Articles > Programming > PHP

  • Print
  • + Share This
Like this article? We recommend

Alternatives to Apache

Apache is close to the antithesis of the UNIX "do one thing and do it well" philosophy. Apache does a lot of things quite well, but doesn’t really excel at any one thing.

For serving a lot of static content from a single processor machine, few apps beat LightTPD. This web server is designed to have very low resource requirements and to be fast. It can generally handle about twice as many requests as Apache for static content. For dynamic content, it supports CGI and FastCGI. FastCGI eliminates the process creation and destruction overhead of CGI by allowing a single process to handle all requests for a CGI script. The FastCGI interface is supported by PHP, allowing LightTPD to serve PHP pages at least as well as Apache.

When scalability is king, Yaws (Yet Another Web Server) is often a good choice. It’s written in Erlang, a language designed for concurrency, and scales very well. The entire system is designed as a number of concurrent processes, allowing for very high throughput.

A few other web servers exist in the Free Software world, and may suit a particular need better than Apache. One, known as Tux, is even built into the Linux kernel. Tux trades high performance for stability; it doesn’t need to perform a context switch into kernelspace in order to send or receive data over the network. The downside of this arrangement is that it doesn’t enjoy the standard memory protection that userspace programs generally have, so a bug in Tux can crash the entire server. A good use for Tux would be running on a cluster of redundant machines serving static content for a very-high-usage site.

  • + Share This
  • 🔖 Save To Your Account