OK. I think it should be possible to test the script on non-production machine. If so, then you can search bottleneck by commenting out different pieces of code until the heavy load cases disappear.
Pay more attention to regexps that can be bad written like this
('ab' x 3000 . 'c') =~ /.*ab.*c/; # fast if can match ('ab' x 3000) =~ /.*ab.*c/; # very very very slow if no match
In reply to Re^3: Debugging running processes
by ccn
in thread Debugging running processes
by kappa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |