Hi,

I'm currently battling with a REALLY frustrating bug with nginx and Apache 2.4 (as a proxy). We serve all the main content up with nginx, and then pass the Perl stuff to Apache, so we can make use of mod_perl. The problem is I'm having all kinds of issues with Apache gobbling up tons of CPU:

http://serverfault.com/questions/841786/apache-2-4-cpu-running-at-100-for-unknown-reason

So this has me asking.. do I need Apache?

Does anyone have input on the best way to run Perl scripts on a server with nginx? Is it better as:

1) nginx, with reverse proxy to Apache (where we have mod_perl setup)

OR

2) nginx, and using FastCGI to serve them up, like: https://www.linode.com/docs/websites/nginx/nginx-and-perlfastcgi-on-ubuntu-12-04-lts-precise-pangolin -ie don't even bother with Apache2 (this would remove the headache of having 2 systems running as well then!)

I just wanted to get a 2nd opinion from "the monks" before I started trying out the FastCGI option, as I've already spent far too much time on this :(

UPDATE: I thought I would just give it a quick test, and it does seem FastCGI with nginx is pretty slow :(

Exactly the same script:

704ms Apache2 with mod_perl
1144ms nginx with fastCGI


Thanks!

Andy

In reply to Most efficient way to run Perl scripts on nginx server? by ultranerds

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.