Answer the question
In order to leave comments, you need to log in
Why is the site slow?
There is a site with attendance of 1700 visitors per day, on average online 18, the yii engine on the server is a bunch of nginx + php-fpm. It opens very slowly, I thought I rewrote it anyway, the speed didn’t increase much, I tried to copy the site files and run on behalf of another ssh user, another pool fpm (or as it’s called in the configs, I specify a different port,) I change the fastcgi_pass port 127.0.0.1:9001 on fastcgi_pass 127.0.0.1:9002 and run in parallel with another domain, everything works fast. Where to set up so that there is no heavy load?
here is the site pool
[site.ru]
listen = 127.0.0.1:9001
user = site
group = site
listen.owner = site
listen.mode = 770
chdir = /home/site/data/
pm = ondemand
pm.max_children = 4
Answer the question
In order to leave comments, you need to log in
Turn on the debug panel in yii2 and see what is being processed slowly.
listen = 127.0.0.1:9001
[site.ru]
listen = /var/lib/php5-fpm/siteru.sock
listen.owner = site
listen.group = site
listen.mode = 0660
...
location ~ \.php$ {
...
fastcgi_pass unix:/var/lib/php5-fpm/siteru.sock;
...
}
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 500
; Перенаправлять вывод процесса в лог
catch_workers_output = yes
; Если скрипт выполняется больше указанного времени, писать отладочную информацию в slowlog
request_slowlog_timeout = 3
; Лог-файл для медленных запросов
slowlog = /var/log/fpm-php/siteru.slow.log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question