github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/schedulers.mdx (about) 1 --- 2 layout: docs 3 page_title: Schedulers 4 sidebar_title: Schedulers 5 description: Learn about Nomad's various schedulers. 6 --- 7 8 # Schedulers 9 10 Nomad has three scheduler types that can be used when creating your job: 11 `service`, `batch` and `system`. Here we will describe the differences between 12 each of these schedulers. 13 14 ## Service 15 16 The `service` scheduler is designed for scheduling long lived services that 17 should never go down. As such, the `service` scheduler ranks a large portion 18 of the nodes that meet the job's constraints and selects the optimal node to 19 place a task group on. The `service` scheduler uses a best fit scoring algorithm 20 influenced by Google's work on [Borg]. Ranking this larger set of candidate 21 nodes increases scheduling time but provides greater guarantees about the 22 optimality of a job placement, which given the service workload is highly 23 desirable. 24 25 Service jobs are intended to run until explicitly stopped by an operator. If a 26 service task exits it is considered a failure and handled according to the job's 27 [restart] and [reschedule] stanzas. 28 29 ## Batch 30 31 Batch jobs are much less sensitive to short term performance fluctuations and 32 are short lived, finishing in a few minutes to a few days. Although the `batch` 33 scheduler is very similar to the `service` scheduler, it makes certain 34 optimizations for the batch workload. The main distinction is that after finding 35 the set of nodes that meet the job's constraints it uses the power of two 36 choices described in Berkeley's [Sparrow] scheduler to limit the number of nodes 37 that are ranked. 38 39 Batch jobs are intended to run until they exit successfully. Batch tasks that 40 exit with an error are handled according to the job's [restart] and [reschedule] 41 stanzas. 42 43 ## System 44 45 The `system` scheduler is used to register jobs that should be run on all 46 clients that meet the job's constraints. The `system` scheduler is also invoked 47 when clients join the cluster or transition into the ready state. This means 48 that all registered `system` jobs will be re-evaluated and their tasks will be 49 placed on the newly available nodes if the constraints are met. 50 51 This scheduler type is extremely useful for deploying and managing tasks that 52 should be present on every node in the cluster. Since these tasks are 53 managed by Nomad, they can take advantage of job updating, 54 service discovery, and more. 55 56 Since Nomad 0.9, the system scheduler will preempt eligible lower priority 57 tasks running on a node if there isn't enough capacity to place a system job. 58 See [preemption] for details on how tasks that get preempted are chosen. 59 60 Systems jobs are intended to run until explicitly stopped either by an operator 61 or [preemption]. If a system task exits it is considered a failure and handled 62 according to the job's [restart] stanza; system jobs do not have rescheduling. 63 64 [borg]: https://research.google.com/pubs/pub43438.html 65 [sparrow]: https://cs.stanford.edu/~matei/papers/2013/sosp_sparrow.pdf 66 [preemption]: /docs/internals/scheduling/preemption 67 [restart]: /docs/job-specification/restart 68 [reschedule]: /docs/job-specification/reschedule