Jump to content

Switching to Nginx from Apache


Recommended Posts

I plan on switching to Nginx from Apache as now that traffic is up on this particular server Apache is just eating way to much RAM. It's at the point where i can't upgrade the server anymore as the motherboard isn't capable. Its currently got an Intel Xeon E3-1230 and 32GB of RAM. During peak times Apache hit's the 2400 Max clients limit i have then over time leaks memory until the server dies.

Now this isn't the result of IP.Board but other sites i manage on this server. I was just wondering is there anything i should know or check out before running any of the IPS products with Nginx ?

Link to comment
Share on other sites

not sure if it helps but since I am using a cpanel setup I am using nginx plugin for it to proxy to apache.

I get spikes of guests often.

I have tried the unixy varnish plugin and had slightly better performance but it has issues with logged on users and using ip.content as home page with rewrite rules, use no rewrite for furls and works fine. I just hate the look of the urls,

I have tested the nginx admin free and the cpnginx, both work well but the free plugin actually works better with cpanel cloudflare integration. reports ip's correctly while the cpnginx for some reason balks at adding the cloudflare ip's to the http section of the conf file. and cpnginx support is being a real PITA over this, I pretty much told them off over this.

apachebooster seems to work well now with cpanel too but I need to examine that more.

but if not using cpanel none of this applies.

Link to comment
Share on other sites

I installed nginx as a reverse proxy on top of Apache with cPanel but it seemed like nginx kept crashing and was displaying 502 errors and lagging on all sites on the server. IOWait also skyrocketed while nginx was installed.

Since then i have reverted back to just Apache until i decide on what to try next or to just colo another server.

Link to comment
Share on other sites

I as well am using mod_ruid2 as i was hitting an account connect limit with fcgi causing pages to randomly not load while traffic is high.

I installed it twice just to make sure everything got built correctly, pages do load but takes forever and then sometimes just 502's.

Cacti was reporting but then failed as the lag started but you can see the increase in io wait, it only starts recording again after nginx is disabled.

post-212848-0-65707500-1351801555_thumb.

I might try it again and turn GZIP off, the thing is the forum is the only site account on the server using gzip anyways.

Thanks the info

Link to comment
Share on other sites

I've never really seen the free nginx plugin for cpanel (http://nginxcp.com/) fail for anyone unless they're on unusual settings.

It sounds like your server overloaded after installing nginx... and with apache failing, you got 502s.

If you're going to try it again, be sure to record what's causing the slow down / resource hog. I doubt nginx would be the direct cause. Above image from cacti is virtually meaningless information other than it was down on diagnosing the issue. Since you're still running apache, options like apachectl fullstatus is still open to you. and the obvious top outputs.

Additionally, lower your apache's max child by a lot. To something like 20~40. With nginx in the front, you wouldn't need anymore than that and a low value of it would help you against apache flood attack (intentional or not).

Link to comment
Share on other sites

2. Proxying to Apache isn't going to do much either, just get rid of it. Here's what I use for FURLs in nginx: http://paste.laravel.com/9S1

It seems to me from everything I've read the choice of dumping apache largely hinges on how much you use .htaccess. If you are using Wordpress plugins that need to write to .htaccess, like a redirect plugin, then it's going to be tough to dump it.

Link to comment
Share on other sites

It seems to me from everything I've read the choice of dumping apache largely hinges on how much you use .htaccess. If you are using Wordpress plugins that need to write to .htaccess, like a redirect plugin, then it's going to be tough to dump it.

Yeah, but finding someone who can convert your htaccess file shouldn't be that hard.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...