Limit CPU Usage per user + logging
I work for a webhosting company, and I’m doing some research to how avoid some users abuse of the server cpu and ram, we are doing this with PAM & limits .conf, but we are not able to limit to a cpu time under 1 minute, we want to set up around 30 seconds, tried with ulimit but isn't not easy to setup for a group of users or generate logs.
And don’t want to limit “as is” I want to warn the user i case they user over 30" and a hard limit over that, so I need a tool that write any log, any idea where to start my search? Regards |
From the man page for ulimit (comes under bash)
Quote:
That should get you started... |
"I tried with ulimit but isn't not easy to setup for a group of users or generate logs."
Maybe i need to program a script that load ulimit and set user per user the Hard and soft Limit, and need to be setup after each reboot and not on config file like limits.conf. Thats why i was avoiding to use ulimit If you know another alternative will be appreciated. Thanks chrism01 |
And i forgot "ulimit" Just limit a process under shell. And the biggest matter is php, perl, apache etc.
Regards |
Sorry, but that's just silly ... how do you expect an apache service to
respond when you "tell it" that it's about to reach its limit of execution time? What is your objective on that machine, what are you trying to achieve? Cheers, Tink |
Maybe i did not explain me on best way!
We shared hosting, which consist on many small web sites on same server. Statistically, when one of the clients needs more resources others are not, this makes this ecosystem in theory works. In reality some of theses users are in some cases upload "heavy visitors" content, sometimes illegal sometimes not or simple one of them reach the front page of dig and get thousands of extra visitors thats translate on a over usage of the server resources, destroying the theoric ecosystem. We want to control this over usages form this clients avoiding all users were affected by this small % of big web sites. If we use limits.conf o ulimit we can limit the use on a shell and "username" friendly applications like php (with suexec), but what about the other apps, like apache, mysql, postgre, disk i/o, etc where the whole application is running under same user (mysql)or no expedit way to get the abusing user. So we are looking a way to distribute resources wisely to avoid resources peaks, slowing down hungry processes and prioritize the others. resources we want to control: Apache PHP/Perl Mysql Postgre Disk I/O Any Ideas ? |
I think this is the page you're looking for: http://www.uno-code.com/?q=node/64
|
All times are GMT -5. The time now is 08:40 PM. |