Server problem, maybe related with VaultWiki
I'm really not sure is this have any connection with VaultWiki, but I'll ask here, just in case.
My server started to have problems, this is description I asked my server support, but it's very limited, I'm on unmanaged server:
---------
Yesterday around 17:00 hours (European, Berlin time) I noticed that server is overloaded.
Before that I didn't installed anything on server or on my site (vBulletin forum) for days. Also, I didn't noticed anything strange in any log, at least as I can read it.
I started monitoring it and this is what happens:
One Apache webserver process for some reason goes to 100% processor load and completely chokes one processor core. This happens about every 7-8 minutes to one webserver process, choking one core. As I have 4 cores, it takes about half an hour to choke almost completely processor.
I tried to reboot server, it helped, but not for long as it continued to happen every 7-8 minutes to one core.
Then I tried to restart webserver process (httpd), this also helped temporarily as every 7-8 minutes one process would go to 100% and choke one core.
Something not logged in error log hangs one httpd process which in turn blocks one core. And apache couldn't recover out of it.
I also tried to reduce MaxRequestsPerChild hoping that it would solve problems by killing sooner httpd processes. Didn't help anything.
Now I tried to employ Monit (program to monitor different processes on server) to automatically restart Apache, but it didn't worked out as I hoped. It restarted Apache only once.
As I said, I didn't worked on server, site, touched anything. I don't know if it is some kind of attack from outside that is able to crash Apache process, or there is something changed in hardware, but please help me. As time goes server is less and less responsive.
------------------
This is why I'm contacting you:
I received this response from server support at the end:
----------
OK, as a final resort, I have checked the processes via strace. The trouble process seems to be doing some rather strange things, it seems to primarily stay in the /var/www/vhosts/slobodni.net/httpdocs/vault/ directory. The process appears to be doing the same thing over and over again:
"/var/www/vhosts/slobodni.net/httpdocs/vault/functions/bbcode/handle.php"
"/var/www/vhosts/slobodni.net/httpdocs/vault/class/bbcode/autolink.php"
"/var/www/vhosts/slobodni.net/httpdocs/includes/functions_login.php"
"/var/www/vhosts/slobodni.net/httpdocs/vault/class/bbcode/autolink.php"
"/var/www/vhosts/slobodni.net/httpdocs/vault/functions/bbcode.php"
"/var/www/vhosts/slobodni.net/httpdocs/includes/functions_login.php"
"/var/www/vhosts/slobodni.net/httpdocs/vault/functions/bbcode/handle.php"
"/var/www/vhosts/slobodni.net/httpdocs/vault/class/bbcode/autolink.php"
"/var/www/vhosts/slobodni.net/httpdocs/vault/functions/bbcode.php"
"/var/www/vhosts/slobodni.net/httpdocs/includes/functions_login.php"
"/var/www/vhosts/slobodni.net/httpdocs/vault/functions/bbcode/handle.php"
This is about the only thing this process does, whereas the other processes, seem to be people.
Unfortunately, I don't believe there is much else we can help you with here. These are UNmanged servers, server administration is your responsibility.
---------------
Now I see you posted new version of VaultWiki. Is it possible that there's a check every 7-8 minutes or so that calls your site and somehow it messes with my Apache server process driving them to 100% and choking my server? Or something like that? Connected somehow with you?
I'm just asking, I'm tried to turn off VaultWiki, didn't helped, but not sure what really could be wrong, so I thought to ask...
And, just to ask you, if you could help me, you maybe know how to program script to automatically kill runaway process with cron. I found out this site with similar script: http://www.squidoo.com/cron-kill
*/10 * * * * username ps -o sz,etime,pid,comm,args -U username | grep scriptname.php | grep -v grep | perl -ane '($m,$s) = split /:/,$F[1]; $kb=$F[0]; $pid = $F[2]; if(($m>3)&&($kb>10000)) {print "$m :: $s $kb $pid\n"; kill 9, $pid;}'
Of course, my script should check for process overload, using something like:
ps -o sz,pid,comm,args,%cpu -U apache
And if %cpu is over 90, kill that process.
Can you maybe help me with script like this?