4 ms·
CGI is slow because of the spin up time for individual processes for each request. FastCGI is fast because they run as one long running process that handles mu
by fuball63 9y ago
CGI is slow because of the spin up time for individual processes for each request. FastCGI is fast because they run as one long running process that handles multiple requests.
While plain CGI is a slower, the advantage is that you don't have long running and potentially idle processes for low traffic periods, and process isolation is a little security boost.
I chose to have a slightly slower startup time, which hopefully remain constant in a load balanced cluster, to gain the advantages above.
- dfox 9y agoAlso the spinup time is considerably larger problem for various interpreters and virtual machines than for native code binary. I would even expect that you can write non-trivial CGI application whose startup time is smaller than the additional overhead from parsing of the FastCGI protocol.