Scale up LiteSpeed

#1
Hey all!
In the past, I've used an Nginx stack to get high concurrency out of my sites, but I'm trying to achieve the same thing using LiteSpeed. I've always loved LiteSpeed but due to the configuration, it was optimized for shared environments. I'm working on unlocking the performance so that I can get high concurrency even in a shared environment.

I've got a LiteSpeed 2 CPU license, stock WordPress site with LScache installed, PHP7, Opcache, and that's it.

When I hit the site with 10000 concurrent visitors for 1 minute, it has about 15% of errors. Timeout errors, and network errors. On the server, I'm seeing LiteSpeed take up 100% of 1 CPU core, but it never goes over 100%. No IOwait, memory is still available, etc. The other thing I'm seeing is that it starts fine, but at 15 seconds in, it sees a lot of errors and high response time, but after that it calms down, and then spikes again. I want errors to be zero, and I want to keep scaling it up :). I also want to smooth out the peaks too.

Here's the link to the images of my bench marks.
Code:
https://imgur.com/a/PW598
I appreciate any help/advice/guidance :)

Thanks!
 
Last edited by a moderator:
#2
Just to add, the only part that I think is strange is seeing LiteSpeed pegged at 100% of 1 CPU. It's serving from the caching engine, because the usage is not showing up under the user, but rather under the LiteSpeed server itself.
 

Pong

Administrator
Staff member
#3
What's your test URL? How did you enable cache?
Can you also share your command to run the benchmarks?
What's the error messages?
 

mistwang

LiteSpeed Staff
#4
Have you tuned kernel TCP stack to handle that many concurrent incoming connections?
For web site configured via Apache configuration, it is served by one CPU by default.
You can add a listener for `<IP : Port>` of that site in native configuration, bind to two process, to fully utilize the 2-CPU license in your benchmark test.
 
#5
Hey!
The link is Hycari.com. I don't really have any error messages, I'm using loader.io to test with. It just says time outs and networking errors, pretty useless lol. For tuning the TCP stack, no I haven't done that. I'll look that up. Is there a way to do this server wide?

Thanks!
 
#6
Hello!
I basically want to get a flat 10 ms response time throughout the whole time of the test. Right now, I'm actually getting LiteSpeed to crash :(. 1000 to 5000 concurrent seems fine, but if I do a 10000 concurrent test, after the test LiteSpeed is down and I have to restart it.
Thanks!
 
#7
Also, I couldn't create a new listener:
Code:
2017-10-17 17:50:30.248 ERROR HttpListener::start(): Can't listen at address hycari.com: Address already in use!
2017-10-17 17:50:30.248 ERROR HttpServer::addListener(hycari.com) failed to create new listener
2017-10-17 17:50:30.248 ERROR [config:server:listener:hycari.com] failed to start listener on address *:80!
 
Last edited by a moderator:

Pong

Administrator
Staff member
#8
May we have a tmp root access to take a look at your settings?
You can log a ticket with us by sending the login information.

I quickly run the following from my local machine:
Code:
  ab -b -k -n 10000 -c 100 -H "Accept-Encoding: gzip,deflate" http://hycari.com/
 Requests per second:    410.89 [#/sec] (mean)
it is very low compare to our test around a couple of thousands.

You can run the same command on your server to avoid network issue.
 
Last edited by a moderator:

Pong

Administrator
Staff member
#11
For other's interest:
We logged into the server, disable the mod_security and enable two processes for port 80, running command inside box:
Code:
   ab -b -k -n 10000 -c 100 -H "Accept-Encoding: gzip,deflate" http://hycari.com/
    Requests per second:    3245.89 [#/sec] (mean)
while run remotely through network, will be around
Code:
 Requests per second:    410.89 [#/sec] (mean)
so it is limited by network, not by web server.
 
Last edited by a moderator:
#12
For other's interest:
We logged into the server, disable the mod_security and enable two processes for port 80, running command inside box:
Code:
   ab -b -k -n 10000 -c 100 -H "Accept-Encoding: gzip,deflate" http://hycari.com/
    Requests per second:    3245.89 [#/sec] (mean)
while run remotely through network, will be around
Code:
 Requests per second:    410.89 [#/sec] (mean)
so it is limited by network, not by web server.
Is there any guides on how to enable two processes for port 80 to fully utilize the 2-CPU license?
 

Pong

Administrator
Staff member
#15
Depend on your situation, most of the time, you may not need on the production server. Enabling cache should be your fundamental step to improve the speed and reduce the server load. litespeed process does not need much CPU unless you have very heavy mod_security rule used.
 

Pong

Administrator
Staff member
#16
You can run some load test by ab, siege or some cloud tools. An easy way is to load the page through your browser by opening your developer tool to check the page loading time.
 
Top