how to check how many system resource a account used?

magic1000

Verified User
Joined
Mar 20, 2009
Messages
19
Location
Ha Noi - Viet Nam
Some companies say each account can not use system resource (ram and cpu) over 5%,

I want to ask how do they record the value?:confused:
 
If you are talking about shared webhosting, most (pretty much all) of those companies are bluffing.
There are a few ways to gather the values of RAM and CPU load a customer is using in Apache, PHP etc, but they are not worth the work: it's much easier to look at the logs, sniff the traffic and interrogate MySQL whenever a server is slowing down and find the offending customer that way.
 
If you want to monitor those values it would require some amount of custom coding. Perhaps it is worth your while if you are managing 100+ servers and are experiencing load issues caused by your customers regularly.

I don't think it's worth your effort if you are only hosting 1 ~ 20 servers.
 
We don't count inodes regularly - it's very server intensive, so it's processed during off hours, not realtime if we need to calculate how many files a customer has

for i in `ls -1A`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -5

As the others have said, very impractical for shared hosting - unless server resources are an issue. Also, not really enforceable unless you specify that a customer can only use XX inodes (HostGator is one, I believe their limit is 50,000 inodes per customer, even though they advertise "unlimited")
 
May I suggest using quota instead of that command? This way you will have a real-time inode and blocks count for every user in any directory (very important, for /tmp /var/spool/cron etc) without even noticing that it's there... and you can automatically send a warning or block disk access if the soft-limit or hard-limit are reached.
DA already sets quota for every user.

Anyway the question was specifically about RAM use and CPU load values.
 
Back
Top