php-fpm + nginx server configuration

129 Views Asked by At

I get POST Content-Length of 70116320 bytes exceeds the limit of 52428800 bytes on my nginx error.log
so I changed post_max_size from 8M to 128M (php.ini) but I get 502 Bad Gateway on my web apps.
When I check php-fpm.log, I get [pool www] child 3328525 exited with code 70 after 319.595594 seconds from start.
Then, I tried to change max_execution_time (www.pool) from 300 to 600, but it didn't work.
Then I tried to change the post_max_size from 128M to 50M and it works (there's no 502 Bad Gateway).
But, I need to change post_max_size more than 50M (I wish it can be 128M, because the data is large) with no 502 Bad Gateway.

My questions is:

  1. When I changed post_max_size parameter, then what others parameter should be adjust to get best result?
  2. What should I do when I want to do php-fpm + nginx configuration tuning?
  3. What is the maximum size of those parameters?

Thank you, maybe you guys can help my case..

1

There are 1 best solutions below

2
Ken Lee On

You need to change BOTH the max_execution_time and post_max_size to suit your needs

Reasons:

  1. Posting data to server requires time. If you have changed the post_max_size to a large value and then send large amount of data (say uploading a big file) by post, it requires longer time. (hence need to adjust max_execution_time)

  2. There is no such thing as max_execution_size

Make sure your system resources can handle it (without adverse effect) on what you have set