in reply to Unable to preload Data::Dumper with mod_perl

I'm sorry to hijack the thread but since Corion already gave a great answer I want to inject what I consider important context for newcomers to Perl webwork who read a glowing endorsement of modperl on the cusp of 2018.

“Apache is like Microsoft Word. It has a million options but you only need six. NGINX does those six things, and it does five of them 50 times faster than Apache.” — Chris Lea

modperl is somewhat analogous to CGI at this point. It was the cat's meow in its day but really shouldn't be used on new work unless you have a compelling reason; i.e. an Apache hook that is impossible to implement in another webserver. My context, I'm no hater: I used modperl personally for years and I still use it at work—and like it—but only because the codebase is from the 90s.

I argue that Perl best practice today—and for a few years now—is nginx with uWSGI as the Perl application server. Excepting the edge cases modperl affords where direct interaction with the webserver is necessary, this new deployment combination is better in every single way.

  • Comment on Re: Unable to preload Data::Dumper with mod_perl

Replies are listed 'Best First'.
Re^2: Unable to preload Data::Dumper with mod_perl
by nysus (Parson) on Dec 04, 2017 at 19:35 UTC

    I'm definitely open to trying something new under the hood. Thanks! For now, I was more interested in having fun developing my own little web framework to see what was involved (using jQuery Mobile as a front end). I was going to kick the tires of Dancer to see what it can do for me. I'll try it with nginx per your suggestion. So can you give me a rough idea of how it works? Can I store all the Perl modules in memory like with mod_perl? If not, how does it achieve results on par with mod_perl?

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

      I started a reply but it got out of control with covering too many topics. So, for now, because I might have time to finish what I started later, I'll just say I am a huge fan of development for development's sake. A lot of my chops came from toy apps and home code. So, never read my "best practices" soapbox as a critique of programming for self-directed fun. :P If I get time to finish a "modern" deployment write-up, I will.

Re^2: Unable to preload Data::Dumper with mod_perl
by nysus (Parson) on Dec 04, 2017 at 20:39 UTC

    I fired up nginx and for a minimalist web page with jQuery I'm seeing page rendering times of under 100ms on a pretty consistent basis on a clone of the same server. So that's about 1/2 of what I was seeing with apache and mod_perl. Note, however, I haven't connected it to a database and backend or used any perl code. It'll be interesting to see what happens when I add that to the mix.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks