3

I am using ubuntu 15.04 in my dedicated server with 40 cpu cores and 160GB of RAM with one heavy traffic wordpress site running. I am using Nginx as the webserver and varnish as the cache server. My php5-fpm.conf setting is:

listen = 127.0.0.1:7654
pm = dynamic
pm.max_children = 500
pm.start_servers = 80
pm.min_spare_servers = 20
pm.max_spare_servers = 160
pm.max_requests = 1000

But it is still showing the error:

[pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 17 idle, and 92 total children

WARNING: [pool www] server reached pm.max_children setting (200), consider raising it

I have tried increasing the numbers but still no luck. The memory used by one children is neary ~75MB. How can I figure out the best configuration for my php?

uvishere
  • 151
  • 1
  • 7

2 Answers2

2

Generally I've found the best solution to using php-fpm in 'ondemand' mode. This seems to be much more memory efficient, less prone to memory leaks, and scalable. Would suggest along the lines of:

pm = ondemand
pm.max_children = 50
pm.process_idle_timeout = 10s
pm.max_requests = 500

max_children will need tuning to your environment. It's very much memory related, e.g. if an FPM process is going to consume 64MB, and you only have 2GB memory, you're only going to get 20-25 fpm processes before you start becoming memory constrained.

So calculate this value based on your memory, leaving some room for OS, and other services if this isn't a dedicated application server.

elliotp
  • 386
  • 1
  • 6
  • 18
2

dedicated server with 40 cpu cores and 160GB of RAM with one heavy traffic wordpress site running

That's a really weird configuration for such a service.

We cannot advise how to fix the problem because you've not told us what the problem is. Most likely it would take a competent engineer at least a day to gather sufficient data to identify the bottleneck(s) and then longer to work out how best to address the constraint. Posting such a volume of research here as a question would be off-topic.

Capacity planning is off topic.

How can I figure out the best configuration for my php?

Learn about performance management and tuning. Make educated guesses as to the cause. Apply incremental changes. Measure the impact.

symcbean
  • 19,931
  • 1
  • 29
  • 49