Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2946b6e
Update worker-versioning.mdx
bchav Jan 6, 2026
d14ed2a
Update worker-versioning.mdx
bchav Jan 6, 2026
e1fe66b
Add Worker tuning quick reference guide
bchav Jan 23, 2026
003dbbe
fix(worker versioning): fixed merge conflict
flippedcoder Feb 6, 2026
e31606d
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
323098b
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
8bb8e20
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
7a2e3ce
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
b599760
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
9ea8ba0
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
ee7cebf
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
21cb680
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
6a7770b
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
ea1ca17
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
3dfda2f
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
c2f6cec
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
0f2c1d5
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
3682eff
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
57a4606
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
1b32ce9
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
66f0506
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
e56faa0
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
1f93272
Update docs/develop/worker-tuning-reference.mdx
flippedcoder Feb 3, 2026
bf3809e
chore(worker versioning): added Go code snippet and updated spacing o…
flippedcoder Feb 3, 2026
a9b6365
chore(worker versioning): removed CaN references for GA, moving them …
flippedcoder Feb 9, 2026
012910f
fix(worker versioning): fixed missing note character
flippedcoder Feb 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/develop/worker-performance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -848,5 +848,6 @@ If, after adjusting the poller and executors count as specified earlier, you sti

## Related reading

- [Worker tuning quick reference](/develop/worker-tuning-reference) - SDK defaults and metrics by resource type
- [Workers in production operation guide](https://temporal.io/blog/workers-in-production)
- [Full set of SDK Metrics reference](/references/sdk-metrics)
215 changes: 215 additions & 0 deletions docs/develop/worker-tuning-reference.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
---
id: worker-tuning-reference
title: Worker tuning quick reference
sidebar_label: Worker tuning reference
description: A quick reference guide for Temporal Worker configuration defaults across SDKs, organized by resource type (compute, memory, IO) with key metrics for each.
toc_max_heading_level: 4
keywords:
- worker tuning
- worker configuration
- sdk defaults
- worker metrics
- performance
tags:
- Workers
- Performance
- Reference
---

This page provides a quick reference for Worker configuration options and their default values across Temporal SDKs.
Use this guide alongside the comprehensive [Worker performance](/develop/worker-performance) documentation for detailed tuning guidance.

Worker performance is constrained by three primary resources:

| Resource | Description |
|----------|-------------|
| **Compute** | CPU-bound operations, concurrent Task execution |
| **Memory** | Workflow cache, thread pools |
| **IO** | Network calls to Temporal Service, polling |

## How a Worker works

Workers poll a [Task Queue](/task-queue) in Temporal Cloud or a self-hosted Temporal Service, execute Tasks, and respond with the result.

```
┌─────────────────┐ Poll for Tasks ┌──────────────────┐
│ - Worker │ ◄─────────────────────── │ Temporal Service │
│ - Workflows │ │ │
│ - Activities │ ───────────────────────► │ │
└─────────────────┘ Respond with results └──────────────────┘
```

Multiple Workers can poll the same Task Queue, providing horizontal scalability.

### How Worker failure recovery works

When a Worker crashes or experiences a host outage:

1. The Workflow Task times out
2. Another available Worker picks up the Task
3. The new Worker replays the Event History to reconstruct state
4. Execution continues from where it left off

For more details on Worker architecture, see [What is a Temporal Worker?](/workers)

## Compute settings

Compute settings control how many Tasks a Worker can execute concurrently.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can the compute defaults be changed? The dynamic config? If they can be changed, add a link to where that happens.


### Compute configuration options

| Setting | Description |
|---------|-------------|
| `MaxConcurrentWorkflowTaskExecutionSize` | Maximum concurrent Workflow Tasks |
| `MaxConcurrentActivityTaskExecutionSize` | Maximum concurrent Activity Tasks |
| `MaxConcurrentLocalActivityTaskExecutionSize` | Maximum concurrent Local Activities |
| `MaxWorkflowThreadCount` / `workflowThreadPoolSize` | Thread pool for Workflow execution |

### Compute defaults by SDK

| SDK | MaxConcurrentWorkflowTaskExecutionSize | MaxConcurrentActivityTaskExecutionSize | MaxConcurrentLocalActivityTaskExecutionSize | MaxWorkflowThreadCount |
|-----|----------------------------------------|----------------------------------------|---------------------------------------------|------------------------|
| **Go** | 1,000 | 1,000 | 1,000 | - |
| **Java** | 200 | 200 | 200 | 600 |
| **TypeScript** | 40 | 100 | 100 | 1 (reuseV8Context) |
| **Python** | 100 | 100 | 100 | - |
| **.NET** | 100 | 100 | 100 | - |

### Resource-based slot suppliers

Instead of fixed slot counts, you can use resource-based slot suppliers that automatically adjust available Task slots based on CPU and memory utilization.
For implementation details, see [Slot suppliers](/develop/worker-performance#slot-suppliers).

## Memory settings

Memory settings control the Workflow cache size and thread pool allocation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can the memory defaults be changed? The dynamic config? If they can be changed, add a link to where that happens.


### Memory configuration options

| Setting | Description |
|---------|-------------|
| `MaxCachedWorkflows` / `StickyWorkflowCacheSize` | Number of Workflows to keep in cache |
| `MaxWorkflowThreadCount` | Thread pool size |
| `reuseV8Context` (TypeScript) | Reuse V8 context for Workflows |

### Memory defaults by SDK

| SDK | MaxCachedWorkflows / StickyWorkflowCacheSize |
|-----|----------------------------------------------|
| **Go** | 10,000 |
| **Java** | 600 |
| **TypeScript** | Dynamic (e.g., 2000 for 4 GiB RAM) |
| **Python** | 1,000 |
| **.NET** | 10,000 |

For cache tuning guidance, see [Workflow cache tuning](/develop/worker-performance#workflow-cache-tuning).

## IO settings

IO settings control the number of pollers and rate limits for Task Queue interactions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can the IO defaults be changed? The dynamic config? If they can be changed, add a link to where that happens.


### IO configuration options

| Setting | Description |
|---------|-------------|
| `MaxConcurrentWorkflowTaskPollers` | Number of concurrent Workflow pollers |
| `MaxConcurrentActivityTaskPollers` | Number of concurrent Activity pollers |
| `Namespace APS` | Actions per second limit for Namespace |
| `TaskQueueActivitiesPerSecond` | Activity rate limit per Task Queue |

### IO defaults by SDK

| SDK | MaxConcurrentWorkflowTaskPollers | MaxConcurrentActivityTaskPollers | Namespace APS | TaskQueueActivitiesPerSecond |
|-----|----------------------------------|----------------------------------|---------------|------------------------------|
| **Go** | 2 | 2 | 400 | Unlimited |
| **Java** | 5 | 5 | - | - |
| **TypeScript** | 10 | 10 | - | - |
| **Python** | 5 | 5 | - | - |
| **.NET** | 5 | 5 | - | - |

### Poller autoscaling

Use poller autoscaling to automatically adjust the number of concurrent polls based on workload.
For configuration details, see [Configuring poller options](/develop/worker-performance#configuring-poller-options).

## Metrics reference by resource type

Use these metrics to identify bottlenecks and guide tuning decisions.
For the complete metrics reference, see [SDK metrics](/references/sdk-metrics).

### Compute-related metrics

| Worker configuration option | SDK metric |
|-----------------------------|------------|
| `MaxConcurrentWorkflowTaskExecutionSize` | [`worker_task_slots_available {worker_type = WorkflowWorker}`](/references/sdk-metrics#worker_task_slots_available) |
| `MaxConcurrentActivityTaskExecutionSize` | [`worker_task_slots_available {worker_type = ActivityWorker}`](/references/sdk-metrics#worker_task_slots_available) |
| `MaxWorkflowThreadCount` | [`workflow_active_thread_count`](/references/sdk-metrics#workflow_active_thread_count) (Java only) |
| CPU-intensive logic | [`workflow_task_execution_latency`](/references/sdk-metrics#workflow_task_execution_latency) |

Also monitor your machine's CPU consumption (for example, `container_cpu_usage_seconds_total` in Kubernetes).

### Memory-related metrics

| Worker configuration option | SDK metric |
|-----------------------------|------------|
| `StickyWorkflowCacheSize` | [`sticky_cache_total_forced_eviction`](/references/sdk-metrics#sticky_cache_total_forced_eviction), [`sticky_cache_size`](/references/sdk-metrics#sticky_cache_size), [`sticky_cache_hit`](/references/sdk-metrics#sticky_cache_hit), [`sticky_cache_miss`](/references/sdk-metrics#sticky_cache_miss) |

Also monitor your machine's memory consumption (for example, `container_memory_usage_bytes` in Kubernetes).

### IO-related metrics

| Worker configuration option | SDK metric |
|-----------------------------|------------|
| `MaxConcurrentWorkflowTaskPollers` | [`num_pollers {poller_type = workflow_task}`](/references/sdk-metrics#num_pollers) |
| `MaxConcurrentActivityTaskPollers` | [`num_pollers {poller_type = activity_task}`](/references/sdk-metrics#num_pollers) |
| Network latency | [`request_latency {namespace, operation}`](/references/sdk-metrics#request_latency) |

### Task Queue metrics

| Metric | Description |
|--------|-------------|
| [`poll_success_sync_count`](/cloud/metrics/reference#temporal_cloud_v0_poll_success_sync_count) | Sync match rate (Tasks immediately assigned to Workers) |
| [`approximate_backlog_count`](/cloud/metrics/openmetrics/metrics-reference#temporal_cloud_v1_approximate_backlog_count) | Approximate number of Tasks in a Task Queue |

Task Queue statistics are also available via the `DescribeTaskQueue` API:
- `ApproximateBacklogCount`
- `ApproximateBacklogAge`
- `TasksAddRate`
- `TasksDispatchRate`
- `BacklogIncreaseRate`

For more on Task Queue metrics, see [Available Task Queue information](/develop/worker-performance#task-queue-metrics).

### Failure metrics

| Metric | Description |
|--------|-------------|
| [`long_request_failure`](/references/sdk-metrics#long_request_failure) | Failures for long-running operations (polling, history retrieval) |
| [`request_failure`](/references/sdk-metrics#request_failure) | Failures for standard operations (Task completion responses) |

Common failure codes:
- `RESOURCE_EXHAUSTED` - Rate limits exceeded
- `DEADLINE_EXCEEDED` - Operation timeout
- `NOT_FOUND` - Resource not found

## Worker tuning tips

1. **Scale test before production**: Validate your configuration under realistic load.
2. **Infrastructure matters**: Workers don't operate in a vacuum. Consider network latency, database performance, and external service dependencies.
3. **Tune and observe**: Make incremental changes and monitor metrics before making additional adjustments.
4. **Identify the bottleneck**: Use the [theory of constraints](https://en.wikipedia.org/wiki/Theory_of_constraints). Improving non-bottleneck resources won't improve overall throughput.

For detailed tuning guidance, see:
- [Worker performance](/develop/worker-performance)
- [Worker deployment and performance best practices](/best-practices/worker)
- [Performance bottlenecks troubleshooting](/troubleshooting/performance-bottlenecks)

## Related resources

- [What is a Temporal Worker?](/workers) - Conceptual overview
- [Worker performance](/develop/worker-performance) - Comprehensive tuning guide
- [Worker deployment and performance](/best-practices/worker) - Best practices
- [SDK metrics reference](/references/sdk-metrics) - Complete metrics documentation
- [Worker Versioning](/production-deployment/worker-deployments/worker-versioning) - Safe deployments
- [Workers in production](https://temporal.io/blog/workers-in-production) - Blog post
- [Introduction to Worker Tuning](https://temporal.io/blog/an-introduction-to-worker-tuning) - Blog post
1 change: 1 addition & 0 deletions docs/encyclopedia/workers/workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Therefore, a single Worker can handle millions of open Workflow Executions, assu
**Operation guides:**

- [How to tune Workers](/develop/worker-performance)
- [Worker tuning quick reference](/develop/worker-tuning-reference) - SDK defaults and metrics

## What is a Worker Identity? {#worker-identity}

Expand Down
Loading