rasodu / DLEMP

0 stars 0 forks source link

Adjust phpfpm settings #82

Open rasodu opened 7 years ago

rasodu commented 7 years ago

PHPFPM container don't perform well when page rendering takes long time.

php-fpm.conf


pm = static pm.max_children = 100

pm = dynamic pm.max_children = 70 pm.start_servers = 20 pm.min_spare_servers = 20 pm.max_spare_servers = 35

pm = ondemand pm.max_children = 5 pm.process_idle_timeout = 10s pm.max_requests = 200


pm.max_requests = 500

rasodu commented 7 years ago

pm = static pm.max_children = 20 (Basic Laravel at php 7 is using around 6mb. Will will target each phpfpm container to use 256mb. You can spinup more containers if you have more ram available. We will use around 128mb for php thread and leave another 128mb of the ram for the code in container)

Assume that Laravel will leak around 1kb ram on each request. We will let around 1mb of memory to leak on every child.

pm.max_requests = 1000