Product SiteDocumentation Site

2. Traditional Architectures

Before tackling the topic of pipelining, I will recap the classic designs for server applications.

2.1. Forking servers

Many traditional Unix services are, or have been, based on the forking server architecture. Some prominent examples are Apache, Samba, and PostgreSQL. In that architecture, a single parent process creates the listening socket, and waits for new connections. As soon as one is established, it forks itself and the newly created child handles this new connection. In its basic form it has one child process per connection, thus, it does not utilize multiple CPUs or cores for a single client connection.
An obvious drawback in this architecture is the fact that each new connection creates a new process. Process creation can become a major issue if the connections are short-lived. The most commonly used technique to overcome this disadvantage is the use of pre-forking servers, where a pool of already running children is kept alive. If a new client connection comes in and a pre-forked child is available, the file descriptor of the new client connections is passed on to the already running child process.