I need help with Litespeed and PHP Tuning

I am using Openlitespeed with Cyberpanel. Cyberpanel has two sections, One is PHP Tuning and the other is Litespeed tuning.

There are many options and IDK what to enter in each field. I have read many forums but no one clearly mentions the best tuning settings.

My WordPress site has traffic of around 5000 users every day. I am using a web server with 8 Core CPUs and 16 GB of Memory. AWS c4.2xlarge instance type.

I want to optimize my website as MySQL usage sometimes crosses 300%. Cpu usage is very high bcoz of MySQL. Please help me in optimizing my website.

Sounds that you have pretty beefy server if you have only one site there.

I would get smaller server and use money saved on Quick.cloud CDN.
Quick would take some strain out of server and help optimize site too.

We have to use this server as the server load is really high due to MySQL. It reached up to 100%.

I have made Litespeed cache optimization, using Image CDN and Cloudflare. The issue is database high usage.

You sure you use cyberpanel? Because cyberpanel use mariadbd.
I dont see you using redis either, setup redis that will help too on database queries.

I am using Redis. And I am using cyberpanel. I have migrated my site from normal WordPress to LiteSpeed with the cyber panel.

Check this

Maybe check with query monitor what uses somuch database. Just sound weird site with 5000 daily visitor topping 8cpu server.

Sure, I will check.
I am not sure which database my site is using. How can i find that? And how to switch to MariaDB if I am using MySQL

Just checked one of my server show on top command mysql and others mariadb not sure whats deal there.
Screenshot 2022-05-26 130842

Yes, Can’t understand what’s happening.

Is there any official way of contacting openlitespeed other than forums?

PHP Version - 8.1
I am getting 79 PHP Deprecated errors for plugins. What to do?
|Deprecated|Return type of FS_Key_Value_Storage::offsetExists($k) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice|1|+

1. wp-content/plugins/ajax-search-for-woocommerce/fs/lib/includes/managers/class-fs-key-value-storage.php:309 Plugin: ajax-search-for-woocommerce

Try use PHP 8.0 some wp plugins not fully compactible with PHP 8.1 and not speed difference either on those.

1 Like

Thank you for replying quickly.

It’s worth doing a cleanup and optimise of the database to start with, if the site has been around a while and has a lot of posts, revisions, comments, and has been through lots of changes of plugins and options then there is bound to be a load of stuff in there that can be cleaned up.

Also converting tables to InnoDB from MyISAM in case of any of them are.

You can do all of that from the LS Cache plugin.

NOTE: Do back up the database first obviously just in case.

Agreed, that’s a lot of server for a not particularly high traffic site. How many posts and comments are on the site?

Orders - 60000
Comments - 2000
Posts - 150

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.

You could also install newrelic and see what is causing the slowness. There’s a good tutorial in the Docs section of this forum.

Setting up xdebug and doing a profile would also be useful. There’s instructions to install in the Docs as well.

Also, try disabling plugins and see what happens. And clean the database as well.

Try this plugin as well Index WP MySQL For Speed – WordPress plugin | WordPress.org

It is made by a couple mysql experts. It adds indexes to your tables to allow for more efficient queries.

Also connect your cyberpanel to cyberpanel cloud and do the database optimization tool - it’ll set some configuration settings based on things like your server memory amount.

Finally, try using php 7.4 - a lot of plugins aren’t ready for 8.0,let alone 8.1

I really wish there was more information here and elsewhere about tuning litespeed itself though - I’ve never found any useful info at all about this.


Thank you!
I will try all the methods listed here.
After changing the PHP version from 8.1 to 8. Everything is OK. Even when I was receiving around 200 page views a minute, the overall usage was around 30%. I normally get 50-60 page views per minute.

I migrated the website from Apache to Litespeed and earlier my PHP version was 7.4. So might be some compatibility issues.

I will switch to 7.4 if the problem continues.


This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.