Sorry, I am new and deleted my question thinking I had posted some info I should not have. I am posting the edited question once again:
In our website, php5-fpm takes care of the php calls made by the browser We have received a lot of outages/504s lately. Now, I checked the php5-fpm logs to correlate with the timestamps of 504 in - our access logs and this is what I got in the php5-fpm logs:
WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
Please observe that the php5-fpm was not able to handle the connections since it has a current limit of pm.max_children setting set only to 5 (Please see below) and is way too less based on our workload:
unknown@xxxx:~# cat /etc/php5/fpm/pool.d/www.conf | grep "pm.max_children =" pm.max_children = 5
My question is, how do I calculate the new value? I have 4 GB of RAM and the DB is running on a diff server.