Hello,
I need an script for restart mysql service when server load is more than 10
Help me please.
Hello,
I need an script for restart mysql service when server load is more than 10
Help me please.
Regards,
Masood Yarmohammadi
This is an odd request. If your mysql failed, it will start automagically via cpanel scripts. If your mysql is causing the load of 10 or above, then you should consider fixing or eliminating the querys causing this issue or optimize your my.cnf or both. Interrupting service with restarts as a fix is not a good policy.
Correct me if I'm wrong but I think you have that backwards. Sounds like you need a script that'll kill anything causing server load to spike.
This should help there. http://www.configserver.com/cp/csf.html
You'll want to use PRM
http://rfxnetworks.com/prm.php
You can set the server load per application and restart limits.
Upload Guardian 2.0 - Sign up for our early beta
ServerProgress - Server security, consulting and assistance
You might want to read up on CSF a bit more I think. From the install.txt:
http://www.configserver.com/free/csf/install.txt
If you would like to disable APF+BFD (which you will need to do if you have
them installed otherwise they will conflict horribly):
sh disable_apf_bfd.sh
That's it. You can then configure csf and lfd in WHM, or edit the files
directly in /etc/csf/*
Hi,
I install and configure RPM. it's a great tools.
After install, followin email send for me from my server:
What's this? process no 8507 killed by RPM or must kill manually?Code:This is an automated status warning from linux.myserverhosting.us. The process (8507) has exceeded defined resource limits, as such a kill signal was invoked from the process resource monitor. - Event Summary: USER: ikaooe PID : 8507 CMD : /usr/bin/php CPU%: 0 (limit: 40) MEM%: 0 (limit: 20) PROCS: 246 (limit: 25)
Regards,
Masood Yarmohammadi
Its saying PRM killed it for you.
Thank you.
I have new problem with RPM, can you help me?
RPM kill apache proccess more than 150 on my server and it's not good, because apache is down and must start again. So, i can add nobody in RPM ignore list for resolve this issue, but it's not good too, because nobody user can run many proccess and RPM can't kill this.
How can resolve this issue?
- Event Summary:
USER: nobody
PID : 6349
CMD : /usr/local/apache/bin/httpd
CPU%: 0 (limit: 65)
MEM%: 0 (limit: 25)
PROCS: 250 (limit: 150)
Regards,
Masood Yarmohammadi
you can always use this and put it in a cronjob (save file as load.pl for example)
#!/usr/bin/perl -w
#use strict;
$|++;
open(LOAD,"/proc/loadavg") || die "couldn't open /proc/loadavg: $!\n";
my @load=split(/ /,<LOAD>);
close(LOAD);
if ($load[0] > 9) {
`/sbin/service httpd restart`;
}
just change the httpd to the service you want restarted, but if it's a script that causes the high load i would restart httpd.
Cheers,
pirrup
Last edited by pirrup; 02-25-2008 at 11:59 AM.
Looks goodPHP Code:#!/usr/bin/perl -w
#use strict;
$|++;
open(LOAD,"/proc/loadavg") || die "couldn't open /proc/loadavg: $!\n";
my @load=split(/ /,<LOAD>);
close(LOAD);
if ($load[0] > 9) {
`/sbin/service httpd restart`;
}
Is there a way to have it email us and tell us if it restarts - (only if it restarts?)
also - is there a way to tell it not to restart unless the load is over say 4 or 5
glenn
![]()
Feel like your Cloud Provider's just weathering the storm? Hop Off the Cloud - The Weathers nicer over here.
An example:
(This values are defined by the user admin)
X = 5
Y = 10
Using the values:
If load < 5 exim and httpd then both are working
If 5 < load < 10 then exim is stopped but httpd is working
If load > 10 then exim and httpd are stopped
When the load downs:
If 5 < load < 10 then httpd is restarted
If load < 5 then exim is restarted (exim and httpd are working)
The email messages obviously are sent when exim is working