Tuning Temporal Worker options for production

Production Temporal workers need concurrency, poller and cache settings chosen from measured CPU, memory and I/O, not from defaults. This page explains how to measure, tune and verify them.

On this page

Why Temporal worker tuning decides production behavior

Temporal worker tuning is the work that turns a running Temporal workflow platform from a working prototype into one that behaves predictably under production load. Many teams move toward production with worker settings still at their SDK defaults, and the first sign of trouble is usually latency, stuck tasks or memory growth rather than a clear error. A Temporal worker is the process you run, in your own infrastructure, that polls task queues on the Temporal Service, executes workflow tasks and activity tasks, and keeps a workflow cache so it does not replay full histories on every task. Concurrency limits, poller counts and cache size all draw on the same CPU, memory and I/O of the worker host, so raising one without the others can move the bottleneck rather than remove it.

Because the exact option names, units and default values depend on the SDK language and its version, confirm them in the documentation for your SDK before you change anything. The same concept may appear under different names across Go, Java, Python, TypeScript and .NET, and defaults may change between releases. Your first practical step is to inventory every worker process, the task queues each one polls, the language runtime and SDK version, and the resource limits of the container or host. Teams usually need this work when workflows and activities start sharing a pool, when a new task queue carries high volume, when workers run in Kubernetes with fixed memory limits, or when a Temporal Service upgrade changes the traffic pattern. Ask whoever owns the platform to record these baselines first, so that tuning decisions rest on measurements.

Which worker options to tune and when each fits

This table lists the main categories of Temporal worker settings, the resource each one consumes and the symptom that suggests it needs changing. Read each row as a starting diagnosis: change one setting at a time, measure again, and confirm every option name and default against the SDK documentation for your language and version.

Setting categoryResource it consumesSymptom that suggests tuning
Workflow task concurrencyWorker CPU and memory while replaying and running workflow codeWorkflow task latency rises while CPU stays busy and other workers on the same queue are idle
Activity concurrencyMemory, sockets and downstream capacity used by activity executionActivities queue up on the worker while CPU and memory are low, or downstream services are overloaded
Poller countsOpen long-poll requests to the frontend and some worker threadsSchedule-to-start latency grows on a queue while worker resources sit underused, or pollers are idle at high load
Workflow cache sizeMemory held by cached workflow state on each workerFrequent full history replays, rising workflow task latency and cache-miss metrics after a worker restart or rebalance
Sticky and eager execution settingsAffinity to a worker and an extra round trip for the first taskReplay spikes after scaling events, or first-task latency that does not match your expected path
Per-queue versus shared worker settingsShare of each process's CPU and memory given to each task queueOne high-volume queue starves another queue that runs on the same worker process
Language runtime limitsGarbage collection, thread pools or event loop capacity in the SDK runtimePauses or latency spikes that match runtime garbage collection or thread saturation, not Temporal queues

Which measurements should drive each worker setting

Build a baseline before you change any worker setting. Tuning from defaults or from a neighboring team's configuration tells you little about your own workload. Capture, for each task queue and each worker deployment, CPU saturation, memory growth over time per worker process, network and database latency as seen from the worker, and task queue backlog with schedule-to-start latency. Schedule-to-start latency is the most direct signal that workers are not keeping up, because it shows how long tasks wait before a worker picks them up. Record these numbers under steady load and under the peak you expect, and keep the same measurement window for every later comparison.

Measure workflow task work and activity work separately. They stress different resources: workflow tasks replay event history and run deterministic workflow code, while activities call external systems, do file or network I/O, and often hold memory for the duration of a call. A worker that looks idle on CPU may be waiting on a downstream database, and a worker that looks busy may be spending its time replaying long histories. Confirm which of the two dominates on each task queue before you decide which concurrency limit to move. If your SDK or the Temporal metrics you collect do not split the two, add that split to the baseline plan first.

Change one setting at a time and rerun the same load test after each change. When two concurrency, poller or cache values move together, you cannot tell which one caused a gain or a regression, and a fix for one queue can quietly starve another that shares the same worker process. Make load resemble production in payload sizes and event history lengths, because a test with small inputs and short workflows will overstate throughput and understate memory use. Ask your engineers to replay representative histories, including the long-running ones, and confirm the expected payload sizes with the workflow owners before the test begins.

How the language runtime changes the tuning

The Go SDK runs activities and workflow tasks as goroutines scheduled across operating system threads. Goroutines are cheap to create, so the practical limit on concurrent tasks usually comes from the CPU, the memory each in-flight activity holds, and the downstream systems it calls rather than from the scheduler itself. Garbage collection pauses are short but still grow with the live heap, so a large workflow cache holding many decoded histories raises the memory floor and can show up as latency spikes under load.

  • Goroutine headroom: Concurrency is often bounded by external calls and memory, not by goroutine creation, so measure CPU and heap at each slot count before raising it.
  • Heap growth from the cache: Cached workflow state stays in memory until evicted, so the cache size sets a baseline heap that you should measure with the worker idle and under load.
  • Garbage collection pressure: Allocation-heavy activities increase collection frequency, which can lengthen tail latency even when average CPU looks healthy.
  • Blocking calls in activities: A blocking network or disk call holds a goroutine and any slot it occupies, so timeouts on those calls matter as much as the slot count.
  • Container memory limits: Go's runtime tracks its own heap target, so set the container memory limit with room for cache growth and collector overhead.

Confirm the Go SDK version your workers use, and the runtime guidance for that version, in the Go SDK documentation, then validate the slot and cache numbers with your own load test results.

How to tune a production Temporal worker step by step

This sequence turns worker concurrency, poller and cache settings from guesses into values backed by measured CPU, memory, I/O and queue latency under production-like load, with a record of why each value was chosen.

  1. Build a load test that matches production

    The platform team and the application owners agree on a workload profile before any setting changes. Capture the workflow and activity mix, payload sizes, average and peak start rates, activity durations, and the number of task queues each worker process serves. Replay this profile against a non-production Temporal Service and worker build that match the production versions. Check that the test generates the same task queue depth pattern and activity latency shape as production logs. Do not start tuning until the test reproduces the production shape within a tolerance the team writes down.

  2. Capture baseline CPU, memory, I/O and queue latency

    Run the agreed load test with the current settings and record a baseline for each worker deployment. Collect CPU and memory per pod or process, disk and network I/O from activities that touch storage or external services, and schedule-to-start latency per task queue. Note which workers show slot exhaustion or poll timeouts. The baseline is complete when the team can show a single table of these measurements per task queue and language runtime, and when the test can be rerun with the same results within the tolerance set in the previous step.

  3. Identify the binding resource per task queue

    Compare the baseline by task queue to find what limits throughput: CPU saturation, memory pressure, slow external calls in activities, or too few pollers to drain the queue. Treat each task queue separately, because an activity-heavy queue and a workflow-heavy queue on the same process often have different limits. Record the binding resource and the evidence for it. The step closes when each task queue has one stated limit that the team can point to in the metrics, rather than a general sense that the workers are slow.

  4. Set concurrency and poller values per task queue

    Change one group of settings at a time: maximum concurrent workflow task and activity task executions, and the number of pollers for each task queue. Keep the values inside the limit found in the previous step, and set pollers so that queue latency falls without starving other queues on the same process. The language SDK documentation lists the option names for each runtime, and the team should confirm the defaults for its SDK version before changing them. Each change is accepted only when CPU and memory stay below the thresholds the team set, and schedule-to-start latency improves on the same load profile.

  5. Adjust the workflow cache and verify replay cost

    Set the workflow cache size from the memory headroom measured in the baseline, so cached workflow state does not push the process into memory pressure under peak load. Then check that sticky execution is working by watching cache hit behavior and replay activity during the test. A cache that is too small shows up as frequent replay of the same workflows. The step passes when memory stays within the team's limit at peak and replay volume drops or stays flat compared with the baseline run.

  6. Retest under peak and failure conditions

    Run the load test at the expected peak, then at higher load, and then with failure injected: restarting a worker pod, adding latency to an external dependency used by activities, and draining one worker during traffic. Confirm that tasks are not lost, that queue latency recovers within the limits the team defined, and that memory does not grow without bound after a restart. Any setting that fails a test goes back to the previous step. The next change is blocked until all failure scenarios pass on the current values.

  7. Document the final values with their measured reasons

    Write the final concurrency, poller, cache and pod resource values for each task queue and language runtime in the team's configuration repository. For each value, record the baseline and retest measurements that justified it, the load profile used, the SDK and server versions tested, and the date of the test. Schedule a rerun of the load test whenever the SDK, server version, workload mix or task queue layout changes. The step is complete when another engineer can read the record and reproduce the result without asking the original author.

How worker settings, resources and task queues feed back into each other

The loop starts with task queues, which feed pollers that claim work into task slots. Slots consume CPU, memory and I/O on the worker host, while the workflow cache holds recent history and determines how much replay work each task costs. Metrics from every stage go to a review that adjusts concurrency, poller counts and cache size, then the next measurement round begins. Check whether a change in one stage moved pressure into another before you accept it.

Tuning loop linking queues, pollers, slots, resources, cache and review.

Security and operational risks of aggressive worker settings

Higher concurrency, larger caches and tighter retry behavior can improve throughput on one queue while creating exposure elsewhere. The cards below cover the risks that tend to surface after a tuning change, and the checks to run before and after each change.

Shared hosts starve other queues

Raising pollers and concurrent task slots on a host that also runs workers for other task queues or namespaces lets one workload consume the CPU, memory and file descriptors the others need. Check whether each worker process serves a single task queue or several, and set per-process limits that leave headroom for the rest. Confirm that tuned values were tested with the neighbors running at their normal load, not only in isolation.

Cache growth holds sensitive payloads

A larger workflow cache keeps more workflow histories in worker memory, and those histories contain workflow inputs, activity results and any payloads that were not encrypted before reaching the worker. Memory growth also makes a worker more likely to be killed mid-task. Decide which data classes may sit in worker memory, size the cache against measured heap use, and confirm that worker memory dumps and crash logs are handled under the same controls as the data itself.

Retries amplify incident load

When a downstream system slows, aggressive activity retries and short timeouts multiply the number of calls hitting that system at the moment it can least absorb them. Higher concurrency makes this worse because more attempts run in parallel. Review retry policies per activity type, cap attempts and backoff, and rehearse a degraded-dependency scenario in a test environment to see how queue depth and downstream error rates respond.

Secrets and codec keys in workers

Workers must hold the credentials their activities use and, where payload encryption is applied through a custom codec, the keys that decrypt workflow data. Tuning that adds worker replicas multiplies the places those secrets live. Limit which service accounts and namespaces each worker pool can read, keep codec keys out of environment variables where a secrets manager can supply them at start, and confirm that adding replicas does not widen key access.

Temporal security docs

Unreviewed changes to tuned values

Concurrency, poller and cache values often live in code, Helm values or environment variables spread across several deployment pipelines, so a change can reach production without a reviewer seeing its effect. Store worker option values in version control with the owning team named, require a review that cites the measured CPU, memory and latency basis, and record which build and configuration ran during any incident.

Worker endpoints exposed to networks

Temporal's deployment guidance says Temporal services should run on hosts not reachable from the public internet, with network access restricted to trusted internal networks. Worker metrics endpoints, health checks and any debug interfaces opened while tuning can drift outside that boundary, especially when a change adds ports or moves workers to a different cluster. Verify the network policy after each tuning change and scan worker ports from outside the trusted network.

Temporal deployment docs

Questions teams ask before tuning Temporal workers

What does tuning Temporal worker options cost, and what drives the effort?

The main cost is engineering time spent measuring, changing and re-measuring worker settings, paid either to your own staff or to a partner under a written scope. Effort rises with the number of task queues, the number of language runtimes in use, how many services share the workers, and how much of your load is bursty. Tuning is largely one-time per workload, but it recurs when traffic shape, code or infrastructure changes. Ask any quote to list the task queues in scope, the runtimes, the metrics you can access, and whether a load test environment is included.

How long does worker tuning take?

Duration depends mostly on whether you can reproduce production load before changing anything. With a representative load test environment, the work is a series of measured experiments, each followed by a review of CPU, memory, and I/O behavior. Without one, changes must be made against live traffic, which slows the work and raises risk. No general duration applies, so ask for a timeline that states which load tests are in scope and what evidence will close each task queue.

What must our team provide before tuning starts?

Three inputs drive most of the schedule:

  • Representative workloads: sample histories or a replay of realistic workflow and activity mixes, including peak periods.
  • Metrics access: read access to worker and host metrics for CPU, memory, network, and disk, plus Temporal SDK metrics for each worker.
  • A deployment pipeline: a way to change worker options per environment and roll them back quickly.

If any of these is missing, the work usually starts with building it.

Can our internal platform team tune Temporal workers without outside help?

Yes, a team with Temporal SDK experience and solid observability can do this in-house, and many do. The gaps tend to be in load generation, interpreting worker metrics across runtimes, and knowing which changes interact, such as concurrency limits and cache sizes. Before deciding, check whether the team has run load tests against workers, whether it can change settings per task queue, and whether anyone owns the result after go-live. A partner can fill those gaps under a fixed scope.

How often should worker option values be reviewed?

Review them when something that affects load changes: a new workflow type, a shift in activity duration, a change in traffic pattern, a new language runtime version, or a move to a different host size. Alerts on slot exhaustion, poller gaps, or latency are useful triggers. Schedule a periodic review as well, because values tuned for last quarter's load can drift quietly. Record the measured reason for each value so the next review starts from evidence.

How does worker tuning relate to later Temporal Server upgrades?

Worker tuning and server upgrades are separate changes, but they interact. Temporal Server should be upgraded one minor version at a time, moving to the latest patch of the current minor first, and schema upgrades must run before server upgrades when release notes call for them. Worker behavior can shift with server changes, so re-check key metrics after each server step and before changing worker options. Plan both on the same calendar so a regression can be traced to one change.

Should we tune workers before or after choosing a Temporal Cloud or self-hosted service?

Start tuning on the environment that will carry production load, because the metrics you measure depend on where workers and the service run. Connectivity, latency between workers and the service, and the capacity model all shape the results. If the hosting decision is still open, agree on the worker metrics and load profile first, then repeat the core measurements once the target service is chosen. Confirm the service-side limits with Temporal documentation for that deployment type.

Limits to confirm in your environment

Worker tuning values are only as good as the environment they were measured in. The cards below list the items to confirm before you carry a tuned configuration from a test cluster into production, since each one can move the results.

Option names and defaults

Concurrency, poller and cache option names, and their defaults, differ by SDK language and release. Read the defaults from the exact SDK version you deploy, not from examples or older blog posts. A value you tuned on one SDK version may be renamed, reset or ignored after an upgrade, so record the version next to every setting in your configuration.

Self-hosted deployment docs

SDK and server version pairs

Confirm which SDK versions your Temporal Server version supports before you tune anything. Server upgrades are backward compatible only between successive minor versions, so a worker that works today may fall outside the supported range after a planned server upgrade. Check the pairing in the upgrade plan, and retest worker settings on each pair you run.

Server upgrade docs

CPU and memory limits

Container CPU and memory limits on Kubernetes, VM sizing, or serverless memory allocations can cap the work a worker does regardless of the concurrency you set. A limit that is lower than the measured peak causes throttling or out-of-memory restarts that look like slow activities. Confirm the limits each worker runs under and measure with those limits in place.

Service-side limits and rate caps

Throughput can be capped by the Temporal service, not the worker. Self-hosted services depend on persistence and history sizing, and Temporal Cloud applies its own capacity and rate settings. Ask your Temporal Cloud account team, or check your self-hosted service metrics, for the limits that apply to your namespace before you attribute a throughput ceiling to worker settings.

Payload size and history length

Tuned values assume a typical payload size and workflow history length. Large payloads raise memory per task and make workflow caches expensive, while long histories increase replay cost. Sample real production payloads and history lengths across a normal week and a peak, and retune when the distribution shifts, for example after a new workflow version ships.

Network exposure and hosting

Worker placement affects latency between workers and the Temporal frontend. Confirm the network path, any proxies or load balancers in between, and whether services run on hosts not reachable from the public internet, as the deployment docs describe. A slow network path can raise schedule-to-start latency and change which concurrency setting is the bottleneck.

Self-hosted security docs

How DeployOpen scopes and delivers Temporal worker tuning

DeployOpen approaches worker tuning as a measured engagement: we read the current worker settings, observe CPU, memory and IO under real load, and change concurrency, poller and cache values one task queue and language runtime at a time. Engagements are fixed-scope, with the deliverables agreed in writing before work starts.

How we scope

  • Inventory every Temporal worker, its language SDK, its task queues and its current concurrency and poller settings.
  • Agree which metrics and load profiles must be measured, and which environments the tuning work will run against.
  • Define written deliverables, including the tuning baseline, the change plan and the retest criteria, before any settings change.

How we build

  • Collect CPU, memory and IO baselines per worker deployment, then test proposed poller, slot and cache values against them.
  • Change one variable at a time per task queue, so each effect on latency, throughput and sticky cache behavior is attributable.
  • Test the tuned configuration under representative load and record results against the agreed acceptance criteria.

How we hand over

  • Deliver the final worker configuration as code, with each value documented alongside the measurement that justified it.
  • Document the reasoning for each setting, the symptoms that should trigger a re-tune, and the metrics the operations team should watch.
  • Walk the platform and operations teams through the runbook so they can repeat measurements after future releases.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial tuning work is handed over.
  • A retainer can cover re-measurement after Temporal Server upgrades, SDK upgrades or changes in workload shape.
  • Confirm the support hours, response expectations and escalation path in the written scope before the engagement begins.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.