It is possible to wrap service in lve using lve-wrappers. To do that, install lve-wrappers first:

Then rename service that you want to wrap like:

Create a new script to start service instead:

That should be it. You can specify any number as LVE_ID, just make it large enough so it would not clash with user id from /etc/passwd file.

In LiteSpeed admin interface do the following:

Configuration -> Server -> Edit -> “Enable LVE” = “Yes” -> Save If you are using CageFS then choose cagefs there. To enable PHP-Selector with LiteSpeed you have to adjust more settings in Admin:
  1. CloudLinux (Admin Console –> Configuration –> Server –> General): CageFS;
  2. Enable SuExec: Server-> General -> PHP SuEXEC -> Yes;
  3. LSPHP5 external app runs in SUEXEC non-daemon mode ONLY (Run On Start Up –> Yes or No);
  4. In LSPHP5 external app (Admin Console –> Configuration –> Server –> External App –> lsphp5)

Change

To

See screenshot below:

* In order to use PHP Selector and custom php.ini, lsphp5 needs to be in SuEXEC non-daemon mode.

<span

read more

ImageMagick tries to use all available cores. This causes significant waste of resources due to process switching when running inside LVE with number of available cores is less then number of total cores on the server.

To fix the issue, limit the number

read more

Quite often you will see process using 99% of CPU, even though the CPU limit is set to 25%.

This is due to the fact that top shows CPU usage based on a single CPU, while LVE allocates usage across all CPUs on the system. So, on quad core server, 25% of CPU resources is 1 CPU And if top shows 99% usage — it is also just 1 CPU. If you have dual core server, and set the limit at 25%, you will not see a process using more then 50% cpu when you view it via top And on single core server, the limits will match.  * LVE CPU limits are not exact, they can error within about 3% in either direction.

Following message appears in /var/log/messages:

Fatal resource shortage: privvmpages, UB 185096

The message means that some site was limited on memory. To find out which site run:

It will show you users that hit memory limit. You can adjust memory limit for those users by running:

Default limit is 1024 megabytes