![]() |
|
#1
|
||||
|
||||
|
CPU Limit
I'd love to be able to set a CPU limit on some accounts, so that those don't take a server down.
__________________
interfaSys sаrl Switzerland Solutions integration / Business analysis / IT Governance consulting The best DirectAdmin user experience for small businesses Custom Exim, Dovecot, antispam, webmail, DNS and stats configurations on FreeBSD 8 (ZFS+RAID+IPv6) |
|
#2
|
|||
|
|||
|
This isn't possible, since CPU load changes based on a number of factors. For example, you may have 100 users on your machine, each using MySQL - but MySQL runs as a single daemon, queuing up queries and executing them as a single user. We can say "Hey, MySQL is driving the load up." but we can't say "Hey, demouser is driving the load up." You can view MySQL processes, but this won't assist you in determining which user is increasing the load.
PHP and Apache is also another great example. You can see that Apache is driving the load up, but you can't see what script is doing it. The process just appears as Apache, doing something, which was commanded my someone, whom we cannot determine. So really, it's not possible to limit CPU load on a per user basis. |
|
#3
|
||||
|
||||
|
What it would be possible to do is install a process resouce monitor which monitors resource usage of applications then using variables set by you recieve email alerts etc.
If you wanted something like that i would be happy to put up a how-to guide ![]() Just as a note - that would be server specific not user specific due to the reasons listed above. Chris
__________________
OptimumServers » Managed Dedicated Servers & General Systems Management » Coming Soon! ProWebUK - Quality Web Services DirectAdmin Server Checklist |
|
#4
|
||||
|
||||
|
I think I saw some scripts that could could alert me in case Apache was overloading, but that script would let me know which domain was causing it, so I thought it would be possible to throttle it.
__________________
interfaSys sаrl Switzerland Solutions integration / Business analysis / IT Governance consulting The best DirectAdmin user experience for small businesses Custom Exim, Dovecot, antispam, webmail, DNS and stats configurations on FreeBSD 8 (ZFS+RAID+IPv6) |
|
#5
|
|||
|
|||
|
One of my users actually crashed my apache somehow with 150 apache processes and rising, so if you could tell me which scripts you found that would be great.
|
|
#6
|
||||
|
||||
|
Head over to WHT. In the service offer forum, you'll find script and services for sale that will help you (sorry for not having more info right now).
__________________
interfaSys sаrl Switzerland Solutions integration / Business analysis / IT Governance consulting The best DirectAdmin user experience for small businesses Custom Exim, Dovecot, antispam, webmail, DNS and stats configurations on FreeBSD 8 (ZFS+RAID+IPv6) |
|
#7
|
||||
|
||||
|
Well some news that you may be suprised by
open httpd.conf with your fav text editor search for the line: #ExtendedStatus On once you find it uncomment the line and add the following: <Location /serverstatus> allow from YOURIP deny from all SetHandler server-status </Location> you should now have Quote:
Ensure you replace YOURIP with your actual IP address (this is so only you have access to the page - all other IP addresses will be disallowed access) once your done run: # service httpd restart now go to: yourdomain.com/serverstatus SERVERIP/serverstatus you will see a page showing each vhost whats happening etc.... aswell as CPU usage for each vhost.. so in reality... this feature is possible, although if you have followed this you will have noticed its off as default for performance issues - basically you have this but it will slow apache down and affect its performance. This should come in handy when your servers resources seem to have shot up though ![]() Chris
__________________
OptimumServers » Managed Dedicated Servers & General Systems Management » Coming Soon! ProWebUK - Quality Web Services DirectAdmin Server Checklist |
|
#8
|
|||
|
|||
|
Very, very interesting. If only the 'CPU' column could be monitored, a script could VERY EASILY keep a running total per domain. Then you could "limit X CPU per minute" or something.
Also, if you could do this on a per-domain basis, you'd only set it up for people you know are high CPU eaters. Hmm...
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool |
|
#9
|
||||
|
||||
|
Quote:
The only thing i dont like about the idea is the performance issues... but then i have no idea what kind of performace effects this causes. Chris
__________________
OptimumServers » Managed Dedicated Servers & General Systems Management » Coming Soon! ProWebUK - Quality Web Services DirectAdmin Server Checklist |
|
#10
|
|||
|
|||
|
Yeah, that is all very feasible.
Also found this - http://httpd.apache.org/docs/mod/mod_status.html "if you have lynx installed, you can also get a server statics report from the command line by running the command apachectl status, or, for the extended status report, apachectl fullstatus" I need to isntall lynx and check that out ![]() As for performance, I'm going to leave http://your.server.name/server-status?refresh=1 on for a bit and see what happens
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool |
|
#11
|
|||
|
|||
|
Well, I have been invoking this every second for the past hour and I can say I'm seeing absolutely no increase in load. I think I may go a head and start playing with a program to monitor CPU on a per-domain basis.
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool |
|
#12
|
||||
|
||||
|
Performance issues wont neccessarily mean server load.... it could be page loading times (since each time a page is accessed its on that file etc.. if you have it running every 1 second for the application you are planning on developing this could cause problems there.... may want to do a bit of comparison between load times with pages etc before assuring yourself its not needed........
Chris
__________________
OptimumServers » Managed Dedicated Servers & General Systems Management » Coming Soon! ProWebUK - Quality Web Services DirectAdmin Server Checklist |
|
#13
|
|||
|
|||
|
Hmm. Good idea.
Hopefully I can get apache to generate this stuff directly in a log file, but we'll see. Thanks.
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool |
|
#14
|
|||
|
|||
|
I decided to give a go at parsing the httpd data, and here's what I came up with:
http://www.liquenox.net/cpu.monitor..../server-status Replace 'http://your.server.name/server-status' with the URL to your stats page. Remember, this is only showing the totals for the data that would normally show on the page. Running totals over a set period of time is the next step, I guess.
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool |
|
#15
|
|||
|
|||
|
Yes, and below is the source I'm running ...removed.. VB screws it up too bad...
http://www.l0rdphi1.com/junk/cpu.monitor.phps
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool Last edited by l0rdphi1; 01-03-2004 at 06:48 AM. |
|
#16
|
|||
|
|||
|
Well this is looking tremendously good! The page is however still not working when I C&P, it does work using your php script.
And if this script is not a resource hog, you could just let it run every second and print out the results 'realtime'. Or run a graph next to it. |
|
#17
|
|||
|
|||
|
I wish you could get Apache itself to print to a log with the data found on the server-status page. It's impossible to get *everything* the way I'm doing now, even running the script every second. Seems silly that Apache wouldn't let you do that.
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool |
|
#18
|
|||
|
|||
|
Perhaps there is some apache documentation that allows you to do this?
But even if you're not getting everything, it still provides a good way of seeing which sites take too much cpu time etc. |
|
#19
|
|||
|
|||
|
Yeah, even setting it to run every 5 minutes would give you a good idea. Haven't seen any docs on this (besides the one I linked), so I'll just go a head with the current method.
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain! Also: cPanel-to-DA converter ∙ Bulk Domains and Sub-domain Plugin ∙ DA User Tool |
|
#20
|
||||
|
||||
|
Quote:
lordphi: would it be possible to intergarte with mysql.... leaving the results to be used more easily ====================== Domain || <CPU USAGE> ====================== test.com || 0.01 your.com || 0.04 ====================== etc from there a shell script could simply be put in place with a 'max_cpu' variable.... a quick run through that table for a load higher than the var is specified as sends an email out to the admin (could also be a variable for the user to specify) possible admin@<DOMAIN_OVER_USAGE> and even suspend the account in directadmin for 2 minutes or a specified short period of time.. for the last idea we would need a command to suspend / unsuspend manually from command line It may not be the best of things but I think its the best we could be getting without having individual daemons running for each domain. Would make a brilliant 3rd party script if you ask me.... and it should work for all panels (at least everything but the domain suspension / unsuspension if thats possible )Chris
__________________
OptimumServers » Managed Dedicated Servers & General Systems Management » Coming Soon! ProWebUK - Quality Web Services DirectAdmin Server Checklist |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Apache modules to limit the (cpu/ip/etc) usage [need help] | Canglan | Apache (WWW) | 4 | 10-01-2008 06:12 AM |
| Server crashing multiple times daily, started 5 days ago - please help | gkane | General Technical Discussion & Troubleshooting | 2 | 09-05-2007 11:20 AM |
| JM Stacy Freebsd Kernal Errors | goodgirl | FreeBSD 4.x | 10 | 08-08-2005 06:27 AM |
| Errors in daily report | RosT | DirectAdmin General Discussion | 1 | 07-30-2005 01:29 PM |
| Apache modules to limit the (cpu/ip/etc) usage [need help] | Canglan | General Technical Discussion & Troubleshooting | 0 | 01-18-2005 02:48 AM |