double | 2 May 2009 23:13
Picon
Picon

mod_fastcgi buffersize

Hello,

A FastCGI application creates a website, and the content
size is below e.g. 100k.
Let's image, the client has a slow dialup-connection. Will,
in this case, the FastCGI application be blocked until the
website is entirely transfered to the client? Or is this  website
buffered by the webserver and the FastCGI application can
process a different request?

Thanks
Marcus
Rasmus Andersson | 3 May 2009 13:03
Gravatar

Re: mod_fastcgi buffersize

Totally depends on the implementation. FastCGI is merely a protocol
and a C library implementation of that protocol. How you handle the
kind of I/O you're talking about is outside of the scope of this list.

But there are basically three models:

1. blocking I/O, single thread
This model handles one request in sequential order. That means if
request 1 takes 4 seconds to process, request 2 will have to wait for
up to 4 seconds.

2. non-blocking/asynchronous I/O, single thread
This popular model builds on the idea that I/O is the bottle neck, not
the CPU. Handles multiple requests at once but code will never execute
concurrently.

3. blocking or non-blocking I/O in multiple threads of control
Consumes more memory, context switches and CPU than model 2 but is
much easier to implement and provides the same features, except from
that in a well-designed application, code can execute concurrently.

If your model is 1. you have a problem (unless there are multiple
processes running, which is probably the case if you are running PHP).
If your model is 2. and you use blocking I/O (for instance from other
libraries, like database clients) you have a problem (unless multiple
processes, but then you would probably want to use model 1.).

On Sat, May 2, 2009 at 23:13, double <ninive@...> wrote:
> Hello,
>
(Continue reading)

Andrew Vonderwueste | 4 May 2009 00:13
Picon
Favicon

perl lighttpd.conf

I am new to fastcgi and lighttpd and am unable to find a good example of a lighttpd.conf file set up for multiple perl fcgi scripts.

My current test setup is:

fastcgi.server = ( "..fcgi" =>

        (( "socket" => "/tmp/application.fcgi.socket",
        "bin-path" => "/var/www/html/site1/fcgi/script1.fcgi",
        ))
)

Adding another script or two must be simple, but I have been unable to get it right. Any help would be greatly appreciated. Thanks.


_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
Matthew Weigel | 4 May 2009 05:57
Favicon
Gravatar

Re: perl lighttpd.conf

Andrew Vonderwueste wrote:
> I am new to fastcgi and lighttpd and am unable to find a good example of
> a lighttpd.conf file set up for multiple perl fcgi scripts.
> 
> My current test setup is:
> 
> fastcgi.server = ( "..fcgi" =>
> 
>         (( "socket" => "/tmp/application.fcgi.socket",
>         "bin-path" => "/var/www/html/site1/fcgi/script1.fcgi",
>         ))
> )
> 
> Adding another script or two must be simple, but I have been unable to
> get it right. Any help would be greatly appreciated. Thanks.

First... I assume the "..fcgi" is a typo in copying your config?
After that, it looks like the problem you might be having is that all .fcgi
requests get sent to script1.fcgi; the way you've configured lighttpd, all GET
requests that end in ".fcgi" are being routed to the FastCGI started from the
bin-path there.

PHP handles this in a very different manner, which might be what you're
expecting: the PHP interpreter itself speaks FastCGI and executes the scripts
without anything in the script knowing the difference.  An individual Perl
script can speak FastCGI, but the perl binary itself doesn't run as a daemon
serving requests.

So, each fastcgi.server that you specify has to correspond to an individual
Perl script acting as a FastCGI server, and you're better off partitioning
part of the URL namespace (like http://www.example.com/application1/ and
everything under it) for each script that runs.

Hope that helps!
--

-- 
 Matthew Weigel
 hacker
 unique & idempot . ent
Johann Seydoux | 4 May 2009 16:32
Picon

CGI vs FastCGI

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  <at>  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.
Vincenzo Romano | 4 May 2009 16:51
Picon

Re: CGI vs FastCGI

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  <at>  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@...
> http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers

--

-- 
Vincenzo Romano
NotOrAnd Information Technologies
cel. +39 339 8083886  | gtalk. vincenzo.romano@...
fix. +39 0823 454163  | skype. notorand.it
fax. +39 02 700506964 | msn.   notorand.it
<Non quietis maribus nauta peritus>
terius | 20 May 2009 17:27
Picon

Install problem

Hello I am trying to make php4 and php5 work together, php4 as module and
php5 with fastcgi, but I am getting a problem that when I run a php5 page,
it says that fastcgi exits with code 0 and restarts

Can someone help me please I need to have this working asap.

Thanks
Ricardo Sal | 24 May 2009 18:36
Picon

looking for a tcp dump of fastcgi

I started yesterday on mad :) quest to implement fastcgi in a very simple web server (programed in script language).

I am already aware on how to use normal cgi, since i have implemented it already. Naturally with these the combined factors, the speed is really slow.

I found already a lot of docs describing the protocol, but i tend to be an example guy that is why i am contacting you (since all dumps found were very incomplete).

I was looking for a full tcp dump of a full fastcgi communication (of any php page) with ethereal/wire-shark or any other program and i was hoping one of you could provide that to me.

Many thanks in advance for the patience :)

Regards

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
Veli Ogla Sungutay | 25 May 2009 02:30
Picon
Gravatar

FastCGI + lighthttpd for Adobe AIR

Hi all,

I'm sure you guys are familiar with Adobe's Desktop runtime AIR. Think of it as the Flash Player working on the desktop with access to the filesystem. We can
build fancy desktop user interfaces. The problem is that we cannot extend it with C/C++ libs. So I've been experimenting ways for communication between AIR and C libraries.

I think a good strategy would be to use a XML Socket server. But do you think FastCGI + lighthttpd would also be a good solution? It will act as an application server
for a AIR desktop application. They will all reside in the same desktop machine.

I appreciate your feedback, thanks!

--
Veli Sungutay
http://www.lyciasoft.com

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
Anil Katragadda | 25 May 2009 14:58
Picon

Configuration needed for fastcgi setup on lighttpd 1.5

Hi,

I am trying to setup fastcgi configuration on lighttpd 1.5.x . As the older mod_proxy and mod_fastcgi were replaced in lighttpd 1.5.x with mod_proxy_core, the old configuration of lighttpd 1.4, won't work. My old configuration in 1.4.x was looking something like this.

fastcgi.debug               = 0
fastcgi.server              = ( ".fcgi" => (
                                  "grisu" => (
                    "host" => "x.x.x.x",
                    "port" => 11000,
                    "bin-path" => env.SRCDIR + "/tmp/mybin",
                    "check-local" => "disable",
                    "max-procs" => 1,
                    "min-procs" => 1
                  )
                )
                  )

Can anyone help me with a sample fastcgi configuration for lighttpd 1.5? Please note that my requirement for fastcgi is not for .php, but for C language binary files. All the examples in lighttpd mod_proxy_core are for setting up '.php' with fastcgi, but none of them are for C binaries.

I appreciate your help.

Thanks,
AK

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers

Gmane