[cgiapp] use persisten instance of cgiapp with cgi::fast?

Mike Tonks fluffymike at googlemail.com
Wed Sep 1 12:37:42 EDT 2010


Thanks for this Mark.

I am about to embark on an upgrade from vanilla CGI::App to either
mod_perl or FastCGI and will read this with interest.

Given we are using a dedicated server and just want things to run as
fast as possible, is there anything to choose between the two?  Seems
like more people have mentioned FastCGI here recently than mod_perl?

Regards,

mike


On 1 September 2010 15:22, Mark Rajcok <mrajcok at gmail.com> wrote:
> On Mon, Jul 19, 2010 at 10:46 AM, Michael Peters <mpeters at plusthree.com> wrote:
>> On 07/19/2010 10:09 AM, Dietrich Streifert wrote:
>>
>>> I think most of the performance penalty comes from the DBI-handles which
>>> are not kept open between the requests. Every instance opens two
>>> DBI-handles which are used frequently during runmodes.
>>
>> You really should benchmark it to see where the time is spent. "I think"
>> is a bad way to go about performance improvements :) I'm almost always
>> surprised to find out what my real bottlenecks are.
>>
>> Having said that, DB handles may or may not be real problems. MySQL for
>> example can create new DB handles quickly and with very little overhead.
>> Oracle on the other hand is very expensive.
>>
>> If you do find (Devel::NYTProf, hint, hint :) that you application would
>> benefit from persistent DB handles take a look at DBIx::Connector. It
>> handles that for you and would fix the problem of stale DB handles that
>> people usually encounter when they try to do it themselves.
>>
> Trying to catch up on email here... (hence the response to a month-old email):
>
> When playing with Fast-CGI a while ago, I used DBI->connect_cached()
> in my call to dbh_config() to get cached DB connections under
> Fast-CGI, as described here:
>
> https://docs.google.com/Doc?docid=0AY-OcCA2-lySZGQzNjNmZzlfNzdnYjRoZGg3Yg&hl=en#FastCGI_8880821961767984
>
> At the time, I'm pretty sure I added some test code to prove to myself
> that the connections were being reused/cached.
>
> -- Mark
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>


More information about the cgiapp mailing list