Nginx & MySQL - resource question
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?
10 Replies
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:
events {
worker_connections 512;
}
http {
keepalive_timeout 60 55;
}
Did you write it ?
that's the bene gesserit litany against fear, from frank herbert's dune series.
For a FastCGI backend, I recommend one of two options:
1. If you're compiling PHP on your own then go for PHP-FPM (
2. If you (like me) install PHP using ready-to-go RPMs for your distro, then use the spawn-fcgi released by LightTPD (
How much RAM should I allocate to PHP if I only have 360mb altogether?
I'm running WordPress-MU on nginx, MySQL and PHP.
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.
@arieonline:
it's nginx have options to limix connection per ip ?
Here you go: