(This term is UNIX-specific, the content isn't. The description is Web-centric, the idea isn't.)

Fork overhead is an issue that hinders often the web site performance when using CGI programs.

The problem is simple: For each HTTP request of the CGI script, the httpd needs to fork (form a new child process), execute a shell (in worst case, in best case this can be avoided) which in turn forks and executes a program, which then returns output to httpd. Forking and executing takes time and computing power.

This sounds like something easy and insignificant. However, if you think about it, it's probably something you don't want to do 10000 times per second. Or 100000. Or million.

fork overhead can, in this case, eliminated by embedding the separate executables to the httpd itself, or using a separate slave process that runs alongside httpd. A classical example of these would be mod_perl (Apache module that embeds a Perl interpreter - handy because most CGI scripts are written in Perl) and example of the latter case would be servlets (that are, in Apache's case, handled by separate servlet engine).

Log in or register to write something here or to contact authors.