I have a "generate website" command, that parses through all the tables to republish an entire website into fixed html pages. That's a heavy process, at least on my local machine (the CPU rises up). On the production server it does not seem to be a problem so far but i would like to keep it future proof. Therefore i'm considering using the php sleep() function between each step of the heavy script so that the server has time to "catch its breath" between the heavy steps.
Is that a good idea or will it be useless?
If you're running php5, and it's being used in CGI (rather than mod_php) mode, then you could consider using proc_nice
instead.
This could allow the "generate website" command to use as much CPU as it wants while no-one else is trying to use the site.