Linux.com: Understanding and Working with Network ServicesMar 27, 2001, 21:15 (0 Talkback[s])
(Other stories by Jerry Kilpatrick)
"Inetd itself is a daemon. However, its purpose is to wait for requests for various different services and then pass them on to the appropriate service program. An example of this is a connection to an FTP server. When a computer across the network tries to connect to the FTP server on your machine, inetd recognizes this connection as an FTP connection, and sends that request to the actual FTP server program you have designated. The benefit of running services in this way is that it takes up less system resources. The reason it takes less resources is; 1) because instead of having an FTP server, a POP3 (Post Office Protocol 3) server, and a UUCP (UNIX to UNIX Copy) service running all at the same time, each taking up its own share of memory, all you have is one server, inetd, running, only taking up memory for itself. When a request comes in, inetd spawns (another way of saying it runs another program) an FTP server and when it is done, all the memory and resources that the FTP server was using are availaible again."
"Why not run Everything Through inetd?"
"Yes, in most cases using inetd is easier on the system, but programs like Apache are very robust and need to be run by themselves. For instance, Apache has the ability to remember who just connected to it and so serve web pages to each person faster. This would be impossible to implement with inetd sending requests to Apache, since Apache would run once and then die (another way of saying it does its job and then exits). Apache has to stay in memory as a daemon to be able to serve pages faster. Another reason why services like Apache need to be run independently is because Apache takes a while to load. When I say a while, I actually only mean just slightly more than a split second. It doesn't sound like much, but if you were running it each time you had a request through inetd, there would be enough of a delay to become annoying."