Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found