Easily configure a performant, secure, and stable NGINX server.Learn More
Having problem with Php fpm
Ok My site is working fine but when the number of visitors increases it breaks suddenly.To find out why it breaks I have been observing the behaviour of my server using the ‘htop’ command.
Using 'htop’ I noticed that whenever the second value in the figure,
code Tasks 136 , 100 , 2 running
reaches 166 my site breaks,I get something like “ 502 Gateway error” .The problem seems to be not coming from RAM because the RAM usage is just 4 to 5 GB but I have 16GB RAM.And also the CPU usage never reaches 100%.So where is the problem coming from? can anyone help me please!
My Server is information:
16GB RAM, 320 GB storage , 6 CPU
My NGinx configuration is :
worker_processes 6; worker_connections 2000;
My PHP fpm configuration is :
pm = ondemand pm.max_children = 100 pm.start_servers = 18 pm.min_spare_servers = 9 pm.max_spare_servers = 18 pm.process_idle_timeout = 10s; pm.max_requests = 500
Am I missing something,I also use WP Super cache!!
Any help will be grateful,thank you in advance.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×