Login
You're viewing the functional.cafe public feed.
  • Oct 31, 2026, 11:15 AM

    It is such an obvious cause once you think about it, and yet before you hear about this, no software developer or maintainer ever considers the possible effects of e.g. a default Debian cron job setting may have on the global electricity grid.

    💬 18🔄 21⭐ 90

Replies

  • Oct 31, 2026, 11:36 AM

    @hzulla One does however wonder about the effect of switching domestic scale consumption/generation on the half hour when (in the UK) the electricity price changes. Obvs you want to switch your battery from fully charging to fully discharging exactly on the half hour because that makes you the most money ... but what if everybody does this?

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 2🔄 1⭐ 0
  • Oct 31, 2026, 12:34 PM

    @TimWardCam @hzulla Early adopters are unlikely to bring down the grid by themselves, and the big VPP players are expected to avoid herding also. This is for mainstream timed use, to smear those times.

    I haven't run HA, but inserting even a few seconds randomly before bringing on a timed big load will reduce demand slew rate, so I do it routinely, as I have for servers. Random numbers and primes are two of my favourite robustness tools.

    💬 1🔄 0⭐ 1
  • 💬 0🔄 1⭐ 0
  • 💬 0🔄 2⭐ 3
  • Oct 31, 2026, 1:08 PM

    @hzulla

    At google, the internal cron service has a "@" option in the crontab which effectively hashes the name and uses that to pick a value for the entry so it's stable for a given job but globally distributed.

    So instead of `0 0 0 * * *` for running a job daily at midnight, you would do `@ @ 0 * * *` to run it at a randomly chosen but stable time between midnight and 1 am.

    💬 1🔄 1⭐ 5
  • 💬 1🔄 0⭐ 0
  • Oct 31, 2026, 7:11 PM

    @DamonHD @hzulla

    I might have the order wrong but I'm pretty sure I put @ for seconds and minutes and 0 for hours which would start at a random but stable minute and second within the given hour

    💬 1🔄 0⭐ 0
  • Oct 31, 2026, 7:49 PM

    @gbargoud @hzulla we may be talking across one another here, but cron only goes does to minute resolution AFAIK; seconds can't be specified in any version that I've seen or used.

    💬 1🔄 0⭐ 0
  • Oct 31, 2026, 8:15 PM

    @DamonHD @hzulla

    Oh I must be misremembering that part then. It's been a while since I had to write a crontab and I always have to consult the comment at the top and then forget everything once I exit.

    💬 1🔄 1⭐ 0
  • 💬 0🔄 0⭐ 0
  • Oct 31, 2026, 1:43 PM

    @hzulla being in some of the very early hyperspace AI datacenter space, we were informed by the power company that they were going to disconnect us for drops and spikes that were significant enough to harm the turbines. Its mitigated now, but at that time when a massive jobs stops all gpus at once, then another job comes in right behind it and starts them all again it could literally break the generation

    💬 0🔄 0⭐ 1
  • Oct 31, 2026, 2:22 PM

    @hzulla

    Uhh...

    I certainly do. For the longest time I wondered what would happen if one deployed a malware that

    - synchronized clocks by NTP
    - shut down all affected systems at precisely the same time on the evening (so that power plants are ramped down quicker)
    - and at the time where normally the evening dip would turn upward suddenly turn on all those systems again (ACPI RTC wakeup) and launched some really CPU & GPU heavy load.

    💬 1🔄 0⭐ 0
  • 💬 1🔄 1⭐ 0
  • 💬 0🔄 0⭐ 0
  • Oct 31, 2026, 4:13 PM

    @hzulla

    The interesting question is if this randomisation might become necessary in case more and mor datacenters run more and more cron-jobs or other jobs historically timed at fixed hours?

    💬 0🔄 0⭐ 0
  • Oct 31, 2026, 4:15 PM

    @hzulla in the early Android days, cell network operators were confused by sudden stampedes on a regular schedule. Turns out, all phones were checking for OTAs roughly at the same time. Google didn't notice because to them it was noise and expected.

    💬 0🔄 0⭐ 0
  • Oct 31, 2026, 4:40 PM

    @hzulla

    UK tv broadcasters had to deliberately stagger their commercial breaks as everyone put the kettle on to make tea during the commercials. And non of that non-British 1kW kettle nonsense, proper British kettles are 3kW!

    💬 2🔄 1⭐ 3
  • Oct 31, 2026, 8:58 PM

    @maya_b And this is why most americans don't bother with kettles -- I don't know if our outlets can even supply 3kW -- and just heat up a cup of water in the microwave instead

    💬 0🔄 0⭐ 0
  • Oct 31, 2026, 8:59 PM

    @psymar

    13A on 240V is doable in most of Europe, but generally all the kettles I've seen outside the UK are only 1kw - or a hairdryer or microwave's worth of power.

    💬 0🔄 0⭐ 1
  • 💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Nov 1, 2026, 6:10 AM

    @psymar @maya_b

    Yes, in the USA, we have 120V through 14g sized wire, which is good enough for about 15 amps. I measure about 1600 watts for devices that claim 1800 watts. Some outlets are rated for 20 amps and those should be wired with 12g sized wire, or property damage is much more likely. For the stoves and clothes dryers, 10g sized wire is used at minimum, rated for 30 amps.

    Imagine if all car chargers started at EXACTLY the same hundredth of a second, on the same rising phase of the waveform. You would be able hear the power company turbines ring like a bell from the magnetic hammer.

    💬 0🔄 4⭐ 2
  • Nov 1, 2026, 5:08 AM

    @maya_b
    Got this from a Danish power plant operator many years ago: They were of course not allowed TV or anything distracting in the control room, so they couldn't watch the big football internationals. They still knew the result as soon as the game ended.

    If Denmark had won, people would watch the TV a bit longer, enjoying the moment. If Denmark had lost, everybody would turn off, get up and put on the coffee machine right away. The load spike was noticeable.
    @hzulla

    💬 0🔄 2⭐ 1
  • 💬 2🔄 0⭐ 0
  • 💬 0🔄 2⭐ 1
  • 💬 0🔄 0⭐ 0
  • Nov 1, 2026, 6:08 AM

    @maya_b @hzulla I have heard stories about both power and plumbing system impacts from halftime/commercial breaks during major sporting events like the super bowl

    💬 0🔄 0⭐ 0
  • Oct 31, 2026, 8:47 PM

    @hzulla Cron, of course, dates back to a world in which:

    - computers were a significantly smaller part of the load on the power grid
    - we didn't have tightly synchronized clocks everywhere (no NTP yet)
    - we didn't have architectures in which power consumption was as tightly linked to computational load

    Software often outlives all sorts of assumptions!

    💬 6🔄 11⭐ 0
  • Oct 31, 2026, 9:06 PM

    @mattblaze @hzulla

    yup. there is a point at which "expected" or "normal" traffic is a self DDoS if you do enough of it at once.

    i always found it useful when planning capacity to take the "expected" and ask "what happens if i add two zeros to that amount".

    💬 1🔄 1⭐ 0
  • Oct 31, 2026, 9:19 PM

    @paul_ipv6 @mattblaze @hzulla My original load projection for Netnews, back when we were designing it in late 1979, as “1–2 messages a day, from 50-100 computers, mostly about Unix system internals”… I was off by far more than two orders of magnitude, of course, which is why I never went in for traffic forecasting.

    💬 1🔄 2⭐ 0
  • 💬 0🔄 1⭐ 0
  • 💬 3🔄 1⭐ 0
  • 💬 1🔄 0⭐ 0
  • Oct 31, 2026, 9:34 PM

    @mattblaze @SteveBellovin @hzulla we, Windows, see measurable megawatt changes when we do good or bad on perf across the datacenters. It's fascinating to get a report back saying we reduced a megawatt of usage by changing a poll from say one minute to five. Also update reboots. 🥴

    💬 0🔄 3⭐ 12
  • 💬 0🔄 0⭐ 0
  • Nov 1, 2026, 12:20 AM

    @SteveBellovin @mattblaze @hzulla In the late 1990s I worked at a place that had a hundred or so systems all using the same file server. We used a simple wrapper for cron jobs run by all systems to smear out the impact: extract low octet of IP address, sleep that many seconds before starting.

    Nowadays I manage about 300 systems, but net and CPU and storage are fast enough that we don't get crowd-load effects. If we did I'd repeat the scheme but sleep N/10 or N/100 seconds.

    There's something to be said for changing cron to insert small random delays. I don't think it often (if ever) matters if a job starts a fraction of a second, or even a few seconds, after the exact start of the minute.

    💬 1🔄 1⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • ChuckChuckMcManis@chaos.social
    Oct 31, 2026, 9:29 PM

    @mattblaze I suspect the full text of the 'law' would be

    "Software outlives the assumptions about what is 'true' when it is written."

    I remember being told not to consider 'residential to corp' use of SunRPC because that would presume *everyone* had at least a T-1 line's worth of bandwidth.

    @hzulla

    💬 0🔄 0⭐ 0
  • 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
  • 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
  • Nov 1, 2026, 8:38 AM

    @mattblaze @hzulla I think we need to add "Software often outlives all sorts of assumptions" to one of the "Falsehoods programmers believe about…" awesome lists – perhaps under "Falsehoods programmers believe about time (yes, even astronomers)"… 🙃

    💬 0🔄 0⭐ 0
  • Nov 1, 2026, 1:13 PM

    @mattblaze @hzulla I doubt cron is a relevant part of it.
    From the article: "In Ireland, for example, where data centres with large-scale battery storage systems currently account for around a fifth of the country’s electricity demand, the amplitude of the 1-minute signal quadrupled between 2016 and 2021"

    💬 0🔄 0⭐ 0
  • Oct 31, 2026, 9:09 PM

    @hzulla The bit that surprises me is that the effect was turned up be researchers looking at grid-scale rather than coming up in the observations of one or more of the large-scale server operators. Datacenter power delivery and backup systems aren't cheap, servers have had pretty decent onboard power metering for a while; and there have certainly been setups with thousands to tens of thousands of homogenous builds well before the current 'AI' craze.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Oct 31, 2026, 9:19 PM

    @hzulla@infosec.exchange I recall a toolchain maintainer mentioning environmental concerns as one reason he insists on shipping binary packages over source packages (as those would have a building cost on every user of the toolchain) in a conversation with me.

    💬 0🔄 0⭐ 0
  • Nov 1, 2026, 12:26 AM

    @hzulla since I saw the effects of a "thundering herd", where ten thousands of nodes in a large SaltStack-driven infrastructure all acted at the very same millisecond gave us major headaches, I will always think twice before scheduling anything.
    Luckily, many schedulers allow now for mitigating those kind of issues by defining some randomness for distributing the load across a defined timespan.

    💬 0🔄 0⭐ 0
  • Nov 1, 2026, 1:23 AM

    @hzulla more for constraints on local compute capacity than the global power grid, but I can't be the only sysadmin who routinely staggers recurring jobs likely updates or backups to kick off at semi-random times like 02:17, 03:43, etc., based on exactly this sort of reasoning… 🤔

    💬 0🔄 0⭐ 0