Memory limit for OpenLitespeed


I have a server with 4GB RAM, running MariaDB and OpenLitespeed running php application.
Let's say that MariaDB has a maximum memory usage of 2.5 GB. How would you limit (if at all) OpenLitespeed server so it won't use too much RAM?

I was looking at soft and hard memory limits for lsphp external application, but I am not sure if this limits the memory consumption per process or for the whole application.

I am trying to limit the OpenLitespeed so it won't consume too much RAM on the system and cause any issues with the database. But again, I am not sure if I should limit OpenLitespeed at all, as it looks like it has some smart memory control integrated into it.


OpenLiteSpeed won't use much resources at all. You don't need to worry. Most of the resources consuming on php and MySQL.
Hi Pong, thanks for your reply.
I have a bit different experience.
When running, OpenLiteSpeed is gradually using more and more ram, and doesn't release it. I suspect that it is using it as a cache and because the server is handling quite a lot of traffic (80-100 req/s) with a lot of unique requests, the cache grows indefinitely.
But when the OpenLiteSpeed and MySQL use all of the available memory (4 GB), OS restarts MySQL database. The memory usage then drops, but after an hour it goes back up to the limit. When this happens, the MySQL gets restarted again (probably by OS).

I attached some graphs to show this.
The big drops in memory usage on the first one (openlitespeed-memory-usage-1.png) are when I manually gracefulyl reloaded OpenLiteSpeed. The smaller drops in memory usage (at the peak memory usage) are when the MySQL got automatically restarted and then the consumption went back up again quite fast.

You can see this last thing on the second graph (openlitespeed-memory-usage-2.png). Every minor drop in memory usage is when the MySQL got restarted. The big drop at the end is when I noticed that and manually restarted the OpenLiteSpeed server.

I limited the MySQL memory usage to about 2.5GB, but the OpenListeSpeed keeps using all of the available memory and even more.

For now, I will just set up a cronjob to restart the OpenListSpeed server once per day to release the resources. But I would prefer if there would be a way to limit it's max allowed memory consumption.
I will try to play around with soft and hard memory limits for lsphp, but I doubt that it will help.


I have the exact same problem here... OpenLiteSpeed consume all memory and seems to never release it.

Is there a way to debug this and see where the memory is going?

LiteSpeed/1.6.18 Open
module versions:
modgzip 1.1
cache 1.62
modinspector 1.1
uploadprogress 1.1
mod_security 1.4
(built: Tue Nov 24 16:40:45 UTC 2020)
module versions:
modgzip 1.1
cache 1.62
modinspector 1.1
uploadprogress 1.1
mod_security 1.4