hgarg has asked for the wisdom of the Perl Monks concerning the following question:

We fetch multiple web pages in our mod_perl handler. To send concurrent requests we have been using Parallel::ForkManager. Apparently a forked environment is not recommended for using this module. See http://search.cpan.org/~szabgab/Parallel-ForkManager-1.06/lib/Parallel/ForkManager.pm#BUGS_AND_LIMITATIONS . Our findings, for concurrent requests (ab -n100 -c5) with and without this module, confirm this.

We are considering Mojolicious for non blocking page fetches. However we are not sure if that has limitations too when used within Apache's pre-forked mod_perl handler. Any arguments against using it could help us skip the migration early. Does Mojolicious's non blocking web page fetch interfere in anyway with Apache's mod_perl handlers?

Thanks
  • Comment on Using Mojolicious Non Blocking Page Fetch within Apache preforked mod_perl handlers

Replies are listed 'Best First'.
Re: Using Mojolicious Non Blocking Page Fetch within Apache preforked mod_perl handlers
by perlfan (Parson) on Jun 04, 2014 at 14:26 UTC
    Usually Mojo is used as a persistent process listening on an internal port. Requests are handled via Apache using mod_proxy or some other intermediary (e.g., HAProxy, Varnish, or Nginx). I would not recommend this approach with mod_perl if you can help it.
      Yes that makes sense. Thanks.
Re: Using Mojolicious Non Blocking Page Fetch within Apache preforked mod_perl handlers
by Anonymous Monk on Jun 04, 2014 at 07:23 UTC
      Many thanks. I was hoping that I could just replace the Mechanize calls by Mojolicious's. It looks like more work may be needed. I've asked on the forum to confirm this though.