Nginx and PHP-FPM Configuration and Optimizing Tips and Tricks - Comment Page: 6
I wrote before a guide Howto install Nginx/PHP-FPM on Fedora 29/28, CentOS/RHEL 7.5/6.10, but this guide is just installation guide and many cases Nginx and PHP-FPM basic configuration is good enough, but if you want to squeeze all the juice out of your VPS or web server / servers and do your maintenance work little bit easier, then this guide might be useful. These tips are based entirely on my own experience, so they may not be an absolute truth, and in some situations, a completely different configuration may work better. It's also good to remember leave resources for another services also if you run example, MySQL, PostgreSQL, MongoDB, Mail server, Name server and/or SSH server on same...
168 comments on “Nginx and PHP-FPM Configuration and Optimizing Tips and Tricks - Comment Page: 6”« Previous 1 … 4 5 6
If i have a 10 K concurrent user , and 8 core server process .. request size is about 4 KB , and response size is about 20 KB ,
what is the best configuration should i use .. and please how I could calculate values based on requests per server ( with nginx load balancer ) , cores and ram size
If php-fpm and nginx are the same box, it might be better to use the socket approach (better performance, no tcp overhead)
pm.start_servers = 3
pm.min_spare_servers = 2
does not make sense
Why it doesn’t make sense? It’s PHPs default value! Check:
PHP-FPM pm.start_servers default value is:
min_spare_servers + (max_spare_servers – min_spare_servers) / 2
Thanks for Gre8 and useful information.
im experiencing Very hige cpu load,
i have 16Gb of ram and 6cpus ,
but everytime i have high traffic on my site some of the pages get nginx error 500
Could you tell more how much traffic you have, what configs you are using and do you run some custom site? And what cause high cpu load, nginx or php-fpm?
Hi We have 10 GB data to be synchronized between moodle and wordpress. When I try to synchronize, it shows error: 504 Bad Gateway TimeOut. Please guide. What should be memory parameters in nginx and php-fpm.
What method you are using to synchronize this data? It sounds like a really long and heavy operation over the HTTP protocol. Is it possible run on server (using php-cli)?
hi, thanks for this tips, i follow them and i have a better performance, but i have some troubles on concurrency, in the load testing almost, all request are failing, can i send you the config files?
Nice to hear that you find this helpful and of course you post config files and please tell also your server(s) specs.
Thanks a lot for these good described tips!
> cat /proc/cpuinfo |grep processor
is the hard way to do that, all you need is
grep -c ^processor /proc/cpuinfo
im getting the 499 status in windows environment
127.0.0.1 – – [03/May/2019:15:52:32 +0000] “POST /store.php HTTP/1.1” 499 0 “-” “-”
how ill fix this
I find this helpful. Thanks for sharing.
Thanks for the tips, NGINX optimization is crucial in such cases.
I have high CPU usage.
Site at the most 100 concurrent users.
pm.max_children = 20
pm.start_servers = 8
pm.min_spare_servers = 4
pm.max_spare_servers = 12
pm.max_requests = 500