Open jospoortvliet opened 8 years ago
php-fpm optimized configuration file should probably look like this (from here):
[site]
listen = 127.0.0.1:9000
user = site
group = site
request_slowlog_timeout = 5s
slowlog = /var/log/php-fpm/slowlog-site.log # consider just sending to /dev/null
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 9
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.max_requests = 200
listen.backlog = -1
pm.status_path = /status
request_terminate_timeout = 120s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes
env[HOSTNAME] = $HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
The apache conf to enable fpm:
# nano 05-php.conf
<IfModule proxy_fcgi_module>
<Proxy "unix:/var/run/php.socket|fcgi://php-fpm" timeout=300>
</Proxy>
</IfModule>
<Directory "/path/to/web/root">
<IfModule proxy_fcgi_module>
<FilesMatch \.php$>
SetHandler "proxy:fcgi://php-fpm/"
</FilesMatch>
</IfModule>
</Directory>
pm.max_children = 75
Maybe more like 10 given the RAM restrictions, but we'll tune that later
@jospoortvliet - I think one issue per item would work best if we want other people's optinon. Just use this one to track the overall progress.
Tune httpd.conf (/etc/httpd/conf/httpd.conf):
StartServers 1
MinSpareServers 1
MaxSpareServers 5
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 5000
@oparoz how about just creating PR's for each, linking them in the initial post and discussing the details there :dancer: like https://github.com/kyrofa/owncloud-snap/pull/23 and https://github.com/kyrofa/owncloud-snap/pull/22
The web has some tips on performance tuning. Among others:
Much of this is to be changed in this file