0

I've been using mod_perl for years. I have a few modules that handle Apache requests at early states, basically custom responses based on request headers that alter the normal response from Apache, like custom response codes and things like that.

I've been told by others that these days there are better ways to run Perl applications in a fast way (e.g. with a persistent interpreter that only takes subs as request handlers, similar to mod_perl), but none of them can tell me with good authority or experience what is proven to work as fast (or even better, if better) as mod_perl.

I'd like to get a more experienced opinion on that subject and I thought StackOverflow can be a perfect place to get answers from such people.

So, as of 2014, which alternatives to mod_perl are proven to be good or even better (in terms of performance and reliability) and why? Which pros or cons do you get with them compared to mod_perl?

Alonessix
  • 82
  • 1
  • 8
Francisco Zarabozo
  • 3,676
  • 2
  • 28
  • 54
  • This would be a great question for http://softwarerecs.stackexchange.com/ – Keith Thompson Aug 09 '14 at 22:44
  • The [Perl Dancer Deployment doc](http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod) give some nice options (see section on Plack with Apache). – user3183018 Aug 09 '14 at 23:17
  • This seems to be a duplicate of [this question](http://stackoverflow.com/q/4687127), but because I have already voted to close I cannot add any more information – Borodin Aug 10 '14 at 01:08
  • 3
    mod_perl is not a web framework. I don't see any relation between this question and the question Borodin linked. – ikegami Aug 10 '14 at 06:33
  • Then again, the OP's question has numerous problems in it. It wouldn't surprise me if he did want a web framework even though he keeps mentioning mod_perl. – ikegami Aug 10 '14 at 06:41
  • @Ikegami: That was just an example of normal use, although I have a couple of them that really alter the normal response in ways that CGI cannot. Anyway, that was never the main purpose to use mod_perl, it was the speed gained from having a persistent Perl interpreter that already compiled all the modules for the application, even more with properly written handlers. I apologize if my question reflected something different. – Francisco Zarabozo Aug 10 '14 at 06:49
  • 3
    The main purpose of mod_perl in theory is to be able to write Apache modules in Perl instead of C. The main purpose of mod_perl in practice is to provide a persistent Perl interpreter to speed up content-generating scripts. Fast CGI is the only alternative I know for this latter purpose. Probably nothing else out there because it works great. – ikegami Aug 10 '14 at 06:53
  • 1
    Apache modules are dynamically linked to Apache itself. nginx modules, on the other hand, are external processes that communicate with nginx using Fast CGI. Nginx revisited what a web server should be, so its telling that it uses Fast CGI. – ikegami Aug 10 '14 at 06:58

1 Answers1

6

The Plack module, which implements the Perl Web Server Gateway Interface (PSGI) is popular for good reason.

It presents a standard API that allows a Perl web application to run on old CGI, FastCGI, mod_perl, and others, or it can behave as a stand-alone web server on its own.

I can't offer any benchmark figures, but I will update this answer if I find anything relevant.

Borodin
  • 126,100
  • 9
  • 70
  • 144