[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Niced cron jobs



Craig Sanders <cas@taz.net.au> writes:
> niced cron jobs [can be] disastrous on heavily loaded servers that
> never have any idle time to service the niced jobs....  this is not
> just speculation, it's experience. i've seen it happen because i've
> tried it myself.

Very interesting real world info.  (Of course, NOT using nice still
doesn't guarantee that jobs will complete within (even lengthy)
realtime constraints.)

> most cron jobs are written with the assumption that only one
> instance will be running at a time, which can cause locking or other
> contention problems

Such cron jobs are arguably buggy.

Well, I don't have a firm opinion on this issue, but here are a few
points to consider:

- Preventing multiple jobs can be done by using Anacron instead of
  cron.

- If we use a default nice level for cron (and Anacron jobs), the
  local admin can, of course, change it.  Specifying the default nice
  level in a single place would make changing it easier.

- Different kernels schedule tasks differently.  So, e.g., nicing
  something by 10 levels results in slightly different behavior on a
  Linux 2.0 kernel vs. a 2.2 SMP kernel.  (And what about non-Linux
  Debian systems?)  These differences should ordinarily be
  inconsequential, but folks with very heavily loaded systems like
  Mr. Sanders could be affected by slight differences in the meaning
  of priority levels.

-ccwf


Reply to: