Re: each_cgi in fastcgi

Kent Sibilev
Sun, 13 Feb 2005 17:31:44 -0000

Dick Davies <rasputnik-ogHSZ3ARDZIOXkKaSkYkkl6hYfS7NtTn@public.gmane.org>
writes:

> Am I using the right fastcgi lib?
>
> It does''nt seem to be as fast as I''ve heard, and I notice
that
> rails uses fcgi.rb''s each_cgi() method.
>
> On my version, that''s a pure ruby function (fcgi.so
doesn''t have
> that method). Is this right, or should I be using a different
> version?

fastcgi extension comes with native part and ruby part. When you
require ''fcgi'' you load fcgi.rb part which tries to load
fcgi.so
dynamic library. If it fails to do it, fcgi.rb emulates fcgi protocol
in pure ruby. each_cgi is a pure ruby method implemented in fcgi.rb.

If you see that fastcgi extension is not as fast as you expect, try to
load the native part explicitly like so: require ''fcgi.so''

Cheers,
Kent