Re: [cgiapp] Running a plain CGI::Application as FastCGI / PSGI
A long time ago Mark Rajcok wrote: I want to convert an app I have from FastCGI and Apache to PSGI and Starman. Sorry to come back this old issue, but I'm planning to move from (Apache) mod_cgi to mod_fastgci. However I have recently read a lot about Plank/PSGI. I think I got the idea of Plank/PSGI (a specification and middleware for web framework developers) but I don't quite understand what benefits my CGI::App based webapp gets using mod_psgi instead of mod_fastcgi ? Which one is faster ? Will I have more hosting options when PSGI has been established as de-facto standard ? Anyway PSGI is a future-proof, right ? # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Running a plain CGI::Application as FastCGI / PSGI
On 07/30/2010 11:50 AM, Jani Hurskainen wrote: I think I got the idea of Plank/PSGI (a specification and middleware for web framework developers) but I don't quite understand what benefits my CGI::App based webapp gets using mod_psgi instead of mod_fastcgi ? It's Plack not Plank :) The benefit is that once your application works with PSGI then you can move it between mod_cgi, mod_perl, fastcgi, Starman, Tatsumaki, Twiggy, etc. It's not tied to a particular web server since there are Plack adapter layers that can be used to make a PSGI application run on any of those. Most web frameworks try to abstract away most of this already, but they all do it in different wants. PSGI is meant to standardize all of these so there's not so much wheel reinvention. Also it allows people to write middleware components that can be run for any PSGI application. So a catalyst app running under mod_perl can use the same debugging toolbar as a CGI::Application app running under Starman. -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Running a plain CGI::Application as FastCGI / PSGI
Regarding the database connections, see http://docs.google.com/Doc?docid=0AY-OcCA2-lySZGQzNjNmZzlfNzdnYjRoZGg3Yghl=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 h...@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. # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
[cgiapp] Running a plain CGI::Application as FastCGI / PSGI
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. -- Cosimo # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Running a plain CGI::Application as FastCGI / PSGI
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. -- Cosimo # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## #### -- Ben Hitz Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium Stanford University ** h...@genome.stanford.edu # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####