• 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

Issue High traffic, slow website. are my PHP settings correct?

Coopsy

Basic Pleskian
Server operating system version
Ubuntu
Plesk version and microupdate number
20.04.5 LTS
Hi there, please can someone help. I run a competition/raffle website on my Plesk server and at 8:30 this morning, my customer put on a prize of £20,000 and all of a sudden my server just spiked and all of my websites on my Plesk ran very slow and sluggish. very high CPU php-fpm - obs i dont want this to happen again and i so have (i think) a good server. please can some one advise if the PHP settings are correct and "efficient"? screen shots included
 

Attachments

  • graph.png
    graph.png
    39.7 KB · Views: 30
  • php settings.png
    php settings.png
    217.7 KB · Views: 31
  • server.png
    server.png
    7.8 KB · Views: 27
Maybe you can disable "Proxy mode" in your Apache & Nginx settings and then choose PHP-FPM via Nginx. This will most likely speed things up. Also for systems under high load you should carefully examine how much time each and every individual function in your scripts are consuming. Frequently there are loops with unnecessary operations or slow PHP commands that can be replaced with fast functions. Regarding your PHP settings: Why do you need a max_execution time of five minutes for an individual script? That seems to be awfully long. Why not stop a script at a much shorter time like a few seconds? Also, if your scripts need 600 M of RAM per script run, something must be terribly wrong with that. So probably it all burns down to a detailed analysis what the website scripts are really doing and to optimizing them.
 
Maybe you can disable "Proxy mode" in your Apache & Nginx settings and then choose PHP-FPM via Nginx. This will most likely speed things up. Also for systems under high load you should carefully examine how much time each and every individual function in your scripts are consuming. Frequently there are loops with unnecessary operations or slow PHP commands that can be replaced with fast functions. Regarding your PHP settings: Why do you need a max_execution time of five minutes for an individual script? That seems to be awfully long. Why not stop a script at a much shorter time like a few seconds? Also, if your scripts need 600 M of RAM per script run, something must be terribly wrong with that. So probably it all burns down to a detailed analysis what the website scripts are really doing and to optimizing them.
thanks. is it this one once disables proxy ?
 

Attachments

  • php.PNG
    php.PNG
    41.4 KB · Views: 24
thanks. is it this one once disables proxy ?
That is changing PHP processing to Nginx. You should still also remove the "Proxy mode" checkmark from the checkbox in "Apache & Nginx settings", so that everything is aways handled by Nginx instead of Apache.
 
499 is a non-standard error that is specific to Nginx. Most often it means that the web server runs into a timeout because it does not get a proper response from a script. You'll need to understand what your scripts are doing and why they are not working properly with Nginx. I suspect that in addition to the default Wordpress Rewrite rules in an .htaccess file a plugin requires more rewrites. If so, you have to translate these Apache .htaccess rules into Nginx syntax and add them into the "Additional Nginx" instructions in "Apache & Nginx settings" (similar to the rules that need to be added to avoid the 404).
 
Back
Top