Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:php:improve-performance [2016/08/05 15:28]
Jackson Zhang
litespeed_wiki:php:improve-performance [2019/07/12 13:07] (current)
Jackson Zhang
Line 1: Line 1:
-====== ​Improve ​site performance ====== +====== ​How to improve my site'​s ​performance ======
- +
-Is your site running slow? Are you going to run some performance/​benchmark test? There are some check points which may help to boost site performance dramatically. +
- +
-  * You should consider [[litespeed_wiki:​cache|LiteSpeed Cache Plugin]], which should make your site fly. +
-  * Try PHP 7 instead of PHP 5.x. PHP 7 claims to be twice faster than php 5.x. +
-  * You should install and enable PHP opcode cache.  +
-  * Check the real time stats for number of PHP processes during peak time(LSWS web admin -> Actions -> Real-Time Stats->​External Application),​ check  "In Use", "​Idle",​ "​WaitQ"​ . If WaitQ > 0 frequently, PHP max concurrency may need to be increased. For shared hosting environment,​ where PHP SuEXEC is normally used, then "PHP suEXEC Max Conn" needs to be increased. Check [[litespeed_wiki:​php:​concurrency|here]] on how to know if PHP SuEXEC is used and how to increase PHP max concurrency. +
-  * Upgrading to higher CPU LiteSpeed license should give more processing power +
-  * If the server has enough free memory, put PHP sessions, opcode cache disk storage under /dev/shm. If server I/O wait is high, enable AIO logging. +
-  * Check your "​top"​ output to find out the process using too much CPU/memory. It could be a buggy PHP code issue leading to the problem. +
-  * Mod_Security firewall check may slow down the server and sites. +
-  * CloudLinux LVE limit hit may impact the performance +
-  * And many more ... +
-   +
-Since the situation may vary so much case by case, we recommend to choose LiteSpeed premium support services for a professional review, fine running and install/​enable necessary elements to optimize your  server and maximize your site performance. Check our [[https://​store.litespeedtech.com/​store/​cart.php?​gid=5|hourly support here]]. +
- +
  
 +Is your site running slow? Are you going to run some performance/​benchmark tests? Here are some tips which should boost site performance dramatically.
  
 +  * You should consider using one of our **[[litespeed_wiki:​cache|LiteSpeed Cache Plugins]]**. These should make your site fly.
 +  * Try PHP 7 instead of PHP 5.x. PHP 7 claims to be twice as fast as PHP 5.x.
 +  * Install and enable PHP opcode cache. ​
 +  * Make sure PHP ''​xdebug''​ and ''​snmp''​ modules disabled if you don't need them. ''​xdebug''​ module is for Dev IDE integration only and should not be installed by default. ''​snmp''​ module will scan and parse available MIB files and not everyone needs snmp support. ​
 +  * Check the real time stats for the number of PHP processes during peak time(LSWS Web Admin -> Actions -> Real-Time Stats->​External Application),​ check "In Use", "​Idle",​ and "​WaitQ"​. If WaitQ is frequently higher than 0, the PHP max concurrency setting may need to be increased. For shared hosting environments,​ where PHP SuEXEC is normally used, **PHP suEXEC Max Conn** needs to be increased. See our **[[litespeed_wiki:​php:​concurrency|PHP Concurrency wiki]]** for more information on determining if PHP SuEXEC is used and how to increase the max concurrency of PHP.
 +  * If you see something like: **[STDERR] Reached max children process limit: 10, extra: 3, current: 13, please increase LSAPI_CHILDREN**,​ try to increase LSAPI_CHILDREN.
  
 +  * Upgrading to a higher CPU LiteSpeed license should provide more processing power.
 +  * If the server has enough free memory, put PHP sessions and opcode cache disk storage under /​dev/​shm. ​
 +  * If server I/O wait is high, enable AIO logging.
 +  * Does the domain hit CloudLinux LVE IO Limit? Use ''​lvetop''​ to verify if IO is reaching the defined maximum (xMB/​s). ​
 +  * Have you enabled the timezonedb module for your PHP? We do see poorer performance when people move to a cloud server with shared storage, the I/O latency could cause trouble. Without PHP timezonedb module with built-in DB, it may not have a huge impact on a server with the local disk but it will be very costly for a cloud server with shared storage since PHP will scan hundreds of directories.
 +  * Check your "​top"​ output to determine which processes are using too much CPU/memory. Buggy PHP code could be causing these performance issues.
 +  * For cpanel/WHM user, disable PHP open_basedir feature.
 +  * Mod_Security firewall checks may slow down the server and sites.
 +  * Hitting your CloudLinux LVE limits may negatively impact the server'​s performance.
 +  * Are Bandwith throttlings enabled for your virtual host to slow down the sites?
 +  * Is the speed of your network card a bottleneck?
 +  * Are your server kernel settings configured for high traffic?
 +  * Is your site under attack?
 +  * SSD is a must. You should not run on a server with a regular hard drive.
  
 +Addressing any of the above may improve the performance of your server. However, performance issues may be related to something entirely different. Your situation may vary greatly, because of this, we recommend ordering our **[[https://​store.litespeedtech.com/​store/​cart.php?​gid=5|LiteSpeed premium support service]]** for a professional review, fine tuning, and installation/​enabling of necessary elements to optimize your server and maximize site performance.
  • Admin
  • Last modified: 2016/08/05 15:28
  • by Jackson Zhang