High CPU Compared to Apache

GOT

Well-Known Member
#1
I've recently had the opportunity to do some side-by-side testing between Apache and Litespeed. Its for a very high traffic site, runs around 100 MBit traffic peak daily.

Site currently runs on a Centos 6 64 bit server running Centos's Apache and php56w packages from webtatic. Loads are consistently below 1 on server with the following specs

Intel Xeon 1270v3
8 GB RAM
SSD storage

When we divert site traffic to the new Litespeed server, which has the exact same specs as above, load runs around 4 with peaks up to 8. All CPU related, IO is fine.

Page load times ARE faster, no question, but the load has us concerned.

We custom compiled php 5.6. Settings are as follows:

https://cl.ly/0s1C1109442A

Is it normal for Litespeed to take up more CPU for the same code base on the same hardware as Apache? Is that the price we pay for faster page loads? We feel like we do not have much overhead with loads running at 4 with spikes up to 7.
 

NiteWave

Administrator
#2
litespeed should have lower load than apache. this is a basic feature. this has been proved in hundred of production servers around the world. especially on shred host. for example, if apache can sustain 1000 accounts, litespeed can sustain 2000 accounts. this is not a miracle but a fact so far and this is one of main reasons user switch apache to litespeed.

if you have only 1 main web site on the server, you can disable php suExec mode
lsws web admin -> server -> general -> PHP suEXEC: No
on shared host, usually this default setting is Yes since many accounts.
compare php settings under apache and lsws. if they are matching, litespeed should be faster than apache with lower load.
 

mistwang

LiteSpeed Staff
#3
With php56w, your apache setup is using mod_php, which embedded PHP engine into Apache server process.
PHP LiteSpeed SAPI run PHP in its own process, the server need to communicate with lsphp processes through socket IPC, so there is a lot of process context switching between lshttpd and lsphp processes. server load is mainly calculated based on queue depth of context switching, so you will see higher server load.
since there is more processes involved with litespeed setup, the load is slightly higher. That's normal. as long as your site loads faster, nothing to worry about.
 

GOT

Well-Known Member
#4
This

lsws web admin -> server -> general -> PHP suEXEC:

Was not set and the default says it is no, so I assume that that was already operating that way, but I have set it explicitly no.

I knida figured load was higher because of what mistwang said. So not a lot I can do then.
 
Top