• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Submitting my PHP FPM config for review and recommendations please!

zoldos

Basic Pleskian
Server operating system version
Ubunto 20.04 LTS
Plesk version and microupdate number
Plesk Obsidian v18.0.48_build1800221104.03
I run a fully dedicated Ubunto 20.04 server and a forum with around 60-70 members on-line daily (*not* all at once, but still a fair amount of constant activity). I'm looking to optimize my PHP FPM settings. Here's my server: Intel(R) Xeon(R) CPU E3-1230 v3 @ 3.30GHz (8 core(s), 32GB RAM, and PHP 7.4.33. Here are my dedicated FPM application served by nginx settings:

pm.max_children: 800
pm.max_requests: (Default)
pm: ondemand (Default)
pm.start_servers: 1 (Default)
pm.min_spare_servers: 1 (Default)
pm.max_spare_servers: Default

Is this good? I'm looking to speed things up, or at least provide a more robust setting to support higher activity.

Thanks!
 
pm.max_children: This will spawn up to 800 instances. As Apache can only handle up to 255 (which almost certainly bring the server down), I'd suggest to lower the value to something reasonable like maybe 50 the most. A typical value on servers with many websites would be even lower.
pm.max_requests: anything between 5000 and 15000 probably fits your system well.
 
I have just one website, a forum. I know it's probably overkill, but I got a good deal on it and love having full control.

Great, I will adjust the values. Are the other values okay? Thanks!

*Update: My forum seems to be responding faster!
 
Yes, the other values are o.k.

What you might look at is Nginx-only hosting (disable proxy mode). If you have no .htaccess file(s) in your forum, this can be done directly. If you are using .htaccess you'll need to convert the rules to Nginx syntax and add them to the "additonal directives" section in the Nginx configuration. The advantage von Nginx-only is the much higher speed and less load on the server. But it only works if the rule conversion was done correctly or if there are no special .htaccess rules.
 
How do I do that>
Yes, the other values are o.k.

What you might look at is Nginx-only hosting (disable proxy mode). If you have no .htaccess file(s) in your forum, this can be done directly. If you are using .htaccess you'll need to convert the rules to Nginx syntax and add them to the "additonal directives" section in the Nginx configuration. The advantage von Nginx-only is the much higher speed and less load on the server. But it only works if the rule conversion was done correctly or if there are no special .htaccess rules.
Yes I have an .htaccess. I'll check out the syntax conversion. Thanks!
 
One very non-obvious thing you might test out is your io performance from your vps. Sometimes you get a quite beefy vcpu and enough ram and you got also SSD /NVMe on your VPS but with limited IO. One of my vps is still such a machine and peaks! out at 75mbs reading or writing from disk.

dd if=/dev/zero of=/root/testfile bs=1G count=1 oflag=dsync

also, can the forum run on a non EOL PHP version, like php8?
Already using opcache, memcache and redis?
 
Yes, the other values are o.k.

What you might look at is Nginx-only hosting (disable proxy mode). If you have no .htaccess file(s) in your forum, this can be done directly. If you are using .htaccess you'll need to convert the rules to Nginx syntax and add them to the "additonal directives" section in the Nginx configuration. The advantage von Nginx-only is the much higher speed and less load on the server. But it only works if the rule conversion was done correctly or if there are no special .htaccess rules.
This didn't work. When I disabled Apache Proxy in the settings, and applied the new nginx directives, any subfolders went 404. My forum uses mod_rewrite. If I turn that off on my site, do you think it will work? Pretty sure I used the correct nginx settings (via the plugin you showed me).
 
One very non-obvious thing you might test out is your io performance from your vps. Sometimes you get a quite beefy vcpu and enough ram and you got also SSD /NVMe on your VPS but with limited IO. One of my vps is still such a machine and peaks! out at 75mbs reading or writing from disk.

dd if=/dev/zero of=/root/testfile bs=1G count=1 oflag=dsync

also, can the forum run on a non EOL PHP version, like php8?
Already using opcache, memcache and redis?
I run a fully dedicated server with PHP 7.4.33 (opcache and memcached) and a 2TB RAID HDD, Ubunto 20.04. I haven't tried PHP 8 yet, as not all parts of my forum are 100% compatible at this time.
 
Yes, the other values are o.k.

What you might look at is Nginx-only hosting (disable proxy mode). If you have no .htaccess file(s) in your forum, this can be done directly. If you are using .htaccess you'll need to convert the rules to Nginx syntax and add them to the "additonal directives" section in the Nginx configuration. The advantage von Nginx-only is the much higher speed and less load on the server. But it only works if the rule conversion was done correctly or if there are no special .htaccess rules.
*Update: I successfully removed my .htacess file after disabling fancy URLs and turned off Proxy mode. My forum seems noticeably faster! Thanks!!
 
When I disabled Apache Proxy in the settings, and applied the new nginx directives, any subfolders went 404.
That is the expected behavior unless you have nginx rewrite rules in place as described in
 
That is the expected behavior unless you have nginx rewrite rules in place as described in
It's working great now. I did have to adjust a few custom links to include index.php? but no worries. Thanks!!
 
Back
Top