Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

How to set CPU limit on websites

General questions about VestaCP
Post Reply
  • Print view
Advanced search
18 posts
  • Previous
  • 1
  • 2
mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: How to set CPU limit on websites
  • Quote

Post by mehargags » Fri Jan 05, 2018 1:43 am

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.
Top

vikhyat
Posts: 91
Joined: Wed Sep 14, 2016 5:39 pm

Re: How to set CPU limit on websites
  • Quote

Post by vikhyat » Fri Jan 05, 2018 1:46 pm

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.
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: How to set CPU limit on websites
  • Quote

Post by mehargags » Sat Jan 06, 2018 6:49 am

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.
Top

cocoa1231
Posts: 1
Joined: Mon Jan 01, 2018 8:19 pm

Os: CentOS 6x
Web: apache + nginx
Re: How to set CPU limit on websites
  • Quote

Post by cocoa1231 » Sat Jan 06, 2018 7:53 pm

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?
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: How to set CPU limit on websites
  • Quote

Post by mehargags » Sat Jan 06, 2018 8:32 pm

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
Top

adamjedgar
Posts: 43
Joined: Tue Apr 18, 2017 7:55 am

Re: How to set CPU limit on websites
  • Quote

Post by adamjedgar » Sat Jun 15, 2019 9:48 pm

https://blog.flaunt7.com

Gives me a 404 error.
Top

skamasle
Collaborator
Posts: 592
Joined: Mon Feb 29, 2016 6:36 pm

Re: How to set CPU limit on websites
  • Quote

Post by skamasle » Sun Jun 16, 2019 10:30 am

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
Top

dreiggy
Posts: 154
Joined: Thu May 17, 2018 8:05 pm
Contact:
Contact dreiggy
Skype

Os: CentOS 6x
Web: apache + nginx
Re: How to set CPU limit on websites
  • Quote

Post by dreiggy » Wed Jun 19, 2019 8:42 pm

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
Top


Post Reply
  • Print view

18 posts
  • Previous
  • 1
  • 2

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password