April 04, 2011 05:55PM
I have set up an installation of Nginx + PHP-FPM. I'm wondering what are the "best configuration for production" would be to make best use of resources without overloading the server. I'm interested in these situations:

1) Dedicated site with one user (1 PHP-FPM pool total)
2) Shared virtual host environment (+1 PHP-FPM pool per user)
3) #1 or #2 with / without MySQL on the same server (How much should MySQL be allotted memory wise? Thinking about using v 5.5.)

Beyond that I know that this will be relative depending on your hardware (cpu, memory, etc...). But how would you determine this, other than trial and error?

What I'm particularly interested in set (nginx config) worker_processes, worker_connections, (php-fpm config) pm.max_children, pm.start_servers, pm.min_spare_servers, and pm.max_spare_servers.

I'm assuming that worker_processes is set to the number of cores, and worker_connections is supposed to be `ulimit -n` / worker_processes (really need to confirm that part). If MySQL or other servers are installed, do you want to set worker_processes to the number of cores, or should it be less than that?

With PHP-FPM, assuming PHP's memory is set to 128MB (good number?), what should be set to for each pool (assuming pm is dynamic)? Should pm.max_requests even be used?

What options are there as far as load balancing techniques with dynamic content (php) verses static content (with 1 site)? Proxy? Non-proxy? Different servers for PHP backends? Roll over to different Ngnix? ...????

Does removing certain modules from compile time make Nginx more efficient (ones you don't use), or does it just matter how the server is configured?

What do you use memcached support for on Nginx as apposed to PHP?
Subject Author Posted

Best configuration for production?

lukescott April 04, 2011 05:55PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 324
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready