Virtualmin PRO / Resource Limits

Hi,
i got a Virtualmin PRO version for limit resources for all customers on our machine.

This machine is NOTa VPS so we cant’ set % of cpu usage for single user, (the webserver is running in php-cgi mode)

So we need to limit cpu usage for many customers that sometimes spawns many php-cgi processes
or a single process that is burning cpu making the server unavailable. (about 80% cpu usage)

How we can limit this?

in Virtualmin -> Administration Options -> Edit Resources Limits we can edit one of this parameters:

Maximum number of processes
Maximum size per process
Maximum CPU time per process

How we can fix this issue playing with this 3 parameters?

Please Help is really urgent, hope for a reply as soon as possilble,

King Regards,

N.

Howdy,

It sounds like you may want to look into setting a fixed number of processes certain users can run, as well as a Max CPU time.

It can be tricky to say exactly what CPU time you should set, as CPU time isn’t a percent. It’s more of a statement of how much time the CPU has been used.

We can give you a hand seeing examples of how much CPU time your processes are currently using, and then you can use that to get a good starting point as to what CPU time limit to use for your users.

If you run the command “ps auxw”, you’ll see a list of all processes. The second to the last column says “time” in it. That’s the CPU time for those processes.

Perhaps what you’d want to do is find the CPU time for a PHP process that’s been running too long and causing trouble – and then set it a little less than that.

If you’re seeing users with too many processes running as well, you can also set a fixed number of processes too.

It may take a little trial and error to get that working exactly the way you want, but the above should get you started.

-Eric