Results 1 to 12 of 12
-
08-31-2007, 05:11 AM #1Mr. Awesome
- Join Date
- Jul 2002
- Posts
- 6,347
How to limit cpanel hosting accounts by cpu/memory?
Does anyone know how to do this?
I know bluehost.com "sort of" does this. If you use more then x % of the total CPU or memory of the server, then your account will be limited automatically.
(A page is displayed saying that the page you're trying to view can't be displayed because it is using too much resources.)
Does anyone know how they do this?We are eNom PLATINUM PLUS resellers!
Sign up today for an eNom.com reseller account with lowest possible pricing.
* We provide support and service to over 4275 happy eNom domain name and SSL certificate resellers!
-
08-31-2007, 05:26 AM #2Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
You can place limit in apache. See below.
http://httpd.apache.org/docs/1.3/mod...html#rlimitmem
http://httpd.apache.org/docs/1.3/mod...html#rlimitcpuDavid | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
08-31-2007, 05:29 AM #3Web Hosting Evangelist
- Join Date
- Jun 2006
- Location
- Cluj Napoca
- Posts
- 469
It's hard to detect a user that will use x% of the total CPU or memory (excluding cgi and other things that he will run from his user, you can limit that with ulimit for example). An ideea is to check apache status regulary and do some math with the results, set a query time limit and check the logs, you can do that automatically mysql has some tools to sort the result a.s.o. I do not think there is an easy way to do it.
-
08-31-2007, 05:32 AM #4Web Hosting Evangelist
- Join Date
- Jun 2006
- Location
- Cluj Napoca
- Posts
- 469
RLimitMem:
This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.
Same with the other one. It's ok to do that, but the bigger problem is to limit accounts that lead to high load because of some long mysql queries and too many apache processes.
-
08-31-2007, 05:52 AM #5Mr. Awesome
- Join Date
- Jul 2002
- Posts
- 6,347
Looks like hsphere can do this on a per-account and per-plan basis:
http://www.psoft.net/HSdocumentation...resources.html
We're using cpanel, but all our servers run PHP as a CGI (using phpsuexec).
My understanding is that with this setup, using rlimit in each customer's virtual host will effectively limit all the customer's activity, including php/mysql/apache?We are eNom PLATINUM PLUS resellers!
Sign up today for an eNom.com reseller account with lowest possible pricing.
* We provide support and service to over 4275 happy eNom domain name and SSL certificate resellers!
-
08-31-2007, 05:58 AM #6Web Hosting Evangelist
- Join Date
- Jun 2006
- Location
- Cluj Napoca
- Posts
- 469
It will not include apache/mysql. It will include cgi's as it says in the link. cgi's are easy to limit but with that you cannot limit mysql usage or apache usage (load created when serving a page). It will include the php process if it will be executed as cgi. It's a start but far from being what you want.
-
01-05-2013, 09:15 PM #7Newbie
- Join Date
- Jan 2012
- Posts
- 14
i dont know if that help ,
but in order to make daily CPU / RAM consumption available for my Cpanel users I make simple script shell that create daily file named : <login>-cpu.html , and put it in user public_html .
The script is available at :
http://50dh.info/create-daily-cpu-peruser.txt
you can easily add suspension if limit are raised ,
any improvements are welcome .
-
01-05-2013, 09:41 PM #8Newbie
- Join Date
- Oct 2012
- Posts
- 12
Hi @mrzippy
Please let me to share my ideas..
If you want to tweak overall cpu limit, you can use @david510, @50dh and @Cristi4n ideas, or if you hard to understand that tweaks technically, you can install ConfigServer Firewall and edit the cpu limit configuration.
Otherwise if you want per user limitation, you can use CloudLinux + cPanel and you can ask support from them.
Thank you so much
-
01-05-2013, 09:49 PM #9Web Hosting Master
- Join Date
- Jan 2003
- Location
- SLC
- Posts
- 2,278
50dh & HOST QuickBuys you guys realize this is a 5 yr old thread
you brought it back from the dead
just install cloud Linux & be done with it
-
01-05-2013, 09:58 PM #10Newbie
- Join Date
- Oct 2012
- Posts
- 12
Uh, i am so sorry @HostingBig, i did not notice the that date.. i only read the last post and the top of this thread, if what is the OP issiues...
Sorry....
-
01-06-2013, 08:07 AM #11Web Hosting Master
- Join Date
- Nov 2004
- Location
- Australia
- Posts
- 1,737
This is exactly what CloudLinux does, I'm surprised nobody seems to have commented on it.
We don't use it, so I can't comment other than to say what I seem to be hearing is all good.
-
01-06-2013, 08:41 AM #12Mr. Awesome
- Join Date
- Jul 2002
- Posts
- 6,347
We are eNom PLATINUM PLUS resellers!
Sign up today for an eNom.com reseller account with lowest possible pricing.
* We provide support and service to over 4275 happy eNom domain name and SSL certificate resellers!