Portal Home > Knowledgebase > Articles Database > How to limit users RAM/CPU use ?


How to limit users RAM/CPU use ?




Posted by meais, 11-18-2007, 10:03 PM
Hello , I have a dedicated server with CentOS and cPanel/WHM I want to know how would I limit each user usage of RAM and or CPU I see HUGE web hosts are doing that , they give you 9999999 diskspace and 99999999 bandwidth but they limit your RAM & CPU use to a tiny number I want to know how could I do that in order to keep my resources good . Thanks ,

Posted by david510, 11-18-2007, 10:45 PM
You can use the following values in the httpd VH to limit per domain. RLimitCPU value RlimitMEM value RlimitNPROC value

Posted by CretaForce, 11-19-2007, 03:46 AM
You have to run php as fast-cgi to make that work.

Posted by meais, 11-21-2007, 11:12 AM
david , thanks for your reply .. do you mean I need to add this value to each virtual host in the httpd.conf file ? if so can you provide an example if possible please ? CreaForce , thanks for replying to but would you explain more or provide a link where I can understand what you mean ?

Posted by Srv24x7, 11-21-2007, 11:32 AM
you can use those directives in the virtual host directive for the specific domain in httpd.conf or even set that in .htaccess file for the domain. RLimitCPU seconds|max [seconds|max] RLimitMEM bytes|max [bytes|max]

Posted by AuthorizedNetwork, 11-21-2007, 07:19 PM
I have been trying to figure this same thing out for weeks. It seems that My senior server admin can not figure out how to do it and every time I try to hire someone to do it, they seem to run for the hills when I give them a description of what I want. Good luck and let me know if you figure anything out on this issue.

Posted by meais, 11-21-2007, 07:31 PM
Srv24x7 , thanks for your help and I'll try to do it using .htaccess because I'm afraid of messing my httpd.conf up But the problem is that how am I gonna make sure it really works or not AuthorizedNetwork , as soon as I verify how to do it I'll explain to you

Posted by david510, 11-21-2007, 08:07 PM
You can add it globally inside httpd.conf file, inside virtualhost and .htaccess (you can set this for certain directory also). Srv24x7 has stated an example.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read