Re: CGI vs FastCGI

Vincenzo Romano <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Organization NotOrAnd.IT Information Technologies
Message-ID <1241448672.5103.14.camel@g1s>
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
because:

1. process start up fee is paid only once (scheduler resources
allocation);
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
start up.

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:
> Hi,
> 
> 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-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers

-- 
Vincenzo Romano
NotOrAnd Information Technologies
cel. +39 339 8083886  | gtalk. [email protected]
fix. +39 0823 454163  | skype. notorand.it
fax. +39 02 700506964 | msn.   notorand.it
<Non quietis maribus nauta peritus>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.