Optimizing litespeed for high traffic

Crazy Serb

Well-Known Member
#24
What about 20.000 user per day (I mean 24 hours') ? is it steel need server load balancer?
Nah, you don't need any of the Load Balancing or NVMe RAID0 setup or anything crazy that Andrey keeps coming up.

All you need is CloudFlare in front of your website, filtering traffic to it and taking the initial hit / lifting the heavy weight processing from the server.

My $500/month server with Litespeed couldn't handle more than 2,000 users/second (steady load). The minute I added CloudFlare into the mix, I could easily handle 50,000 users/second (again, steady load) without it flinching. I'm sure it would've handled 100,000 users/second just fine as well... so it was CloudFlare alone, not any sort of crazy hardware setup Andrey is trippin' on.

I've tested this on a $30/month Vultr.com cloud instance (1 vCPU, 4GB RAM, 30GB NVMe drive) and it works just fine on that setup as well, meaning minimal hardware. Don't listen to keyboard jockey quacks who have zero real time experience and are talking out of their ass.
 

av_admin

Well-Known Member
#25
Nah, you don't need any of the Load Balancing or NVMe RAID0 setup or anything crazy that Andrey keeps coming up.

All you need is CloudFlare in front of your website, filtering traffic to it and taking the initial hit / lifting the heavy weight processing from the server.

My $500/month server with Litespeed couldn't handle more than 2,000 users/second (steady load). The minute I added CloudFlare into the mix, I could easily handle 50,000 users/second (again, steady load) without it flinching. I'm sure it would've handled 100,000 users/second just fine as well... so it was CloudFlare alone, not any sort of crazy hardware setup Andrey is trippin' on.

I've tested this on a $30/month Vultr.com cloud instance (1 vCPU, 4GB RAM, 30GB NVMe drive) and it works just fine on that setup as well, meaning minimal hardware. Don't listen to keyboard jockey quacks who have zero real time experience and are talking out of their ass.
Thanks for information you shared with me
first: I have with cloudFlare, sometimes it will block for some reason (this is my area problem) and my client loos access to my site
2-Ihave server G9 HP with 256Gig ram and 2 cpu {28 CPUs x Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz} + 8 500 Gig SSD Pro that are in raid 0+5 and 2 fiber cable of 10g internet speed
*I installed the exsi on server and then installed almalinux , in this os we installed the cpanel and litespeed x worker elite
I run WordPress site that have traffics but the site (my theme and plugins have problem also) I used php 8.1 and litespeed cache
in google search console I can see we have 7000 or 9000 users from google, and the rest of throes users are coming directly to site, with google analytics we can monitor theme.

in this case, what is the best config for my site and server?
*I can't run CDN out side of my country because they block connection from outsides randomly everyday...
 

Crazy Serb

Well-Known Member
#26
Jesus, that's a serious overkill server for 20,000 users per day... but hey, if that's what you're working with, so be it.

DM me, I might be able to help if I was to get more details on your traffic, needs, etc, as I've configured dozens of these servers over the years and tweak & reconfigure them constantly depending on the ever-changing requirements and needs...
 
#27
Hi Experts :D,

We are currently experiencing performance issues with our LiteSpeed server. Our server configuration is:
CPU:4 Cores - 8 Threads
RAM: 32768 MB
Storage:2x 240GB SSD

And the application running on server is : Plesk, Litespeed enterprise and Wordpress, Woocommerce

This problem seems to be same as the orginal topic issue. Last year, during a campaign, we encountered similar server performance issues.
We're facing performance problems. At peak times, we estimate around 4000-5000 concurrent users accessing various pages on our site. I've attached the page resource usage from the Query Monitor Plugin for your reference.

Screenshot 2023-11-21 at 20.49.24.png

Upon investigation during peak traffic, our MySQL logs revealed numerous errors similar to the following:

2023-11-20 12:22:10 1081 [Warning] Aborted connection 1081 to db: 'main' user: 'use' host: 'localhost' (Got an error reading communication packets)
2023-11-20 12:22:10 1186 [Warning] Aborted connection 1186 to db: 'main' user: 'use' host: 'localhost' (Got an error reading communication packets)
2023-11-20 12:22:10 1170 [Warning] Aborted connection 1170 to db: 'main' user: 'use' host: 'localhost' (Got an error reading communication packets)
2023-11-20 12:22:10 1285 [Warning] Aborted connection 1285 to db: 'main' user: 'use' host: 'localhost' (Got an error reading communication packets)

Additionally, the 'top' command indicates that the CPU load exceeds 104,110 during these periods.
In an attempt to mitigate these issues, we made adjustments to various LiteSpeed settings:
  • PHP_LSAPI_CHILDREN: Increased from 90 to 300 and subsequently to 1000
  • Max Connections: Expanded from 300 to 1500
  • PHP suEXEC Max Conn: Raised from 300 to 600 and later to 1500
Unfortunately, none of these alterations alleviated the CPU load, which may have contributed to MySQL crashes.
It's important to note that we employ LSCache and Quic.CDN, and have executed all recommended caching and performance optimizations.
Regarding MySQL performance, we've implemented the following tweaks to the SQL settings:
  • local-infile=0
  • innodb_buffer_pool_size=16G
  • innodb_log_file_size=2G
  • max_connections = 800
  • performance_schema = on
  • slow_query_log = 1
  • slow_query_log_file = /var/log/mysql-slow.log
  • long_query_time = 2
  • skip-name-resolve=ON
  • table_definition_cache = 1000
I'd feel relieved if someone could assist me; it's puzzling because I'm aware that the current number of concurrent users shouldn't strain the server's resources.
 

Crazy Serb

Well-Known Member
#28
it's puzzling because I'm aware that the current number of concurrent users shouldn't strain the server's resources.
It is puzzling, isn't it?

I'm still waiting to hear from anyone at Litespeed on how to have it perform under such load (2000+ concurrent users) without crashing the server, blowing thru the server load and CPU usage, without employing CloudFlare to mitigate that.

I mean, their selling point is "Unbeatable Performance"... I can't get it to perform at all at 1500-2000 (or more) concurrent users without having to resort to using CloudFlare to do the heavy lifting first and foremost, and still waiting for the head honchos over here to come up with something that actually works (instead of the silly suggestions by a few jokers in this thread that have no connection to reality whatsoever), so you're not alone.

In the meantime, if you can use it, set up CloudFlare and ONLY set this up in CloudFlare in terms of caching, and let Litespeed Cache on your server do the rest:

https://gist.github.com/isaumya/af10e4855ac83156cc210b7148135fa2

This will make your server go from choking at 1,000+ users to handling 50-100,000 concurrent users like it's nothing.
 
#29
It is puzzling, isn't it?

I'm still waiting to hear from anyone at Litespeed on how to have it perform under such load (2000+ concurrent users) without crashing the server, blowing thru the server load and CPU usage, without employing CloudFlare to mitigate that.

I mean, their selling point is "Unbeatable Performance"... I can't get it to perform at all at 1500-2000 (or more) concurrent users without having to resort to using CloudFlare to do the heavy lifting first and foremost, and still waiting for the head honchos over here to come up with something that actually works (instead of the silly suggestions by a few jokers in this thread that have no connection to reality whatsoever), so you're not alone.

In the meantime, if you can use it, set up CloudFlare and ONLY set this up in CloudFlare in terms of caching, and let Litespeed Cache on your server do the rest:

https://gist.github.com/isaumya/af10e4855ac83156cc210b7148135fa2

This will make your server go from choking at 1,000+ users to handling 50-100,000 concurrent users like it's nothing.
For sure it is,
We've invested in a paid service, utilizing LiteSpeed Server along with their additional service, QUIC.cloud as a CDN. Surprisingly, we're not experiencing significantly better results compared to using NGINX. I'm uncertain about how to address this.

I'll take a look at the link you've shared. Are you suggesting that if I switch back to Cloudflare (having recently moved to QUIC CDN), it could potentially improve our overall performance? and thanks for your help
 

Crazy Serb

Well-Known Member
#30
For sure it is,
We've invested in a paid service, utilizing LiteSpeed Server along with their additional service, QUIC.cloud as a CDN. Surprisingly, we're not experiencing significantly better results compared to using NGINX. I'm uncertain about how to address this.

I'll take a look at the link you've shared. Are you suggesting that if I switch back to Cloudflare (having recently moved to QUIC CDN), it could potentially improve our overall performance? and thanks for your help
I am not saying it "could potentially improve" your performance, I can pretty much guarantee it at this point (having tested it on multiple servers and dozens of client websites).

And what I am saying is to employ CloudFlare ONLY for that specific caching, as specified in that link above, + enable Tiered Cache and Cache Reserve, just below the Cache Rules section. As far as everything else goes (CDN, etc) leave that turned off in CF and use whatever you're using right now - QUIC.cloud, LS Cache, etc.

Test it out and let me know if you don't see a massive improvement and your server load sticking at the bare minimum even at the heaviest traffic. At that point you can even dial down the Litespeed parameters down to minimum as well (the ones you mentioned tweaking and increasing) and you won't see any drop in service or increased server load (shouldn't, at least).
 
#31
I am not saying it "could potentially improve" your performance, I can pretty much guarantee it at this point (having tested it on multiple servers and dozens of client websites).

And what I am saying is to employ CloudFlare ONLY for that specific caching, as specified in that link above, + enable Tiered Cache and Cache Reserve, just below the Cache Rules section. As far as everything else goes (CDN, etc) leave that turned off in CF and use whatever you're using right now - QUIC.cloud, LS Cache, etc.

Test it out and let me know if you don't see a massive improvement and your server load sticking at the bare minimum even at the heaviest traffic. At that point you can even dial down the Litespeed parameters down to minimum as well (the ones you mentioned tweaking and increasing) and you won't see any drop in service or increased server load (shouldn't, at least).


Dude, this is really amazing. If it works, you saved me. I can donate you the money I give to quic CDN Haha
I am going to read the github link and I should move back to cloudflare, I will test it soon and give you and the others that have this shit problem with strong dedicated and costly servers.

Is it ok to send you DM or ask here if I have question maybe?

Thanks
 

Crazy Serb

Well-Known Member
#32
Dude, this is really amazing. If it works, you saved me. I can donate you the money I give to quic CDN Haha
I am going to read the github link and I should move back to cloudflare, I will test it soon and give you and the others that have this shit problem with strong dedicated and costly servers.

Is it ok to send you DM or ask here if I have question maybe?

Thanks
Absolutely, man... you won't be the first (or last) person I help around here. Just paying it forward, as others have helped me over the years when they didn't really have to.

And I run a bunch of my own servers too, so this is obviously a problem I've faced enough times over the last decade or so, and still keep looking for a solution that doesn't involve CloudFlare. But for now, hey, if it works, so be it, I'm not gonna fight it...
 
#33
Absolutely, man... you won't be the first (or last) person I help around here. Just paying it forward, as others have helped me over the years when they didn't really have to.

And I run a bunch of my own servers too, so this is obviously a problem I've faced enough times over the last decade or so, and still keep looking for a solution that doesn't involve CloudFlare. But for now, hey, if it works, so be it, I'm not gonna fight it...
My friend
I followed the GitHub instructions and implemented the recommended changes: enabled Tiered Cache and Cache Reserve while disabling page caching in the LiteSpeed Cache plugin, as suggested by the Cloudflare plugin. Now, I'm observing a cf-cache-status HIT. However, prior to these adjustments, our Page Insights website had scores of three 100s and a 99, while GTmetrix showed an A grade with 99%. Currently, those scores have dropped to a C with a performance rating of 54%.
Considering the reduced traffic on the site, I'm unsure of the server's responsibility in this matter. Nonetheless, do you have any suggestions to improve the performance?
 
#35
@Empire

If you use cache plugin for WordPress and also CF cache then this doesn't work because CF doesn't support a lot of optimization functions of the cache plugin.
Hi,
What do you mean exactly? I am using litespeed cache plugin to some minifying and combining and LQIP, and just page cache setting is disabled in LS cache and cloudflare is doing that with custom rules, what is wrong in between?
 
#37
Please use cache plugin support forum at WordPress. This forum doesn't support WP cache plugin any longer. There you will get qualified support for the cache plugin.

https://www.litespeedtech.com/support/forum/threads/please-use-the-official-wordpress-forum.16028/
I'm primarily waiting for another user's response regarding a different issue. It might be best to wait for their input before proceeding.

Thank you. Additionally, since we're paying for Litespeed Server Enterprise, I believe it's appropriate to inquire about anything related to Litespeed.
 
#38
I'm primarily waiting for another user's response regarding a different issue. It might be best to wait for their input before proceeding.

Thank you. Additionally, since we're paying for Litespeed Server Enterprise, I believe it's appropriate to inquire about anything related to Litespeed.
We're considering the possibility that if the performance of Litespeed Server doesn't align better with our needs than Nginx, it might be more advantageous to switch back to Nginx since it's a free alternative.
 

serpent_driver

Well-Known Member
#39
You pay for LiteSpeed web server, but the support for the cache plugin is offered at WordPress. In this forum you won't get support for this plugin. This is especially true when it comes to the cache plugin and CloudFlare.

We're considering the possibility that if the performance of Litespeed Server doesn't align better with our needs than Nginx, it might be more advantageous to switch back to Nginx since it's a free alternative.
Your performance problem is not due to the web server malfunctioning, but rather due to an overload on the part of PHP and MySQL. That's why nothing changes if you want to use a different web server.
 
#40
You pay for LiteSpeed web server, but the support for the cache plugin is offered at WordPress. In this forum you won't get support for this plugin. This is especially true when it comes to the cache plugin and CloudFlare.



Your performance problem is not due to the web server malfunctioning, but rather due to an overload on the part of PHP and MySQL. That's why nothing changes if you want to use a different web server.
Look, my initial question in this thread was solely about Litespeed Web Server—not caches or anything else. Someone mentioned that I wouldn't get answers from LSWXperts here, and turns out, they were right.
 
Top