• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Need advice on best PHP/Apache settings for best performance

KZM

Basic Pleskian
Hi folks:)
I need advice on what could be possible a good configuration for my VPS (RAM 8 GB, Processor(s)4). running on Ubuntu 18.04.6 LTS
I run Plesk (latest), Apache 2.4. PHP 8. This server hosts 16 WP websites. Lately, however, I have been experiencing huge resource usage which as a result crashes the server (CloudFlare error 522). I also use Cloudflare.

Now the actual question: is it for the above better to use FAST CGI server by Apache, PHP-FPM served by Apache or PHP-FPM served by NGNIX and/or switch from MPM module prefork to MPP event?
 
Have you seen the new dedicated PHP-FPM handlers?
I've been testing it out and the results were amazing for Wordpress sites. Much, much faster.
They will also have their own seperate Opcache which speeds everything up.

In my experience I've seen big Wordpress sites eat up all the Opcache memory, which would starve the other sites and result in cache restarts... destroying performance.
 
PHP-FPM served by NGNIX is usually a good option but if you're having the VPS OOM (Out of Memory) Have you installed something like atop, then checked the atop logs before the server dies. You may find one of the sites is getting hit quite hard with requests and Apache/NGINX is getting overwhelmed.
 
Here´s my recipe for WP:
I use PHP-FPM for Nginx, not using Apache,
In the WP I use Super Cache plugin with Expert Option and stop regenerating the cached pages, also setup the corresponding rules for Nginx.
I setup Nginx rules for caching static archives ( not the one Plesk has now, simple nginx rules for expires and some other headers) and configure Cloudflare to respect headers ( that way CF caches images, css and js the amount of time I decide )
That way WP still creates the pages for the first visitor, but gets cached in the server, so the next visitor gets the page FROM NGINX not even using PHP.
HUGE AMOUNTS of resources liberated.
And the TTFB ( Time To First Byte ) goes down awesomely going from tipically somepleace between 1 or 2 seconds ( the time that PHP creates every page for WP ) to a range of 110ms to 700ms ( the time Nginx takes the cached file and sends it tho the visitor )
There's a limit of concurrent clients PHP can have ( tens but not hundreds ) but Nginx can manage a lot more on static files ( hundreds to thousands )
More visitors, faster site, lower load.
I have a 8 core server with 32 RAM with over 100 domains and at least about 20 active WP, super active mail server.Load rarely goes over 3
 
Back
Top