Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Apr 04, 2009 7:58 pm 
Offline
Senior Newbie

Joined: Sat Apr 04, 2009 7:51 pm
Posts: 12
Setting up nginx for the first time, I have the Linode 360 package (360MB ram), planning on running Wordpress blogs.

What would be the optimal configuration settings for nginx and mysql?
How much RAM / worker-threads should I assign?

What's a good keepalive_timeout?


Top
   
 Post subject: yes, please
PostPosted: Wed May 13, 2009 12:05 am 
Offline
Senior Newbie

Joined: Fri Apr 17, 2009 9:15 pm
Posts: 11
Website: http://contraculto.com
Location: chile
anybody? please? i'm quite interested in this myself...

_________________
contraculto.com
estudiosiete.com


Top
   
 Post subject:
PostPosted: Wed May 13, 2009 12:31 am 
Offline
Newbie

Joined: Thu Jan 01, 2009 2:42 am
Posts: 4
nginx uses almost no RAM, so you might as well use four worker threads. You can also set a high keepalive for the same reason, but make sure you have a large limit on max connections and your file descriptor limit is high enough too.

Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
www-data  5579  0.0  0.2   5016  1748 ?        S    Apr17   5:33 nginx: worker process
www-data  5580  0.0  0.2   5024  1768 ?        S    Apr17   5:23 nginx: worker process
www-data  5581  0.0  0.2   5008  1772 ?        S    Apr17   5:23 nginx: worker process
www-data  5582  0.0  0.2   5028  1768 ?        S    Apr17   5:44 nginx: worker process
root     24332  0.0  0.1   4992  1412 ?        Ss   Mar19   0:00 nginx: master process /usr/sbin/nginx


and the relevant parts from my nginx.conf:
Code:
events {
        worker_connections  512;
}
http {
        keepalive_timeout 60 55;
}


Top
   
 Post subject:
PostPosted: Wed May 13, 2009 2:47 am 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Beautiful poem on your website, contraculto (sorry -- not to appear dodgy ;) )

Did you write it ?


Top
   
 Post subject: poem
PostPosted: Wed May 13, 2009 9:41 am 
Offline
Senior Newbie

Joined: Fri Apr 17, 2009 9:15 pm
Posts: 11
Website: http://contraculto.com
Location: chile
nope, not even close :P

that's the bene gesserit litany against fear, from frank herbert's dune series. :)

_________________
contraculto.com

estudiosiete.com


Top
   
 Post subject:
PostPosted: Wed May 13, 2009 10:14 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
argh, it's been too long :)


Top
   
 Post subject:
PostPosted: Wed May 13, 2009 10:20 pm 
Offline
Newbie

Joined: Sun May 10, 2009 1:26 am
Posts: 3
If you're running PHP then nginx alone is not good enough, you must pass the request through to something like Apache (which you probably don't want because you're limited in RAM) or some PHP FastCGI backend.

For a FastCGI backend, I recommend one of two options:

1. If you're compiling PHP on your own then go for PHP-FPM (http://php-fpm.anight.org/). Although I haven't used it myself (since I prefer to use YUM RPMs to keep my PHP updated), I've read a lot of good things about it.
2. If you (like me) install PHP using ready-to-go RPMs for your distro, then use the spawn-fcgi released by LightTPD (http://redmine.lighttpd.net/projects/spawn-fcgi/news). NOTE: You do not need to be running LightTPD to be able to run their spawn-fcgi.


Top
   
 Post subject:
PostPosted: Wed May 13, 2009 11:08 pm 
Offline
Senior Newbie

Joined: Sat Apr 04, 2009 7:51 pm
Posts: 12
daskalou, I'm running PHP-FPM.

How much RAM should I allocate to PHP if I only have 360mb altogether?

I'm running WordPress-MU on nginx, MySQL and PHP.


Top
   
 Post subject:
PostPosted: Wed May 13, 2009 11:26 pm 
Offline
Newbie

Joined: Sun May 10, 2009 1:26 am
Posts: 3
I'm not sure how much RAM will be consumed by WordPress MU per FCGI instance, but we're using the Symfony framework (http://www.symfony-project.org/) - which is notorious for its bloat - and a PHP opcode cacher (XCache, APC etc.) and our FCGI processes each consume up to 40MB - 60MB of RAM (with about 1/4 - 1/3 in shared memory).

I would assume WordPress MU has been refined enough to be much less bloated than Symfony (although I could be wrong), so would probably consume a lot less RAM.

RAM usage per FCGI process would also depend on the maximum requests allowed per process (the lower the value, the less chance of memory creeping up).

How many FCGI child processes do you have running at any one time? With 360MB of RAM in total, you should probably set this low as well.


Top
   
 Post subject:
PostPosted: Thu May 14, 2009 12:48 am 
Offline
Senior Newbie

Joined: Sun May 18, 2008 8:52 am
Posts: 17
Website: http://www.arie-online.net
Yahoo Messenger: arie_wijayanto
Location: Indonesia - Bogor
it's nginx have options to limix connection per ip ?


Top
   
 Post subject:
PostPosted: Thu May 14, 2009 1:48 am 
Offline
Junior Member

Joined: Tue Jan 01, 2008 4:28 am
Posts: 32
arieonline wrote:
it's nginx have options to limix connection per ip ?


Here you go:

http://wiki.nginx.org/NginxHttpLimitZoneModule


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group