Performance
View as MarkdownA Temporal Worker caches Workflow state in memory, while a Dex Worker reads saved state from Dex Server and caches large values on disk. Dex Server writes to a log in object storage and serves reads from local disk, while the Temporal services read and write a database.
Worker memory and CPU
Temporal. With Sticky Execution, "the Worker caches the Workflow state in memory". Every SDK limits the cache by a count of Workflow Executions. The defaults are 10,000 in Go and .NET, 600 in Java, and 1,000 in Python, and TypeScript derives its default from the heap size (Worker tuning reference). No SDK option limits the cache by bytes or puts it on disk. An evicted Workflow Execution is replayed from its Event History on its next task.
Dex. Dex saves Attributes with each Step, so a Worker needs no history cache to continue a Flow. Dex sends a large value as a reference, and the SDK reads it through the blob cache, a local directory with a byte limit. Sticky routing offers a Flow's next task to the Worker that served it before, for up to 5 seconds.
The benchmark first filled 1,200 conversations, each with 40 exchanges of 8 KiB messages. Then 1,000 of them came back at 4 per second, and each sent 3 follow-up messages, 3,000 in all. The Worker ran in a container with 2 CPUs and no swap, with the Python SDK on both sides. Memory is the container's working set, as docker stats shows it. The Dex line ends earlier because sampling stops after a run's last reply. Each configuration ran once. The data of every run is in bench/results.
| Configuration | Peak working set | Mean CPU (100% is one CPU) | Follow-up messages answered |
|---|---|---|---|
| Temporal, default cache (1,000), 512 MiB limit | 512.0 MiB, 1 OOM kill | 176.2% | 1,042 of 1,757 sent |
| Temporal, cache of 50, 512 MiB limit | 511.8 MiB, 2 OOM kills | 180.8% | 1,493 of 2,130 sent |
| Temporal, cache of 50, 2 GiB limit | 581.6 MiB | 36.3% | 3,000 of 3,000 |
| Dex, 1 GiB blob cache, 512 MiB limit | 85.5 MiB | 17.7% | 3,000 of 3,000 |
| Dex, 1 GiB blob cache, 2 GiB limit | 79.8 MiB | 17.4% | 3,000 of 3,000 |
At the 512 MiB limit, the Temporal Worker was killed with the default cache and with a cache of 50, which also had 1,186 cache misses and 2,497 forced evictions. Temporal answered every message only with a 2 GiB limit, and its cache of 50 then had 1,980 misses. The Dex Worker stayed under 100 MiB at both limits.
Server throughput
Temporal. The History service persists Workflow state and events in the database, Cassandra, MySQL, or PostgreSQL, and keeps in-memory caches.
Dex. Dex Server writes each change to a log in object storage, then applies it to a local store. A started Flow or a SYNC Step result is in object storage before Dex reports it. Reads of current state come from local disk. The writes of many Flows share one log write: a busy node made 23 to 98 log PUTs per second in the benchmark. History moves to object storage by default (History offload). A hot standby follows the log and takes over after the lease ends, 10 seconds by default.
The table gives the peak throughput of one Dex Server node on AWS, with its log in S3 Standard. Performance gives the conditions and the latency.
| Operation | c7gd.large (2 vCPU) | c7gd.4xlarge (16 vCPU) |
|---|---|---|
| SYNC Steps | 1,772/s | 8,403/s |
| ASYNC Steps | 2,105/s | 10.1k/s |
| Flows started and completed, one Step each | 1,111/s | 5,626/s |
| RPCs that read one Attribute | 15,392/s | 67.3k/s |
| RPCs that lock and update one Attribute | 2,165/s | 13.8k/s |
| Reads of ten 16 KiB Attributes, without a Worker | 5,941/s | 11.3k/s |
Temporal Cloud limits a Namespace to 500 actions per second by default (Temporal Cloud limits).
Next
- Operations: what you deploy, size, and code around on each side.
- Performance: how the Dex Server benchmark ran, its latency, and what it costs to run.

