- Compute: how many Workflow and Activity Tasks can execute concurrently.
- Memory: how many Workflow Executions stay in the sticky cache.
- IO: how many pollers long-poll Temporal for new tasks.
Concurrency and Polling
These env vars map to Temporal worker execution slots, cache, and pollers. See Temporal’s Worker performance guide, Worker tuning quick reference, andWorkerOptions.
Example:
Worker Tuner
TEMPORAL_WORKER_TUNER accepts a JSON-encoded Temporal WorkerOptions.tuner. Use it when fixed concurrency limits are too rigid and you want Temporal’s slot suppliers to control how many tasks the worker accepts.
Resource-based auto-tuning is most useful for avoiding out-of-memory failures and absorbing bursts of low-resource work, such as Activities that spend most of their time waiting on external HTTP or I/O. Temporal recommends validating it by monitoring host CPU and memory under full load and confirming they settle near your configured targets. See Temporal’s resource-based auto-tuning announcement for the model behind the feature.
Choose exactly one tuner shape:
- Resource-based tuner: one set of
tunerOptions, plus optional*SlotOptions. - Mixed slot suppliers: one
*SlotSupplierobject for each task type.
tunerOptions / *SlotOptions with *SlotSupplier fields in the same JSON object.
When TEMPORAL_WORKER_TUNER is set, Output passes it to Temporal as tuner and does not pass these incompatible execution options:
TEMPORAL_MAX_CONCURRENT_ACTIVITY_TASK_EXECUTIONSTEMPORAL_MAX_CONCURRENT_WORKFLOW_TASK_EXECUTIONS
TEMPORAL_MAX_CONCURRENT_ACTIVITY_TASK_POLLSTEMPORAL_MAX_CONCURRENT_WORKFLOW_TASK_POLLSTEMPORAL_MAX_CACHED_WORKFLOWS
Resource-Based Tuner
Use aResourceBasedTuner to let Temporal adjust slots based on target CPU and memory usage. This is the simpler tuner shape. You can provide only workflow and activity slot options; Temporal applies defaults for local activity and Nexus slots.
Mixed Slot Suppliers
Use aTunerHolder to choose a slot supplier per task type. This is useful when workflow tasks should remain fixed but activities should scale with CPU and memory.
When using the per-task supplier form, Temporal requires all four supplier fields:
workflowTaskSlotSupplier, activityTaskSlotSupplier, localActivityTaskSlotSupplier, and nexusTaskSlotSupplier. Omitting local activity or Nexus suppliers can fail worker startup.
Temporal also supports custom slot suppliers in code, but
TEMPORAL_WORKER_TUNER is JSON and should be used only for fixed-size and resource-based suppliers.
What to Watch
Use Temporal metrics before changing values. The main question is whether the worker has no execution capacity left, or whether it has capacity but is not polling fast enough. See Temporal’s SDK metrics reference, Worker health, and performance bottlenecks guide.Choosing Values
If memory is high, lower activity slots first. Activities usually hold network responses, LLM payloads, browser state, or other heavier objects. If Temporal shows activity backlog and the worker has spare CPU and memory, raise activity execution slots or use a resource-based tuner with a highermaximumSlots.
If workflow task backlog grows while CPU is low, check temporal_worker_task_slots_available first. If workflow slots are depleted, raise workflow task execution slots. If slots are available but schedule-to-start latency is high, raise workflow task pollers. If workflow task timeouts increase, lower workflow task execution slots.
If CPU and memory vary heavily by workload, prefer TEMPORAL_WORKER_TUNER with resource-based activity slots over a large fixed activity concurrency.
Tune incrementally and load test before applying large production changes. Temporal’s Introduction to Worker Tuning is a good overview of when to scale workers horizontally versus increasing per-worker slots or pollers.
Useful Links
- Worker performance — Temporal’s main guide for slots, pollers, task queue metrics, and tuning process.
- Worker tuning quick reference — compute, memory, and IO settings by SDK.
- Resource-based auto-tuning for Workers — explanation of resource-based slot suppliers and when to use them.
- An introduction to Worker tuning — conceptual guide to worker capacity, schedule-to-start latency, pollers, and slots.
- Worker deployment and performance — production worker best practices and monitoring guidance.
- Temporal SDK metrics reference — metric names for slots, pollers, request latency, and schedule-to-start latency.
- Performance bottlenecks troubleshooting — how to diagnose worker capacity and schedule-to-start issues.
- Monitor worker health — Temporal Cloud monitoring signals for workers and task queues.