Answer the question
In order to leave comments, you need to log in
Why is the web server buggy (Nginx + php5-fpm)?
Hello. Until now, there was a bunch of Nginx + Apache2. Apache began to eat a lot of resources over time. I read a lot about the Nginx + PHP-FPM bundle, and decided to install it.
What is:
1) a site with 80k traffic per day
2) server config: 32GB RAM, 8 cores, SSD. Nginx 1.4.6, memcache, opcache enabled
After a long setup of fpm and nginx, the following configs are available:
Nginx:
site config pastebin.com/u6BVkQzC
main config : pastebin.com/viyWGkjU
FPM:
main www pastebin.com/Y7iEmndn pastebin
user config . com/QDkjxeNa
When I redirect the user flow to this server, in topphp5-fpm processes appear, and some load almost everything at 100%. Gradually, the response from the server from 60ms goes up to 2 seconds. Everything slows down and buggy. This is what is in the logs:
*an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/9/00/0000000009 while reading upstream
Answer the question
In order to leave comments, you need to log in
You are making requests to fpm via sockets, maybe you have a low limit on open files? ulimit in linux, by the
way, I got stuck with sockets and did it via tcp, attendance is several times higher than yours
try_files
fastcgi_pass
include fastcgi_params; + fastcgi_param in one location
ssi on;
error_log /dev/nullcrit;
access_log off
pm.max_children = 5
Reference assembly of "how not to do" and "why you should use apache" errors.
(in fairness, there is a hint of the correct configuration of fpm itself, but there are few processes and sockets are an ass).
Well and on a subject - model of disks in studio. Most likely they are the problem.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question