How can I handle high cpu usage on php7.0-fpm

0

1

I have one wordpress site on debian9 system with 64 GB memory and 12 core cpu (i7-8700) + nvme-ssd disk and 1 Gbit network. (https://www.hetzner.com/dedicated-rootserver/ex52-nvme)

And mariadb is on another server.

I desing my web server like this;

cloudflare (free service) -> varnish (:80) -> nginx (:8080) -> php7-fpm (socket). (same server)

I can handle 30-35 req/sec traffic. With load 10-12. But when the traffic arrive approximately 60 req/sec the sever load avarage arrives 70-75 and cpu usage by php-fpm. (In google analytic if the visitor count more than 3000 in "real time section")

I generally use half of total memory and I think iowait times is normal (I see 0.5 with top command).

My php-fpm config;

 pm = dynamic
 pm.max_children = 600
 pm.start_servers = 25
 pm.min_spare_servers = 10
 pm.max_spare_servers = 40
 pm.process_idle_timeout = 10s
 request_terminate_timeout = 60s

How can I handle this traffic? Do you think my hardware is enough ?

There are google analytics link below;

https://imgur.com/DeG0ajM

https://imgur.com/L1gBD1m

https://imgur.com/BPCLJx3

user66145

Posted 2019-04-18T11:46:21.437

Reputation: 11

No answers