Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server that runs several PHP scripts during the night to keep in sync with an other server.

The load systematically reaches over 3.5 but then comes back to more reasonable values after the scripts end (15 min).

The server is multi-core.

Should I bother to fix the scripts ?

share|improve this question
Before choosing a solution to "go with" i'd understand what kind of load it is. Is it purely CPU load? Waiting for disk I/O, aka iowait? Not all load is purely CPU working at max. Wikipedia has a good article on the subject. - Some could turn this comment into an answer, i don't have the time at the moment. – artifex Jul 27 '11 at 19:00
Wait, your load is 3.5 and you're on a multi-core box. How many cores? If your load is less than the number of cores, why do you care? If the loadavg < #cores, isn't a core still waiting around for something to do? – Magellan Jan 27 '12 at 16:08

If the scripts aren't causing problems (sucking up resources that other processes need), and they aren't taking too long, then I wouldn't bother fixing them unless you have some spare time. Put it on your issues list, in case the running of these scripts does start to impact other processes.

share|improve this answer
I agree. A few spikes in the off hours are fine, as long as important things don't grind to a halt. You can always use nice to keep the scripts from eating all the cycles...Might double the run-time, but if performance isn't impacted, so what? – Satanicpuppy Jul 27 '11 at 17:59

I've been going over similar issues with the developers at $Dayjob.

Yes. Fix the scripts. Optimize them, before you consider improving any hardware. That's the easiest fix.
Once you've got the scripts behaving, look at how you can tune the hardware to perform better.

Once you've done that, look at how to improve the scripts to run distributed over multiple servers.

I know it's vague, but so was your question. Basically, rewrite everything until it works perfectly.

share|improve this answer
That's the other way to look at it. Since he said this a night-time job to sync some things, I'm running on the assumption that fixing them might be a premature optimization. – mfinni Jul 27 '11 at 17:10
I don't buy that. That way they'll never get fixed. – Tom O'Connor Jul 27 '11 at 17:12
Premature optimisation is doing it while you write it. He's asking here, so that's not premature. – Tom O'Connor Jul 27 '11 at 17:12
Consider also that the load peak might be indicative of a lurk problem. – artifex Jul 27 '11 at 18:55
What's a Lurk Problem? – Tom O'Connor Jul 27 '11 at 22:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.