Welcome! Log In Create A New Profile

Advanced

Nginx PHP-FPM understanding

Posted by plopes 
Nginx PHP-FPM understanding
January 07, 2016 07:50PM
Hi there,

I'm new on this business and i'm setting a new server for a API that receive a lots of requests. I'm using Forge (from Laravel, but in this case i'm using Lumen) and i started to read and follow many tutorials to get better performance.

The server it's a 16GB RAM with 8 CPU cores from Digital Ocean. I used siege and ab for testing and i think the server is handling a lots requets/s (10k) but when i do the testing even with 25 concurrent users, the response time increase a lot (i've the website in dev pointing to this new server, and watching the ajax requests). I noticed by using htop that the CPU's are all working but the RAM is only using 2GB.

I've changed the open file limits and some systemctl tweaks and switched from php-fpm.sock to unix sock. My general configs are:

nginx.conf
worker_processes auto;
pid /run/nginx.pid;
worker_rlimit_nofile 999999;
events {
worker_connections 65000;
multi_accept on;
use epoll;
}

php-fpm pool.d conf:
pm = dynamic
pm.max_children = 100
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 20

php.ini
memory_limit = 1024M (i increase this but i didn't saw any effects)

I would appreciate any help/suggestion to get better performance on the response of the php processing or any good reading about this.

Thanks for the help,
Pedro Lopes
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 121
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready