Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a similar problem to that of the user who posted High memory usage of WordPress hosted on DreamHost VPS. The reason this is a 'problem' is because when it maxes out the memory quota I set for my VPS it will begin serving 503 error pages for 'uncached' pages (I guess?). Setting the quota higher does help, but I thought nginx would save me some money as well as provide better performance and less memory usage than Apache (especially) and lighttpd. One of my sites is simply an HTML-only website, and the other is a Wordpress website almost nobody looks at / extremely low traffic. I don't get it. I have the quota set to something like 512MB or 640MB RAM just to have it running decently.

Does anyone have any ideas as to what I could do to make nginx run more efficiently, or why I am having this problem?

Thanks!

share|improve this question
    
And how did you tune nginx and PHP? –  Michael Hampton Nov 6 '12 at 23:41
    
Honestly, I didn't do much. I got a VPS without Apache, and installed nginx just like that via SSH and root. –  BlueToast Nov 7 '12 at 4:06
add comment

1 Answer

You must put all domains under the same ftp user, like they say in the wiki.

When using Nginx a set number of PHP processes are started up for every user a domain is hosted under. The same number are started regardless of how many domains are hosted for it. As such, if you have 10 domains spread across 10 separate FTP users you'll get 10x as many PHP processes as you would otherwise get. So, if Nginx is starting up 5 PHP processes, you would end up with 50, which would eat up a considerable amount of memory. The best configuration when using Nginx is to consolidate your domains under one FTP user. You should definitely do this prior to switching to Nginx.

http://wiki.dreamhost.com/Nginx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.