This is an old revision of the document!


My server load is high, how to resolve it?

If you server load is high ( when you server load is < = number of your CPU Cores, it is quite normal), you need to find out the bottle neck and make optimization targeting the bottle neck.

  • It is always good practice to use “top” command to check which processes are taking a lot of CPU resources and figure out weather they are normal.
  • If disk I/O is high, you should fix the disk I/O problem. If you have more free memory available, you can move php sessions to /dev/shm.
  • Check the CPU idle percentage. If it is close to 0%, then it is CPU bounded, you should try to reduce the CPU usage.
  • Try to use LSCache solutions to lower the load.
  • Enable PHP opcode cache.
  • 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”. For shared hosting, if one user uses too many PHP processes while others only use a little, you may adjust PHP max concurrency setting to be smaller number. See our PHP Concurrency wiki for more information on determining if PHP SuEXEC is used and how to reduce the max concurrency of PHP.
  • Check the number of concurrent users to see if it is normal: netstat -na | grep 80 | grep ESTA
  • For control panel users, check your php configuration between Apache and LiteSpeed to make sure they have matching PHPs.
  • Sometimes it is due to poorly written PHP/SQL code and has to be fixed by your PHP Developers. Sometimes it is mysql problem, for example, missing index, you may try to use mysqladmin and processlist to check what happened. No web server configuration change can help such situation and they are beyond our support scope. You can even use strace to track your PHP processes: strace -tt -T -p <pid_of_a_php_process>
top - 15:28:56 up 1 day, 17:58, 3 users, load average: 187.42, 143.52, 109.09
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25713 mysql 20 0 15.3g 784m 9.9m S 197.1 0.9 29:13.90 /usr/sbin/mysqld --basedir=/usr --  datadir=/var/lib/mysql --plugin-
30260 roan24pl 20 0 302m 103m 12m R 34.4 0.1 1:37.47 lsphp:/home/roan24pl/public_html/index.php
30448 roan24pl 20 0 302m 103m 12m R 26.0 0.1 1:09.17 lsphp:/home/roan24pl/public_html/index.php
30217 roan24pl 20 0 302m 102m 12m R 25.0 0.1 1:27.36 lsphp:/home/roan24pl/public_html/index.php
28755 roan24pl 20 0 291m 92m 12m R 24.0 0.1 6:52.65 lsphp:/home/roan24pl/public_html/index.php

Addressing the above may lower your server load. However, Your situation may vary greatly. We recommend ordering our LiteSpeed premium support service for a professional review, fine tuning, and installation/enabling of necessary elements to reduce your server load and maximize site performance.

  • Admin
  • Last modified: 2016/09/19 18:01
  • by Jackson Zhang