lsphp5 high load cpu

#1
Hi,

I installed Litespeed Enterprise 1 CPU for my server.

Load Averages: 4.44 4.25 4.31

There is top on my server:


How can i make lsphp5 (Lsws) use low cpu?

Regards,
 

NiteWave

Administrator
#2
the "Process Manager" looks interesting, what platform are lsws running on ?

actually, this is typical on a busy shared hosting server, which mainly run php/mysql applications.

to reduce the load of php (or lsphp):
1. install and enable eAccelerator opcode cache;
2. monitor and identify high CPU usage accounts(like this Process Manager), trace the process, and ask the user to improve the php code, to remove low performance plugin etc ...

you can show the real-time stat at busy time(high load), see if we can give some suggestion for you.
 
#3
Hi,

cPanel (not opcode cache) + Litespeed
PHP 5.3.27 (cli) (built: Oct 1 2013 00:46:27)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH
Thank you for support. Can you teamviewer to me? Then you can see real-time my server working. If can, i gived id and password of teamvewer 8 to your inbox.

Regards,
 
Last edited:

NiteWave

Administrator
#4
please run EasyApache to include eAccelerator(disable XCache), since eAccelerator is suitable for shared hosting environment.

then build matching php in WHM/litespeed plugin

after you've done above 2 steps, I can ssh to your server to monitor the load and help tune setting of eAccelerator.
 

NiteWave

Administrator
#8
checked, eAccelerator is enabled now. I changed
eaccelerator.shm_size="16" to
eaccelerator.shm_size="1"
and comment out
zend_extension="/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"
in /usr/local/lib/php.ini

#top -c
top - 14:44:25 up 1 day, 13:48, 2 users, load average: 4.10, 4.46, 5.04
Tasks: 317 total, 6 running, 310 sleeping, 0 stopped, 1 zombie
Cpu(s): 15.9%us, 2.3%sy, 0.0%ni, 75.9%id, 5.7%wa, 0.1%hi, 0.2%si, 0.0%st
Mem: 7022024k total, 5943692k used, 1078332k free, 417232k buffers
Swap: 16383992k total, 526148k used, 15857844k free, 2612352k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9041 phimgcco 20 0 261m 45m 9680 R 28.5 0.7 0:00.88 lsphp5:/home/phimgcco/public_html/index.php
8870 phimgcco 20 0 235m 25m 9496 S 18.6 0.4 0:05.69 lsphp5
9019 lxwap 20 0 233m 23m 9472 S 18.6 0.3 0:01.20 lsphp5
8718 waplxmob 20 0 252m 41m 9396 S 17.2 0.6 0:05.71 lsphp5
9050 phimgcco 20 0 235m 25m 9468 S 15.9 0.4 0:00.48 lsphp5

the load is 5+ when I did ssh login, the response was slow from time to time. now the response became faster on command line and load dropped a bit.

please monitor a bit longer ... the eAccelerator should have done some good for your server.
 
#9
top - 15:13:36 up 1 day, 14:17, 2 users, load average: 8.79, 8.18, 6.92
Tasks: 350 total, 2 running, 347 sleeping, 0 stopped, 1 zombie
Cpu(s): 41.3%us, 7.7%sy, 0.0%ni, 36.0%id, 13.9%wa, 0.1%hi, 1.0%si, 0.0%st
Mem: 7022024k total, 6179004k used, 843020k free, 406848k buffers
Swap: 16383992k total, 528784k used, 15855208k free, 2303208k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2706 mysql 20 0 6721m 1.4g 6004 S 39.4 20.2 157:45.18 /usr/sbin/mysqld --
15736 waplxmob 20 0 252m 42m 9380 S 32.7 0.6 0:04.41 lsphp5
15836 vuithich 20 0 245m 32m 9416 R 26.8 0.5 0:05.79 lsphp5:e/vuithich/p
17379 vuithich 20 0 234m 24m 9412 S 26.8 0.4 0:00.81 lsphp5
16867 phimgcco 20 0 256m 41m 9424 S 26.1 0.6 0:01.97 lsphp5:/home/phimgc
16651 vuithich 20 0 250m 37m 9412 S 23.2 0.6 0:01.95 lsphp5
17003 waplxmob 20 0 251m 40m 9344 S 22.5 0.6 0:02.18 lsphp5
I see my server still high load. What exactly make high load?
 

NiteWave

Administrator
#10
first, the load is not high -- the server has 12 cores(or hyper-threads), load below 12 is normal. if it goes to 20+/30+/.., then load is high.

2nd, please note "13.9%wa", this is also a factor of high load, and Swap "528784k used", if you have more memory and/or faster disk like SSD, the total load will drop;

3rd, you have hosted a few busy/active php websites, it's normal the load will become high. if you switch to apache, the load may be more higher.

4th, should pay more attention to every website's response time than the number of server load. if server load is a bit high, but response fast, it's not a real problem.
 
#11
Hi,

12 Core CPUs x 1.0 Ghz (6 Core CPUs x 2.0 Ghz)
i think company provider set I/O wait low. not high. that is reason make high load.
anyway, i thank you so much help tune litespeed.

Regards,
 
#12
Hi,

Now my all website load slow. Server load low. Can you check my config litespeed? I think i wrong config then for all sites are loading slow. Help me.

Regards,
 

NiteWave

Administrator
#13
the load drop to from 23+ to 12- now

when watching with "top -c", iowait keeps high, so finally I decided to disable eAccelerator, since it use disk as opcode storage:/tmp/eaccelerator. looks like it's the main reason to drop the load(not 100% sure though)
if you have a lot of memory, can use /dev/shm/eaccelerator as opcode storage which actually in memory. you can enable eAccelerator again in this case.

also I disabled module ZendGuardLoader.so again.

still there are following .so in php.ini:
/usr/local/lib>grep extension php.ini
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension="suhosin.so"
;;extension="eaccelerator.so"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.3.so"
extension = "pdo.so"
extension = "pdo_sqlite.so"
extension = "sqlite.so"
extension = "pdo_mysql.so"
;zend_extension="/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"
extension="ixed.5.3.lin"

if possible, load .so modules as less as possible in php, this may drop the load as well.

another change I made:
Server->External App->lsphp5->Priority:0 ==> 1

now still can see iowait up to 30% from time to time, but the server's total load is low.
 
#16
Hi,

My current server response for a long time. but the server load is low, not high.

And some have error
500 Internal Server Error

Request Timeout

This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.
I dont know why that.
 

NiteWave

Administrator
#19
the default value has been optimized, usually you needn't change anything unless you've done enough tests on your particular server and pretty sure.

please memo down what you've changed over the default value, it'll help you much to trouble shoot new issues.

I took a quick look at lsws admin console setting, 2 default value changed:
Server->Tuning->
Connection Timeout (secs): 30 (default is 300)
Smart Keep-Alive:Yes (default is No)

most likely "500 Internal Server Error" is related to the above timeout change.
 
Top