[cgiapp] Running a plain CGI::Application as FastCGI / PSGI

Mark Rajcok mrajcok at gmail.com
Wed May 19 23:34:10 EDT 2010


Regarding the database connections, see
http://docs.google.com/Doc?docid=0AY-OcCA2-lySZGQzNjNmZzlfNzdnYjRoZGg3Yg&hl=en#FastCGI_8880821961767984

Cosimo, if you try PSGI, please let us know how you make out.  I want to
convert an app I have from FastCGI and Apache to PSGI and Starman.

-- Mark R.

On Thu, May 13, 2010 at 11:38 AM, Ben Hitz <hitz at genome.stanford.edu> wrote:

>
> I don't think CGI::Application::FastCGI works.  It's relatively
> trivial to convert your controller script to Fast CGI.
>
> It's basically this:
> use CGI::Fast();
>
> use MyCGI::Application::Class;
>
>
> while(my $q = CGI::Fast->new) {
>     my $app = MyCGI::Application::Class->new(QUERY => $q)
>                                                       );
>     $app->run;
> }
>
> Add any other parameters (template path, etc) to the constructor as
> usual.
>
> You have to be a little careful with how you handle your database
> connections.
>
> Ben
> On May 13, 2010, at 12:55 AM, Cosimo Streppone wrote:
>
> > Hi,
> >
> > I have a personal project running on plain CGI w/ CGI::App
> > and it's been running fine, reasonably fast for what I need.
> >
> > The traffic is growing though, so I'd like to improve response time
> > considerably. I have settled on 2 main options, FastCGI and PSGI.
> >
> > I think PSGI is my preferred option, but it would probably require
> > more work? Maybe not...
> >
> > Regarding FastCGI, a quick search found me:
> >
> > 1) CGI::Fast, http://www.cgi-app.org/index.cgi?FastCGI
> >    requires more "conversion" work
> >
> > 2) CGI::Application::FastCGI,
> > http://search.cpan.org/dist/CGI-Application-FastCGI/
> >    quite old, but less work to do?
> >
> > I will start playing with this stuff soon,
> > but if you went through this already, I'd appreciate some
> > guidance.
> >
>


More information about the cgiapp mailing list