PHP-FPM nightmares

Well, I guess it wasn't enough
Code:
[19-Nov-2020 05:58:07] WARNING: [pool xxx] server reached max_children setting (46), consider raising it
Now changed to 100 🤷‍♂️

Now the user's fpm.conf is
Code:
pm = ondemand
pm.max_children = 100
pm.process_idle_timeout = 20
pm.max_requests = 500
Maybe the timeout needs lowering........

<Lucky I'm already bald, or I would be by now>
Seems like a very busy website, you may consider proposing your customer to move to a dedicated VPS with a lot of RAM, since this one website may impact your other websites on this server as well.
 
It's the only site on the bloody server!

Intel Xeon E3-1270v6 8 Core - 32GB DDR4 ECC 2400MHz...... If this doesn't run 1 site, what will?!

I actually got a dedicated server for just this site....... I'm running out of ideas.......

I bet it's crappy WordStress at fault........Hate it...... People should learn to code what they need instead of using WordStress and bloating the hell out of it with 100+ plugins.......
 
Last edited:
Set max.children as high as possible and add more RAM if needed, that should fix at least this issue.
 
More ram is not an option I'm afraid.....

(Sorry to rant above.... I just wish people didn't rely on pre-made scripts, and just think it'll work without a hitch, then rant at the host when it breaks...... Yes, I use a pre-made script, for my hosting billing and support system, my website is just php + mysql, nothing else)
 
Without knowing the output of the cmd I sent yesterday.

I would set max child some where between 82 and 220

set the time out to 10

and max request to 1000
 
Here is top.... MySQL tends to go way over 100% CPU a lot....... Load tends to be 3 to 4.

Note: The client told me he has installed a php chat, so, I guess this is adding to the strain......... We all know WordStress plugins can be badly coded...
 

Attachments

  • server10top.jpg
    server10top.jpg
    182.6 KB · Views: 17
Here is top.... MySQL tends to go way over 100% CPU a lot....... Load tends to be 3 to 4.

Note: The client told me he has installed a php chat, so, I guess this is adding to the strain......... We all know WordStress plugins can be badly coded...
Yeah humm. It would require a lot of data to recommend a server. It might be the server you have isn't powerful enough. Since it is a forum site you might better need to understand concurrent users, applications, file sizes (images) and peak times.

Chat is very intensive process. I have had sites turn that on and cripple the entire server. So you might need to recommend them buy a much more powerful server.

Forums and chat services are not like running a website its very intensive.

However based on The numbers you gave for PHPFPM.

You have total of 32,768 ram to assign to the entire server.
If you could assign all of the ram to PHPFPM max_child would max the box out set at 381 < Setting this would cripple the server.
If we wanted to set half of all the ram to PHPFPM max_child would be 190
If we wanted to set quarter of all the ram to PHPFPM max_child would be 95
If we wanted to set a fifth of all the ram to PHPFPM max_child would be 76

You might consider changing to dynamic instead of ondemand

Here is a good video about how it all works.

What does show?
Code:
tuned-adm active
Current active profile: throughput-performance

If this is a dedicated server it should set to throughput-performance

Other things to consider would be moving to MariaDB 10.4 or higher
Using nginx_apache instead of just apache.

Just some more thoughts.
 
I dont have tuned-adm installed....

Every time I touch MySQL (eg. upgrade), it always spouts out errors from experience, I don't need more headaches.........

I do think whatever we set max_children to, I guarantee it'll be reached in no time.

eg. (1024*32)/93=352 max_children (the ps command now states 93MB)

What would nginx proxied do though, if all this could be a fpm issue?
 
Last edited:
ATOP/IOTOP/IOSTAT - what causes WA 4.5 when CPU load just 3,5.
Maybe this is a disk problem? looks like it's not NVME, maybe at least this is 2 SSD (1 for home, 1 for mysql)
 
ATOP/IOTOP/IOSTAT - what causes WA 4.5 when CPU load just 3,5.
Maybe this is a disk problem? looks like it's not NVME, maybe at least this is 2 SSD (1 for home, 1 for mysql)
SSD's are not cheap, and less sized.... 240GB....

Bare in mind, I am meant to be a "budget" provider, and rent my servers.
 
2 x 1TB SATA in RAID
install IOTOP, use left/right arrows to move between columns and check what loads disks more, or you can use ATOP. I see that You have free 10Gb ram, so you can use it for caches to decrease disks load.
 
Is there a way to see how long a fpm process takes? As the client states that sometimes when they are in the WordPress backend doing something, it'll stall for a hefty amount of time, hence why Cloudflare (might) issues the 524 error, what could take over a minute to execute is a bit extreme, no?
 
Try to enable slow_query_log for MySQL/MariaDB and see if there is a specific query that is frequently running very slow.

Code:
slow_query_log = 1
slow_query_log_file = /var/log/mysql-slow-queries.log
long_query_time = 10

Wordpress is usually blazing fast by itself. What usually slows it down are:

1. Crappy themes
2. Crappy plugins

One guy had a rarely accessed automobile parts selling site with Woocommerce which was deadly slow. Changing the theme made it super fast instantly. I've seen that with a plugin before too.

As for my opcache stopping proposal from above - it was my specific experience. Running 300+ websites on my server makes it invalidating files too often and I was having no real benefits from it. My main issue is not CPU or memory, but mainly disk operations (the server was struggling with HDD usage until I moved to SSD). Setting validate_timestamps to 0 made a bit of a speedup; however some users were angry about it.

I am not saying opcache is bad. It is good, especially if you are running a single site. Still - stopping and testing doesn't hurt.
 
I still think all this boils down to something iffy in WordPress, but, hey, I've ridiculed it enough. 🤷‍♂️

This client has been with me years........ The site ran fine in an OpenVZ CT until 2 years ago.... That's when the problems started
 
Back
Top