News for hackers. Stuff that matters.
Re:Executing Cron Scripts Reliably at Scale by Scubabear68 on Wednesday January 31, 2024 @07:41PM (#39211574)
I can’t believe an org of Slack’s size relied on cron scripts for anything critical. It is the worst possible way to schedule jobs at scale. Serious problems with discoverability, single points of failure, and failure mode options.

Also surprised they didn’t just use an open source scheduler or product. There are a gazillion of them.

Re:Executing Cron Scripts Reliably at Scale by dimgl on Wednesday January 31, 2024 @08:02PM (#39211713)
Why is this so hard to believe? This is proof that simple software can scale very well. Your takeaway, IMO, should be that a lot of solutions are over-engineered relative to the businesses they serve. Not every company handles Slack's scale.
Re:Executing Cron Scripts Reliably at Scale by Scubabear68 on Wednesday January 31, 2024 @08:09PM (#39211754)
Hard to believe because I have seen the cron dumpster fire at so many companies. Random cronjobs running on random boxes ends up with mystery jobs whose existence often goes unnoticed as people leave the org and docs are out of date. Random accounts with different cron jobs, with no visibility from one account to another. Box failure leads to mystery jobs failing with no way to figure out what happened. No “advanced” features like retry and retry with exponential back off. No database with job history. No parallelism.

Every place I have worked cron turned into a dumpster fire.

Re:Executing Cron Scripts Reliably at Scale by teaearlgraycold on Wednesday January 31, 2024 @09:05PM (#39212042)
Or you could have a canonical cron box.
Re:Executing Cron Scripts Reliably at Scale by djbusby on Wednesday January 31, 2024 @09:16PM (#39212105)
Or a fleet? Some of the problems up-thread feel organizational rather than tooling.
Re:Executing Cron Scripts Reliably at Scale by baq on Thursday February 01, 2024 @01:55AM (#39213381)
No matter what they tell you, it’s a people problem.
Re:Executing Cron Scripts Reliably at Scale by doubloon on Wednesday January 31, 2024 @10:18PM (#39212410)
i will see your rando cron box and raise you Excel VBA macros run on Windows Task Scheduler on a spare machine in a cubicle.
Re:Executing Cron Scripts Reliably at Scale by mkarrmann on Wednesday January 31, 2024 @10:38PM (#39212507)
Never forget that the world economy is probably being held together by a handful of these.
Re:Executing Cron Scripts Reliably at Scale by baq on Thursday February 01, 2024 @01:54AM (#39213376)
A boatload. Couple. Panamax or bigger. Otherwise agreed.
Re:Executing Cron Scripts Reliably at Scale by mdekkers on Thursday February 01, 2024 @01:55AM (#39213382)
Sure, but those are organisational failures, not technical failures. If you need better technology because the org sucks at planning, the tech isn’t the issue and you are just sweeping issues under the carpet.
Re:Executing Cron Scripts Reliably at Scale by reactordev on Wednesday January 31, 2024 @09:28PM (#39212180)
It’s no longer simple when you have platform code to prevent nodes from disappearing or dying on the minute on a kubernetes cluster the size of slack. A triggered pulse event stream would have done the trick to invoke a lambda or call code for every “thing” that needed a beat. Kubernetes comes with a scheduler…
Re:Executing Cron Scripts Reliably at Scale by zerbinxx on Wednesday January 31, 2024 @11:19PM (#39212676)
This is my take as well, just because you can get away with something doesn’t necessarily make it desirable to maintain or extend, and I honestly cannot imagine the effort in terms of labor hours that you’d have to go through to develop something like this compared to just plugging in an off-the-shelf scheduler to something slightly more sophisticated like k8s or even just a worker-and-queue system. When you’re talking about platform engineering to solve a problem that a relatively extensible Celery service could do (and have tests and such), I have no idea how the former could be “less work” or cheaper in the long haul.
Re:Executing Cron Scripts Reliably at Scale by Scubabear68 on Wednesday January 31, 2024 @10:08PM (#39212370)
Cron scaling? Seriously?

By definition cron does not scale, it is account by account per VM/machine with no rhyme or reason.

Re:Executing Cron Scripts Reliably at Scale by Supermancho on Wednesday January 31, 2024 @10:57PM (#39212589)
Alternately, if you define cron as a starting/startup point, an expectation when scaling, then simple format for a job queue, the context of the post is understood.
Re:Executing Cron Scripts Reliably at Scale by baq on Thursday February 01, 2024 @01:56AM (#39213393)
Yeah that’s the point. If managed properly, turns out it can handle a $20B tech company.
Re:Executing Cron Scripts Reliably at Scale by ohnoesjmr on Wednesday January 31, 2024 @08:27PM (#39211858)
Can you name some?

I've been looking for software in that space, a thing that runs cronjobs, with ability to kick off adhoc runs from some UI, see what is running, and if possible parameterise the custom runs (i.e., run an ad-hoc report for a different client than usual cron does)

Re:Executing Cron Scripts Reliably at Scale by 8organicbits on Wednesday January 31, 2024 @11:48PM (#39212807)
There's a lot to expore here. First, I'd suggest that cron and shell scripts may not be what you want. Cron has a complex format for scheduling and can lack features like sub-minute level scheduling, maintenance windows, and other task cadences. Shell scripts are OK for small things, but often I find I move to a different language if I keep something around long enough. Do the people writing jobs know shell?

For jobs run by data analysts, airflow and python work great. For devops jobs, begrudgingly, Jenkins or GitHub Actions. But there's so many varieties.

Re:Executing Cron Scripts Reliably at Scale by sciurus on Wednesday January 31, 2024 @10:11PM (#39212376)
I almost hate to say it, but Jenkins.
Re:Executing Cron Scripts Reliably at Scale by magarnicle on Wednesday January 31, 2024 @11:20PM (#39212679)
That's what I did. I know it was the right solution because I happily keep adding more and more scripts to run. I didn't do that when I was using cron jobs.

Plus, Jenkins has a few nice extensions to the crontab, including setting a timezone and using "H" to spread job execution load.

Re:Executing Cron Scripts Reliably at Scale by djbusby on Wednesday January 31, 2024 @09:18PM (#39212118)
Build the UI or API for the report, so you can ad-hoc from there. Cron uses that interface. You don't custom the cron, you cron the custom.
Re:Executing Cron Scripts Reliably at Scale by fukawi2 on Wednesday January 31, 2024 @11:27PM (#39212715)
Rundeck fits this space.
Re:Executing Cron Scripts Reliably at Scale by baq on Thursday February 01, 2024 @01:58AM (#39213405)
GitHub actions.

I almost suffocated from all the yaml typing this, but unfortunately it’s the baseline.

Re:Executing Cron Scripts Reliably at Scale by otabdeveloper4 on Thursday February 01, 2024 @01:48AM (#39213345)
> There are a gazillion of them.

Such as?

Re:Executing Cron Scripts Reliably at Scale by mdekkers on Thursday February 01, 2024 @02:03AM (#39213434)
> It is the worst possible way to schedule jobs at scale.

The literal evidence proves that this approach is absolutely workable at scale, so “the worst possible way” clearly doesn’t apply.

The interesting question here is “how did they make this work?” The answer to which is immensely valuable to the technical community at large. “What are they building next?”, whilst interesting, is less immediately valuable as they will be building something Slack-scale, and most orgs are not Slack or Slack-scale

Re:Executing Cron Scripts Reliably at Scale by krisoft on Thursday February 01, 2024 @03:44AM (#39213916)
> The literal evidence proves that this approach is absolutely workable at scale, so “the worst possible way” clearly doesn’t apply.

The “worst possible” to me implies that it is possible.

Think about trying to solve the same problem by hurling engineers into an erupting vulcano. It is expensive, hurts the morale, causes staff retention issues, but also fundamentally does not solve the task of scheduled task running. I would not describe that as “worst possible” because it lacks the second factor by not being a possible solution.

Re:Executing Cron Scripts Reliably at Scale by blitzar on Thursday February 01, 2024 @04:44AM (#39214237)
Survivorship bias.

Organisations that cobble together cron scripts for critical apps become an "an org of Slack’s size".

Companies that deploy solutions that handle all the problems with discoverability, single points of failure, failure mode options and interplanetary multi species scale when they have 0 coustomers never become "an org of Slack’s size".