Hi Monks,
I've got a mod_perl handler below...
<Location /session>
SetHandler modperl
PerlResponseHandler JSON::RPC::Server::Apache
PerlSetVar dispatch "Handler::API::Session"
PerlSetVar return_die_message 1
</Location>
In the handler, I call some class methods of a module that has a global database handle (to retain a persistent connection). I know I could use Apache::DBI but had some problems, and there shouldn't be any issues with keeping a dbh in a modules' namespace for re-use by any methods in that module.
The handler then does a couple of forks for the children to do some simultaneous actions, all of this works fine-ish. They do a CORE::exit once they've written data back to the parent.
I am however seeing some really strange behaviour, could this be caused by the dbh being copied to all children, then when they close they mess up the parent's one?
After giving apache a battering with Apache Benchmark, then trying a manual call, I see that when calling the handler, the process runs fine, but the time taken is reported as if it's the end of a previous process, ie, it completes in seconds when tailling the logs, but states it took 120 seconds.
I'm timing the handler with Time::HiRes::gettimeofday().
Any advice would be great, it's a really strange problem that I'm pulling my hair out over.
Cheers
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.