Timings¶
Some timings depend on the deployment: those are configuration keys that can be tuned. The others have fixed defaults because they depend on each other or keep the system correct. All are read once when a process starts; a change takes a restart.
Public timing keys¶
These are the duration keys in the configuration reference.
Section and key |
Default |
What it does and when to change it |
|---|---|---|
|
30 s |
Scans roots for changes. Shorten for faster discovery, lengthen for fewer scans. |
|
5 s |
Waits for a root to stay unchanged before hashing it. Raise it if updates arrive in pieces. |
|
60 s |
Limits one DAG file’s import. Raise it for files that need longer to import. |
|
30 s |
Time from SIGTERM to SIGKILL on cancellation. Change it to give tasks more or less time to stop. |
|
10 min |
Waits for missing task code on an eligible worker before marking the task unschedulable. Raise it if code takes longer to arrive. |
|
10 min |
Time a worker has for a parse job before it is reassigned. Raise it for large DAG folders; each file still has |
|
30 s |
Limits a whole request to a worker for a task log. Raise it for large logs that arrive slowly; a user waits this long at most for a hung worker. |
|
1 min |
Default limit for a connection test. Raise it for slow connections; |
|
30 s |
Time running tasks get on worker shutdown, including the drain’s stop and report periods. Match the pod’s |
|
3 s |
Time from SIGTERM to SIGKILL when a drain’s time is up. Change it for the time tasks need to stop; it and the fixed report period must fit in the grace period. |
|
30 days |
Deletes task logs older than this. Change it for the retention needed. |
|
30 s |
Time a Python runner has to say hello. Raise it for a slow interpreter start; a failed start is noticed later. |
|
5 min |
Time a fork server has to import preloaded libraries. Raise it for large preload lists or slow storage; tasks are spawned until it is up. |
|
5 min, or what fits in |
Limit for each per-task cleanup try when the task doesn’t set its own. Left unset, it fits in the grace period less the drain’s terminate and report periods, so a cleanup isn’t lost when the pod is killed at the grace period’s end (B252). Raise it for slow systems, or lower it to free slots sooner. The attempt holds its slot meanwhile. |
|
30 min |
Limit for each resource cleanup try without its own |
|
20 min |
How long a failed preload import is retried with backoff. Change it for dependencies slow to become ready; |
|
30 s |
How long a wait step may hold its host’s event loop without reaching an |
|
24 h |
How long a wait step without its own |
|
10 s |
Limit for one delivery. A timeout counts as a failed delivery and allows a retry. |
|
24 h |
How long to retry a notification before dropping it. |
|
30 s |
How often TLS files are read for changes. Shorten it for faster rotation, or lengthen it for fewer reads. |
|
30 s |
Limit for one Vault request. Raise it for a slow or distant Vault; a task waits this long at most for a hung request. |
|
10 s |
Limit for connecting to Vault. Raise it on a slow network. |
|
60 s |
Time a fetched secret stays in the worker’s shared cache. |
The [retention] ages also take durations, or forever; see the configuration reference.
A key that can’t work at zero stops the start when set to 0s: [dags] poll_interval and
parse_file_timeout, [master] parse_job_timeout, [webserver] worker_request_timeout and
connection_test_timeout, [notifications] timeout, [sensors] default_max_wait,
[worker] log_retention, runner_start_timeout,
fork_server_preload_timeout, cleanup_timeout and resource_cleanup_timeout, [tls] reload_interval (with TLS on), and
a storage’s request_timeout and connect_timeout. Elsewhere zero means something: no wait, no
retry, no cache.
Fixed timings¶
Warning: SCHEDR_HIDDEN__* is unsupported and used at your own risk; it is not
configuration. A wrong value can run a task twice or lose a healthy worker. It exists for
tests and experiments and can change or go without notice.
These variables work only in the environment. Setting one of these timings in a config file,
a flag or a SCHEDR_CONFIG__* variable fails as an unknown key. Each active override is
warned about at startup; retired names are accepted and ignored. An unknown name, a bad duration, zero or more than 3650 days stops
the start.
Some timings stay in the binary: those a task’s own process uses (schedr task-ctx, dag-ctx
and the Python package), which reads no configuration; those two processes must agree on (a
task’s API call, a connections check: one side’s setting would break the other); the gauge
refresh limit, half the loop stall timeout; and the migration connection timing, which has no
query timeout to tie it to. What stays in the binary lists them by
reason.
Master¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
1 s |
Paces scheduler, command and dispatch rounds. Triggers and events also have a separate loop woken by progress. |
|
5 s |
First wait before restarting a failed event trigger; it doubles up to the maximum. |
|
5 min |
Longest wait before restarting a failed event trigger. |
|
10 s |
How often workers send heartbeats, set by the master and sent to workers; worker liveness depends on messages arriving. |
|
60 s |
A worker silent this long is lost; its attempts are ended (an unstarted assignment needs no timeout: it is taken back once the worker’s messages show it never started, decision 460). A replaced incarnation’s attempts are held this long; a worker also ends a stream silent this long. At least four times the heartbeat interval, and longer than the master’s lead ( |
|
1 min |
How far before the newest event already handled an |
|
5 min |
Time without a report from any alive worker before a script root is omitted from the uses sent to workers, counted from master startup too. |
|
30 s |
Master’s database lease; renewed every third of it. A standby takes over at most this long after a crash. At least three times |
|
3 s |
After a commit is cut off or the connection lost, the master checks whether it was stored for this long, holding its lock; rounds and worker messages wait. If not seen, it is taken as not stored. |
|
500 ms |
Interval between reads within the read-back window. |
|
120 s |
Liveness fails if a role’s main loop (the master’s, a worker agent’s) has not turned for this long; query and lease limits must be shorter. |
|
1 min |
Time an assignment that failed on its own is left out of rounds before retry, so other tasks can proceed. |
|
1 min |
The least an |
|
10 s |
Time a lost worker’s cleanup waits before it moves to another worker, on top of the cancel grace: a worker only cut off has stopped the task by then. |
|
30 min |
How often the master retries starting command listening after failure; it polls meanwhile. |
|
50 ms |
Minimum gap between extra rounds under a stream of finished tasks. |
|
30 s |
Wait before retrying failed notifications; polling continues meanwhile. |
|
5 s |
How often the master’s loop turns at least while waiting; it must stay shorter than the loop stall timeout, or a waiting master looks stuck. |
|
15 s |
How often the master reads gauges from the database. |
|
5 s |
How often the sender looks for notifications to deliver. |
|
10 s |
First wait before retrying a failed notification; it doubles up to the maximum. |
|
1 h |
Longest wait before retrying a failed notification. |
|
1 h |
How often the leading master runs retention. |
|
1 min |
How often the leading master samples each process, and a webserver in a process of its own itself. |
|
24 h |
How long minute samples are kept. Must be longer than |
|
30 d |
How long the 15-minute rollups are kept. |
|
30 s |
First wait before retrying a failed parse job; it doubles up to the maximum. |
|
10 min |
Longest wait before retrying a failed parse job. |
|
10 s |
How often the master writes its row of the deployment’s nodes. A master heard from within three of them is on the Deployments page and sampled; a longer interval keeps it there longer after it is gone. |
|
1 h |
How long a gone master’s row stays before it is removed; the Deployments page shows only those heard from lately either way. |
|
2 min |
How long after its end a 15-minute window waits to be rolled up, so a sample stored late is in it. A sample stored later than this is missing from its rollup, and so from the 7- and 30-day charts. Must be shorter than |
|
35 s |
When a task whose code wasn’t on its worker yet is tried again: about a git-sync interval and the settle time. Set it near your code delivery’s interval; shorter only retries sooner, |
|
1 min |
How far ahead of the master’s clock a run’s |
Three master timings are retired: QUIET_DAG_AFTER, QUIET_DAG_WAKE_AHEAD and
QUIET_DAG_FULL_PASS_INTERVAL (the MASTER group): which DAGs a round visits comes from the
database now (Busy and quiet DAGs). They are still
accepted, so an old deployment starts, and have no effect.
Database¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
10 s |
Limit for a query or waiting for a connection; a write transaction has a few of these. Lease renewal and stall detection depend on it. |
|
1 s |
How often changes are read where they are not announced, such as SQLite. |
Webserver¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
15 s |
Refreshes live UI pages when database changes cannot be followed. |
|
5 s |
Limits connection to a worker when fetching a task log; log access depends on it. |
|
1 min |
How often the webserver checks whether the database announces changes. |
|
15 s |
How often an event stream sends a comment to keep idle connections open through proxies. |
|
1 s |
Wait before retrying following database changes after failure. |
|
5 s |
How long a removed user or a changed password keeps working; raising it delays revocation. |
|
5 min |
How long a successful password check is remembered; this only saves bcrypt runs, and a change of the users file forgets them all. |
|
3 s |
How long running requests get after the server stops before they are cut. |
|
5 s |
How often a webserver started before the migration checks again. |
|
15 min |
When a Metrics bucket is final: kept by the webserver between requests and never read again (decision 492). A sample stored later, such as from a process whose clock is behind by more, shows only after the webserver restarts. Must be longer than |
|
30 days |
How far back the DAG page’s memory p95s reach. Longer reads more attempts on each load of the page. |
|
1 min |
How far ahead of the clock a posted event’s |
UI¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
15 s |
How often a page stream sends a ping and the log tail sends a comment. |
|
1 s |
Minimum interval between change messages on a page stream, per deployment. |
|
1 s |
How often the log tail reads the log. |
|
30 s |
How long the log tail retries an unreachable log before reporting it and stopping. |
|
50 ms |
A Runs page whose deployments took longer than this to answer is slow. |
|
5 s |
How often a slow Runs page reads again at most when runs change (otherwise once a second). |
|
1 s |
First wait before a relay reopens its stream; it doubles up to the maximum. |
|
30 s |
Longest wait between a relay’s retries. |
Worker¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
2 s |
Time from a drain’s SIGKILL until the grace period ends, to report interruptions and deregister; results may otherwise end lost. It must fit with the termination period. |
|
10 min |
How far back a worker looks for its tightest reading of master time (decision 447); a longer window keeps an older sample, whose drift allowance grows with its age. |
|
2 s |
How far the master’s wall clock may differ from a worker’s, beyond the round trip, before the worker warns, once a session (decision 449). Only for people: no deadline reads a wall clock. |
|
1 s |
How often the watchdog samples each task’s memory; budget enforcement depends on samples. |
|
5 s |
How long a stopped process’s output may take to reach its log when another process holds its pipes open. |
|
30 s |
How long a fork server may take to answer; then it is restarted and the task spawned. |
|
1 s |
First wait before restarting a fork server; it doubles up to the maximum. |
|
5 min |
Longest wait before restarting a fork server. |
|
10 min |
Time a fork server must stay up to reset its restart waits. |
|
1 h |
How often old task logs are swept. |
|
50 ms |
How often an orphan found at startup is checked while it stops. |
|
5 s |
How long an orphan may take to go after SIGKILL. |
|
10 s |
Time an orphan found at startup gets from SIGTERM to SIGKILL. |
|
200 ms |
First wait after the master connection drops; it doubles with jitter up to the maximum. |
|
30 s |
Longest wait between tries to reach the master; once the worker knows its lease, each wait is also capped at half that lease. |
|
5 s |
How often the agent’s loop turns at least, even when quiet; it must stay shorter than the loop stall timeout, or a quiet agent looks stuck. |
|
1 h |
How long a stopping worker waits, at most, for the master to take its deregistration. Its drain’s end bounds it too (a quarter of the report period before the grace period ends), and by default that end alone: a master stalled for a few seconds still takes it, and shows the worker offline. Shorter, a worker may leave before a stalled master reads it, and shows as disconnected, then lost. |
|
100 ms |
How often a drain checks what is left. |
|
5 s |
How long a drained worker waits for the master to acknowledge its last results; never past half the report period before the grace period ends, left to deregister and exit. |
|
100 ms |
How often a stopped task’s process group is checked until it is gone. |
|
5 s |
Time a connection test’s process gets from SIGTERM to SIGKILL. |
|
1 s |
Minimum wait before a Vault token renewal. |
|
1 min |
How often a Vault session with nothing to renew is checked again. |
|
10 s |
Wait before retrying a failed Vault renewal while the token lasts. |
Client¶
The CLI’s and schedr ui’s requests to a webserver.
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
5 s |
How long connecting to a webserver may take; a black-holed address fails after it. |
|
30 s |
How long one request may take, from connecting to the end of its answer. Raise it for a slow link or a large list; a hung webserver holds a command, or a UI page, this long. A stream (a page’s live part, a log tail) has its own limit. |
|
30 s |
How long the CLI waits for a command’s decision before reporting it as still pending. The master can decide later. UI actions poll until a decision; this does not limit that polling. |
|
1 h |
How long |
Standalone¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
10 s |
How long a standalone’s worker gets to stop after its master fails. |
TLS¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
10 s |
Time a peer has to complete a TLS handshake; slow or stalled connections depend on this limit. |
|
100 ms |
Wait after a listener fails to accept a connection, such as when too many files are open, to avoid spinning. |
At startup, the query timeout must be at least 1 ms and shorter than the loop stall timeout.
The master lease must be at least three query timeouts and shorter than the loop stall timeout.
The drain termination period plus the report period must not exceed [worker] termination_grace_period. The connection test timeout must be at least 1 ms and within the
API’s maximum; an invalid value stops startup.
Fixed limits¶
These limits are set the same way, with the same warning: whole numbers from 1 to 16,777,216, in the environment only; anything else stops the start. The two events backlogs take their memory up front, a slot each. Each is a cap a deployment of an odd size might need to move: more does more at once and holds others up longer, less spreads a burst over more rounds or reads. The defaults are measured (B18’s stress runs); change one only after measuring yours, and one at a time.
Master¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
256 |
The most wait step hosts, and the most warnings, the master keeps of one worker’s report; the rest are dropped with a warning in its log. An honest worker sends a few. |
|
4096 |
The most characters of each text in them (a host’s code, a warning’s message); longer ones are cut. |
|
1 MiB |
The most bytes a notification’s body may take once filled. |
|
100 |
The most runs retention deletes in one transaction. |
|
80 |
The most messages from one worker handled in a turn. Its |
|
50 |
The most assignments a round makes in a batch transaction. The rest wait for later rounds, the longest ready first. More starts a burst sooner and holds the core lock longer for that transaction. |
|
50 |
The most assignments a round takes back as never started. |
|
100 |
The most waiting reasons a round writes, a statement each; they are only shown, so the rest wait a round. |
|
500 |
The most pending reasons a round writes, in one statement, for the tasks past its assignments (decision 481). |
|
50 |
The most commands a round applies, oldest first. Each command has its own transaction and holds the core lock for that transaction. |
|
10 |
The most scheduled runs a round creates for one DAG; one catching up after a long pause goes over a few rounds, the earliest first. |
|
2000 |
The most task instances a round creates for runs that just started; a run is never split, so a run wider than this still starts whole, alone. |
|
100 |
The most failed tasks a round queues again once their retry delay passed. |
|
100 |
The most runs the scheduler creates for one DAG in one pass (a |
|
50 |
The most runs one pass starts for a DAG started by |
|
10 |
The most messages of a failed group handled one by one in a turn (M4B.3), so a failing group doesn’t hold the lock for a whole turn of single transactions. |
|
1024 |
The messages that wait for a worker before it is taken for one that stopped reading and disconnected. Less disconnects a slow worker sooner; more holds more memory per worker. |
|
50 |
The most notifications one pass of the sender delivers; the rest go in the next pass. |
Webserver and UI¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
64 |
The Metrics cache’s keys (each range, for all processes or one), the least recently used dropped first (one a request holds never). More keeps more process panels warm, in memory. |
|
100,000 |
The buckets kept for one key; a key with more (thousands of processes over 30 days) is read whole each time instead of held. |
|
1000 |
The runs a DAG’s memory p95s are taken from, its last to end and those still going; and a task’s attempts read for its chart. Bounds the query: more reads more on each load of the DAG page. |
|
1024 |
The changes a slow event stream may fall behind by before it gets |
|
1000 |
The password checks remembered at once, the oldest dropped first; one dropped costs a bcrypt check again. |
|
1024 |
The changes a slow browser may fall behind by before it gets |
Database¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
1000 |
The most rows of SQLite’s |
|
4096 |
The DAG versions a process keeps parsed; past them the cache is cleared and the current ones are parsed again. More holds more memory in a deployment of many DAGs. |
Worker¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
32 |
The most results a worker writes to its journal as one group (M4B.5), each a thread writing its file meanwhile. |
|
32 |
The most assignments whose journal records are written as one group (M5.1b). |
|
8 |
How many times a result is sent again over one session before the worker reconnects, so that its registration’s journal settles it. |
|
32 |
The most heartbeats between two sends of an unacknowledged result; the gap doubles from one. |
|
100,000 |
The messages a worker keeps waiting to be heard of, to read master time from (B240), the oldest dropped first. |
|
16 |
The connections jobs’ answers a worker keeps while no master listens; older ones are dropped and their jobs end as lost. |
|
64 |
The most context connections a command task may have open to its agent at once; one more is refused with a message. |
|
16 |
A wait step’s messages waiting for its attempt before its host waits too: a step printing faster than its log is written slows down instead of filling memory. |
TLS¶
Variable |
Default |
What it does and what depends on it |
|---|---|---|
|
256 |
How many TLS handshakes a listener runs at once; beyond them accepting waits, so connections that never finish hold this many sockets, not all. |
What stays in the binary¶
Every other number schedr uses is fixed for a reason (decision 493):
Data and protocol: what is stored or sent, such as the samples’ minute and 15-minute steps, the message sizes and chunks, the protocol’s version and field numbers.
The databases’ parameter limits: the rows or IDs one statement takes.
The system: the descriptors one datagram carries, exit codes and signals, clock drift bounds, the daylight-saving margin.
Contracts users see: ID, key and parameter sizes, the API’s list sizes, the DSL’s defaults, the smallest memory a Python process starts in.
Derived from another value: the workers’ “heard within” windows (from the usage interval), the write limits (from the query timeout), the gauge refresh limit (from the loop stall).
Shared by two processes: a task’s API call limit, a connections check’s limit.
Display: the UI’s layout, page sizes and log tails, the eight series a chart draws.
A task’s own process:
schedr task-ctx,dag-ctxand the Python package read no configuration.