-
Notifications
You must be signed in to change notification settings - Fork 108
/
configuring-delayed-job-priorities.html.md.erb
119 lines (67 loc) · 3.55 KB
/
configuring-delayed-job-priorities.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
title: Configuring delayed job priorities with Cloud Controller
owner: CAPI
---
You can change the priority of delayed jobs with the Cloud Controller in <%= vars.app_runtime_first %>.
## <a id='overview'></a> Cloud Controller and job priority
<%= vars.app_runtime_first %> creates delayed jobs as it performs certain asynchronous actions, such as `DELETE v3/buildbacks/[GUID]`. These jobs are
processed asynchronously by multiple worker processes.
By default, all jobs have the same priority of `0`. Job priorities of higher numerical values are lower than job priorities of lower numerical values.
Conversely, job priorities of negative numerical values are higher than job priorities of positive numerical values. For example, the Cloud Controller
schedules a job with a priority of `-1` before a job with a priority of `0`, and schedules a job with a priority of `1` before a job with a priority of `0`.
When a job fails, the Cloud Controller might reschedule the job and give it a lower priority, depending on how the job is configured. When the Cloud
Controller reschedules a failed job and gives it a lower priority, it doubles the priority each time the job fails: first from `0` to `1`, then to `2`, then
`4`, then `8`, and so on. Each time a job receives a lower priority, the time until the Cloud Controller schedules its next run increases accordingly. In the
logs for some Cloud Controller components, this scheduled time appears in the `run_at` column of the `delayed_jobs` table.
When a job with a priority of negative numerical value fails multiple times, the Cloud Controller lowers its priority to `0`, then doubles its priority
afterward.
## <a id='delayed-jobs'></a> Delayed jobs
In the logs for some Cloud Controller components, you can view a jobs that have been delayed in the `delayed_jobs` table.
The following list contains the `display_name` of each job in the `delayed_jobs` table that you can configure with a different default priority:
* `service_binding.delete`
* `organization.delete`
* `space.delete`
* `service_instance.delete`
* `service_key.delete`
* `service_key.delete`
* `service_key.delete`
* `app_model.delete`
* `buildpack.delete`
* `domain.delete`
* `droplet_model.delete`
* `droplet_model.delete`
* `quota_definition.delete`
* `packages_model.delete`
* `role.delete`
* `route.delete`
* `security_group.delete`
* `service_broker.delete`
* `space_quota_definition.delete`
* `user.delete`
* `space.apply_manifest`
* `admin.clear_buildpack_cache`
* `service_instance.create`
* `service_bindings.create`
* `buildpack.upload`
* `space.delete_unmapped_routes`
* `service_keys.delete`
* `service_instance.update`
* `service_route_bindings.create`
* `service_route_bindings.delete`
* `service_keys.create`
* `droplet.upload`
* `service_bindings.delete`
* `service_broker.catalog.synchronize`
* `service_broker.update`
## <a id='override'></a> Overriding the default priority of a job
You can override the default priority for the jobs listed in [Delayed Jobs](#delayed-jobs) above by creating an operations file in YAML format that contains a
list of job names and their new priorities.
The following example shows an operations file that gives the `space.apply_manifest` job the highest priority and configures the `cloud_controller_ng` job to
run it before any other job:
```
- type: replace
path: /instance_groups/name=api/jobs/name=cloud_controller_ng/properties/cc/jobs?/priorities?
value:
space.apply_manifest: -10
```
For more information about operations files, see the [BOSH documentation](https://bosh.io/docs/cli-ops-files/).