Looking for some advice please on this urgent issue as I don't know where to start.
Ok some basics - I have a Perl script that has been running quite happily on a reseller hosting account for about 10+ years without any issues. Recently the host informed us that the server was to be replaced and therefore PERL/PHP etc would be upgraded to the latest versions.
The migration to the new server went relatively smoothly and with a few file permission changes everything appeared to be running as it should.
Two weeks ago I received an email asking if I would take a look at the script as it was spawning multiple copies. Unfortunately I was away (still am) at the time and was therefore unable to take a look.
Today I found out that the day after I was sent the email and without any further communication the host renamed/suspended the script on my webspace as apparently it was causing serious issues. Obviously understand that a resource hungry script is not good on shared hosting but basically taking my site down without informing us is not the best move on the part of the host but I digress.
From what I have been able to determine from the host the problems are:
cgi script was causing considerable instability by running over a dozen copies and consuming large amounts of cpu.
Each instance of that process was attempting to eat 100% of a cpu core's run time and were observed to be able to live for 10-12 hours.
The host is adamant that this could not have been happening on the old server and as I say the script as far as functionality goes still displays & searches as it should.
Now as I am still away I would like to try and put a simple temporary fix into place to kill the processes after a certain length of time and/or to restrict the number of copies running.
I did dabble a bit into Perl when the scripts were first installed but that was over ten years ago and I have forgotten most of it.
Any suggestions as to what I should do now to put a temp fix into place would be greatly appreciated. Never had this problem before and am struggling to work out what to do without scrapping a script that works and brings money in.
If it's spawning multiple child processes that are consuming 100% CPU, even with your fix, you'll be significantly impacting that shared host every time it runs, and I'd be surprised if the script was still producing any reasonable results.
You would be better off disabling portions of the script, and then slowly enabling until you see the symptoms again, so that you find the calls which are sending it into a loop. You might find some small changes are needed for the new perl interpreter, this will be a much better long term fix than the proposal of killing off the processes, which may miss, and hose your provider's server again.