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
  • 1
  • 2
  • Next
vikhyat
Posts: 91
Joined: Wed Sep 14, 2016 5:39 pm

How to set CPU limit on websites
  • Quote

Post by vikhyat » Sun Dec 31, 2017 8:43 am

I have like 50 websites on my server and 3 client use insane amount of CPU. The server specs are high (24GB RAM and 8 CORES) Processor. If I put limitations on the CPU usage of these 3 clients then I can put a lot more clients as well as control the server load. Can anyone tell how I can put limitations on this user?
Top

ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

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

Post by ScIT » Sun Dec 31, 2017 9:49 am

resource limitation is, as far as i know, not possible yet. maybe you can speak with this 3 customers, based on their resources a dedicated server or vps would be better.
Top

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

Re: How to set CPU limit on websites
  • Quote

Post by vikhyat » Sun Dec 31, 2017 9:52 am

ScIT wrote:resource limitation is, as far as i know, not possible yet. maybe you can speak with this 3 customers, based on their resources a dedicated server or vps would be better.
What about I set limits using cgroups?
Top

ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

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

Post by ScIT » Sun Dec 31, 2017 10:26 am

I'm sure that will work, until know their is no integrated way in vesta. but of course you can set direct limitations inside of your system.
Top

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

Re: How to set CPU limit on websites
  • Quote

Post by vikhyat » Sun Dec 31, 2017 5:22 pm

I wasn't asking for integrated method. external methods will work too. just wanted to know what external method will be the best. I should go with cgroups only or there is any much better method?
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 » Mon Jan 01, 2018 10:04 am

Please post your observations and solutions if you are able to setup such limits, it will be an interesting solution.
Top

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

Re: How to set CPU limit on websites
  • Quote

Post by vikhyat » Mon Jan 01, 2018 12:26 pm

mehargags wrote:Please post your observations and solutions if you are able to setup such limits, it will be an interesting solution.
Hi
I have done a setup though a bit of problems are still there. I will update you after the setup is properly done. It's a bit difficult to do it properly.
Top

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

Update: How to set CPU limit on websites
  • Quote

Post by vikhyat » Tue Jan 02, 2018 8:38 pm

Update:
We did it with ulimits instead of cgroups.
We were able to successfully limit the CPU cores of the user to just a single core. Now we are working on limiting it to 50% of that 1 core as even that 1 core is a lot. The person who made this possible will also be writing a free tutorial on our blog on how he did it.
Top

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

Update: It's done
  • Quote

Post by vikhyat » Tue Jan 02, 2018 9:49 pm

The things have been done. We will be posting the tutorial soon to limit the resources of every user on our blog today https://blog.flaunt7.com. We will also work on creating a GUI version of it so that it can be done directly from the control panel itself. It will be on our git repository so anyone can contribute on this. Let me know if you are interested on making the GUI version together.
Top

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

Re: How to set CPU limit on websites
  • Quote

Post by vikhyat » 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/
Top


Post Reply
  • Print view

18 posts
  • 1
  • 2
  • Next

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
 

 

Login  •  Register

I forgot my password