Login
You're viewing the functional.cafe public feed.
  • Nov 1, 2026, 8:21 AM

    @mattblaze @hzulla Which Cron? I mean there are, for good reasons, many different versions of Cron out there. There are Crons that target specific use cases the original writers didn't consider (like having computers that are turned off or in standby from time to time).

    That's the wonderful thing about Free Software. It's not a "product" but instead a chorus of competing ideas and forks which explore new things.

    💬 1🔄 0⭐ 0

Replies

  • Nov 1, 2026, 10:11 AM

    @casandro @hzulla Um, if open source or free software or whatever buzzword the kids are calling it these days solves this problem, why wasn’t it solved already? As you pointed out, cron’s code has been re-implemented many times over the years.

    Open source is nice and all, but it didn’t anticipate or solve this.

    💬 1🔄 0⭐ 0
  • Nov 1, 2026, 5:15 PM

    @mattblaze @casandro @hzulla This isn't really a problem that requires changes in the software but rather changes in the way it's used. There is no escaping the necessity of *some* tasks being scheduled at the exact times provided by the various crons. I used to run a fairly big website on meagre hardware and had to dither a lot of scripts to spread CPU load out, this included cron jobs. This also smoothes the power draw.

    💬 2🔄 0⭐ 0
  • Nov 1, 2026, 5:46 PM

    @synx508 @casandro @hzulla yes, exactly. The software changes required to have cron behave in a way that’s more friendly to the power grid are relatively trivial here. The issue is (apparently) that no one realized (or cared) that synchronized surges in computation can now have a measurable impact at scale (which is an interesting effect).

    💬 1🔄 0⭐ 0
  • Nov 1, 2026, 5:53 PM

    @mattblaze @casandro @hzulla I was aware at the time, this was 20 years ago, I wondered about the effect on the data centre's power distribution back then as we did have metered power as well as data transfer. It wasn't my primary motivation, though. The British anecdote about TV viewers putting the kettle on during half-time of football matches or after a particular soap on TV was quite well known so that scaling effect was, too, but with a different cron engine - television schedules. We didn't have many channels to choose from before the 1980s so the effect was likely more pronounced then.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Nov 1, 2026, 6:12 PM

    @casandro @mattblaze @hzulla You can do that by wrapping anything called by cron in a "sleep random number of seconds" script, it's trivial and it's not worth adding complexity to cron for in my opinion. Tools should be simple and easily understood.

    💬 2🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1
  • Nov 1, 2026, 6:26 PM

    @casandro @mattblaze @hzulla I don't think it'd be significant compared to what *could* be unleashed by a cron job starting but I agree, there would be something measurable and consistent. If you really wanted to, the wrapper could be a binary and load from RAM disk, I guess you still have the log to consider, there's no getting away from it. Then even checking the time has a small electrical cost, I suppose you can't remove granularity completely.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Nov 1, 2026, 6:22 PM

    @casandro @mattblaze @hzulla wrapping scripts or modifying scripts isn't what I'd call complex and is "self-declaring" and doesn't change the underlying behaviour of cron, which is something you mostly don't want because a lot of things it does *must* be done at exact times.
    If you modified the syntax of crontab so particular lines had the time dither switch that would be potentially complex, if you change defaults so you had to specify "exact" that would be even worse. It's likely not complex in implementation within cron, it's complex in implementation in the real world where this stuff is old and established and making changes like that could be misconstrued etc.

    💬 1🔄 0⭐ 0
  • Nov 5, 2026, 5:40 AM

    @synx508 OpenBSD's cron lets you specify ~ in time specs to randomize when something runs, "to avoid a thundering herd at the top and bottom of the hour". Is that not a normal cron feature these days or just not widely enough used?

    man.openbsd.org/crontab.5
    > A random value for a field may be obtained using the ‘~’ character. A value is generated every time the tab is loaded. On its own, it denotes a random value appropriate for the field. It can also be used in a range to make the interval more specific. If either of the numbers in a range are omitted, the appropriate limit (low or high) for that field will be used. For example, both “0~30” and “~30” in the minute field would result in a random value between 0 and 30.

    @casandro @mattblaze @hzulla

    💬 0🔄 0⭐ 0