Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to limit what memory app can see and utilize in Linux?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to limit what memory app can see and utilize in Linux?

So say for example I have a 32 GB server from Hetzner and have a Site Owner License from Litespeed. My license won't run on a 32 GB and I don't want to create a VM for this. I only want the Litespeed app to see and utilize 8 GB from the 32 GB I have. Is there a good way to do this? All other applications including the OS will fully utilize the RAM.

Comments

  • raindog308raindog308 Administrator, Veteran

    That’s a pretty lame limitation on litespeed’s part. If it has an 8 GB limitation it should limit itself to using 8GB regardless of how much is installed. Tons of other software from Oracle, SQL Server, IBM, etc. works that way.

  • FAT32FAT32 Administrator, Deal Compiler Extraordinaire

    I believe you will need a container at minimum because Litespeed might be getting the total available memory from hardware instead.

  • rcxbrcxb Member
    edited April 2020

    No easy way, no. You need to debug Litespeed with strace or gdb, see how it determines available memory, then you could make a modified lib and LD_PRELOAD for Lightspeed's startup. For example, you can fake the time: https://github.com/wolfcw/libfaketime

    You should try a container.

    Thanked by 1raindog308
  • Linux has just a solution out of the box: cgroups; these let you establish limits that must be obeyed by members of the cgroup. Then you can migrate the process into the cgroup at run-time. This is bumpless and the process is not disturbed. Find details about cgroups here:

    https://docs.fedoraproject.org/en-US/Fedora/15/html/Resource_Management_Guide/ch-Using_Control_Groups.html

  • @MegaCoder said:
    Linux has just a solution out of the box: cgroups; these let you establish limits that must be obeyed by members of the cgroup. Then you can migrate the process into the cgroup at run-time. This is bumpless and the process is not disturbed. Find details about cgroups here:

    https://docs.fedoraproject.org/en-US/Fedora/15/html/Resource_Management_Guide/ch-Using_Control_Groups.html

    This is the first thing I tried. While cgroups do limit the memory by the user apache (or even root), it does not limit the memory the apps "see." So while litespeed can only use 8 GB memory, it still sees the 32 GB memory and it does not run. Throws the error:

    [ERROR] [LICENSE] License key operation failure: ERR LR.R: Site Owner license cannot be used on server with more than 8GB memory.

  • raindog308raindog308 Administrator, Veteran

    rcxb said: You need to debug Litespeed with strace or gdb, see how it determines available memory,

    It would be hilarious if it's just using free or /proc/meminfo...replace with your own file and you're good to go LOL

    Thanked by 1CConner
  • edoarudo5 said: Site Owner License from Litespeed

    @raindog308 said:
    That’s a pretty lame limitation on litespeed’s part. If it has an 8 GB limitation it should limit itself to using 8GB regardless of how much is installed. Tons of other software from Oracle, SQL Server, IBM, etc. works that way.

    Same domain and workers limit, but 60% more per month for the privilege of using your own hardware with more RAM. Fuck that noise.

Sign In or Register to comment.