Live data from Hacker News

Show HN: I built a cron job scheduler

blog.cronhub.io

21–30 of 50 posts

Re: Show HN: I built a cron job scheduler

#22
post #3

You realized that there are already free alternatives like https://cron-job.org/en/ on the market?! I - personally - would never pay for a cron job service ...

I’m sure plenty of people thought the same thing about statuspage, yet they seem to be doing fine. People like easy and centralized. I think it’s a great idea, and there’s room for value-adds later down the line.

Re: Show HN: I built a cron job scheduler

#24
post #3

You realized that there are already free alternatives like https://cron-job.org/en/ on the market?! I - personally - would never pay for a cron job service ...

Cron is such an important piece of your infrastructure. Are you sure you want to depend on a free service for this?

Re: Show HN: I built a cron job scheduler

#25
post #24
post #3

You realized that there are already free alternatives like https://cron-job.org/en/ on the market?! I - personally - would never pay for a cron job service ...

Cron is such an important piece of your infrastructure. Are you sure you want to depend on a free service for this?

People can select multiple cron vendors for critical flows, this helps make sure we could notice when one vendor doesn’t silently goes down.

Re: Show HN: I built a cron job scheduler

#26
post #16
post #6

Earlier quoted context omitted.

In many cases, paying for a service you could do yourself is more about having a throat to choke in case something goes wrong. I'm sure I could figure out cron/crontab if I took the time to learn about it but that's not my core skillset so paying $5/month is actually rather cheap for me (especially when the cost is passed along to a client who is less skilled at these things than I am).

And what happens when this service you depend on gets shut down for whatever reason?

I get to bill the client for moving them to another service.

Re: Show HN: I built a cron job scheduler

#28
Unfortunately, it's still missing the main cron-killer feature: randomized intervals.

I have 200 servers that I need to run some task every 3 hours. But I don't want them to all run at the same time. I need options to either "start this task at some point randomly in the next 3 hours, then every 3 hours thereafter" or "run this task randomly in every 3 hour block", without resorting to manually tweaking hour/minute run times on every server.

Re: Show HN: I built a cron job scheduler

#29

Unfortunately, it's still missing the main cron-killer feature: randomized intervals. I have 200 servers that I need to run some task every 3 hours. But I don't want them to all run at the same time. I need options to either "start this task at some point randomly in the next 3 hours, then every 3 hours thereafter" or "run this task randomly in every 3 hour block", without resorting to manually tweaking hour/minute r…

As a workaround, sounds like you need a deterministic pseudo-random number generator.

Find a value that is unique to each server (e.g. the UUID of the / partition?) to seed your PRNG, and then generate the first pseudo-random number. If you do it right, it will always be the same number.

Modulo this number against the number of (seconds|minutes|hours) of random delay you want applied, and apply a sleep timer to the start of the job based on that result.

It's dirty, but it ensures

* each server gets its own random interval from the start time

* that random interval never changes

* the server runs the job on a regular schedule

There are probably better ways of doing this, but this is the first thing I could think of that doesn't require any crazy libraries and can be done using standard linux utils that are on all machines.

I'd love to hear any better ways that people have!

Post reply on HN