I am configuring a server for a friend.The server has the following specs
8GB RAM
Quad Core processor
1 TB HDD
100 mbps port
However all php files are loadking very slowly.I did a speedtest and server takes 16 secs to Load FIRST byte.I strongly believe its my php-fpm configuration.Server uses nginx and php only , no mysql etc...
My current php-fpm configuration
pm.max_children = 50
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 35
Server load and ram usage are perfectly fine
Please suggest me a good configuration for this server
UPDATE:
This configuration works fine
pm.max_children = 20
pm.start_servers = 7
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 100
The problem with first byte load time is solved.However after like 15-20 hours First byte load time increase gradually. I have to reload php-fpm to get small load time Based on my conf above what i modify to it so that first byte load time remain small and i don't have to restart it:P
UPDATE 2: Before i restarted the php-fpm Time to load first byte: 1.5 sec Total page load time :3.0 sec Time after i restart php-fpm Time to load first byte: 0.3 sec Total page load time :1.5 sec
This clearly shows its a matter of php-fpm configuration , not of slow code