0

In Hashicorp Nomad, one can run a batch job on a periodic plan following a cron-expression.

The granularity of that cron expression is 1 second.

I'm trying to find the limit of scheduling abilities in Nomad.

In particular, I'm trying to see if having a job scheduled to run every second that takes 2 seconds to complete is a good use case for Nomad.

What I could find so far:

Jiehong
  • 786
  • 1
  • 7
  • 16
  • What is your actual use case? I mean why do want to run some batch job every second? Also what is your setup, how many different Nomad clients do you have? What driver do you use in the job file configuration? I suspect that Nomad would be able to [fullfill your needs](https://www.hashicorp.com/c2m) (also [this video](https://www.youtube.com/watch?v=1Ta69dTbWRw&ab_channel=HashiCorp)), but I don't think it is the right tool for your use case. – Ilya Kisil Jun 30 '23 at 18:38
  • I was imagining running nomad jobs for heartbeat/pinging things on a periodic basis. So an actual job would be more like every 10s of seconds, and run for 10s of seconds at most. Just wondering about the scheduling overhead (assuming maybe a cached docker image as a driver or a raw_exec of a single binary) – Jiehong Jul 05 '23 at 12:01
  • And why do you need to stop process that checks heartbeat or something? why not to keep the binary doing those checks alive instead of running it on schedule? Depending of what you actually need and the overall setup you might consider running [httpx](https://github.com/projectdiscovery/httpx), or if you already have Consul server setup then you can consider [consul-esm](https://www.hashicorp.com/blog/consul-and-external-services) or even the consul agent itself if you have have access to the infra you want to ping. – Ilya Kisil Jul 05 '23 at 17:16
  • 1
    `The granularity of that cron expression is 1 second.` I do not understand, why not just try it? – KamilCuk Jul 10 '23 at 23:23

0 Answers0