[FASTCGI] CGI vs FastCGI
vincenzo.romano at notorand.it
Mon May 4 10:51:12 EDT 2009
I would advise you towards real-world performance tests, though.
The design differences between the two approaches is quite small,
so you can try your very application with both.
In general, unless poor programming techniques get involved, FastCGI
yields to (much) better results than CGI (with no test at all) at least
1. process start up fee is paid only once (scheduler resources
2. application initialisation and finalisation fees are paid only once
(system resources, like DB connections and file descriptors, get
acquired and released not for every request)
But I wish to warn you that:
3. Even small memory leaks can lead to disasters in FastCGI;
4. The resource clean up among requests is to be designed and
implemented very carefully, otherwise it will cost more than a process
The only case in which I would use CGI is with very limited computing
resources that make a persistent process not viable. But it seems this
is not your case.
On Mon, 2009-05-04 at 16:32 +0200, Johann Seydoux wrote:
> I have to develop an C++ application that will be used on a web server
> and to choose the most performant interface between CGI and FastCGI.
> Therefore I've done a trivial performance test with an simple "hello
> world" application to compare both interfaces.
> I've made the test with this configuration :
> * Intel Core 2 Duo E8400 @ 3.00Ghz
> * 256Mb RAM
> * Linux version 2.6.26-2-686 (Debian 2.6.26-15)
> * lighttpd-1.4.19 (ssl)
> * ApacheBench v2.3
> The Lighttpd config is the default config and I've loaded mod_cgi and
> mod_fastcgi. Only one process is running for FastCGI.
> The results of the test (running on localhost) with 1000 requests and a
> concurrency of 10 are :
> * 5000 req/s with FastCGI module
> * 100 req/s with CGI module.
> Can I trust these results (big difference)? Has someone already done a
> performance test between these two interfaces? And how were the results?
> Thanks for your answers.
> FastCGI-developers mailing list
> FastCGI-developers at mailman.fastcgi.com
NotOrAnd Information Technologies
cel. +39 339 8083886 | gtalk. vincenzo.romano at notorand.it
fix. +39 0823 454163 | skype. notorand.it
fax. +39 02 700506964 | msn. notorand.it
<Non quietis maribus nauta peritus>
More information about the FastCGI-developers