ServersHow Do You Choose a Web Server Platform? Page 5

How Do You Choose a Web Server Platform? Page 5

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Early Web servers used inetd to spawn a Web server process that could handle each Web browser request. They were fairly simple applications, and there was no expectation of them having to cope with a high number of hits, so this was a totally reasonable design decision to make at the time.

When discussing how a Web server works, it is not enough to simply outline a diagram of how low-level network packets go in and out of a Web server.

The easiest way to write a server application for Unix systems that needs to handle multiple connections is to take advantage of the inetd daemon, which handles all needed TCP/IP communication.

Normally, a server process has to handle listening for and accepting TCP connections as they are made. It must then make the choice to either juggle concurrent connections, or effectively block any new connections until the current one has been fully served and closed. The inetd daemon can do all this instead, by listening on the desired port (80, by default, for HTTP requests), and running a Web server process as it received each connection.

Using this method also makes administration of the machine easier. On most Unix machines, inetd is run by default, and is a very stable process. Web servers on the other hand, are more complex programs and can be prone to crashing or dying unexpectedly (although this has become less of a problem as these applications have matured). It also means that the administrator doesn’t have to worry about starting and stopping the Web server; as long as inetd is running, it will be automatically run each time an HTTP request is received on the given port.

On the downside, having a Web server process run for each HTTP request is expensive on the Web host, and is completely impractical for modern popular Web sites. These days, most Web sites run a Web server that supports either multi-processing or multi-threading, and are thus able to handle a much higher load.

Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories