Page 2 of 2

Re: How to set CPU limit on websites

Posted: Fri Jan 05, 2018 1:43 am
by mehargags
This looks promising, yet as an admin of my server infrastructure, I would want to 'know' which site/user is abusing my system. So the system should send an email alert when a user hits his assigned ulimit. I'm also not sure if this would work good in nested virtualization.

Re: How to set CPU limit on websites

Posted: Fri Jan 05, 2018 1:46 pm
by vikhyat
mehargags wrote:This looks promising, yet as an admin of my server infrastructure, I would want to 'know' which site/user is abusing my system. So the system should send an email alert when a user hits his assigned ulimit. I'm also not sure if this would work good in nested virtualization.
Sure, we will work on developing something which will alert us when a user is abusing the server. Yesterday only our whole server went down because of just 1 user and we were not informed about it for more than an hour. We really need an alert system and have already started our work on it.

Re: How to set CPU limit on websites

Posted: Sat Jan 06, 2018 6:49 am
by mehargags
You must install some monitoring system on all your servers... Self hosted or something like nixstats or hetrixtools
Failing that, you will never know if and when your server or services went down and then have bigger problems to resolve.

Re: How to set CPU limit on websites

Posted: Sat Jan 06, 2018 7:53 pm
by cocoa1231
Hey mehargags!
I was the dude who actually set up cgroups (not ulimit)
Thanks for the recommendations. I'll definitely install them :)

As far as that email system goes, I'll get to work on that. I wanted to know two things. Firstly, I want to recompile vestacp packages for arm arch, so where can I find the repository mirror and download literally all the packages? I've got 3 people (including me) who are just itching to do some cross compilation.

Secondly, I want to make a few plugins for Vesta to increase the functionality. Maybe even a front end for cgroups. How would I go about making vestacp plugins?

Re: How to set CPU limit on websites

Posted: Sat Jan 06, 2018 8:32 pm
by mehargags
For code related questions, I guess you would be better of asking on https://bugs.vestacp.com/ or join VestaCP on Github https://github.com/serghey-rodin/vesta

All code repos are there free for anyone to fork/download

Re: How to set CPU limit on websites

Posted: Sat Jun 15, 2019 9:48 pm
by adamjedgar
https://blog.flaunt7.com

Gives me a 404 error.

Re: How to set CPU limit on websites

Posted: Sun Jun 16, 2019 10:30 am
by skamasle
I think better way to check and limit apache + php sites, is using fastcgi o php-fpm

You can setup a limit of how many process any user can open,so how many php process they can start

In many cases bad php scripts can overload server opening 10, 20, 30 .. 100 process, and your server may go down, so you can limit to 5 each user and they may not overload your server.

Also you can do it in mysql, limit the max_user_connections

LImit this with ulimit may not help to much, users may not overcome that values because mysql run as mysql and apache run as apache, and just php run as user, and not overcome ulimit limits

I recomend you use fastcgi / php-fpm and limiti each user and each mysql user, this is the best way in vesta in shared hosting

Re: How to set CPU limit on websites

Posted: Wed Jun 19, 2019 8:42 pm
by dreiggy
vikhyat wrote:
Thu Jan 04, 2018 10:16 pm
Forgot to tell that the tutorial is already up and it was made with keeping VestaCP in mind so it should be easier to achieve the task with this tutorial. This limit has helped us a lot in managing huge server load without suspending user. https://blog.flaunt7.com/managing-resources-cgroups/
Hi,
url is not working:
Image