You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/best-practices/cost-optimization.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ See [Spooky Stories: Chilling Temporal Anti-Patterns](https://temporal.io/blog/s
62
62
### Large payloads in Workflow History
63
63
64
64
Passing multi-megabyte payloads through Workflows when external storage (S3, blob storage) is more appropriate.
65
-
Use [compression](/troubleshooting/blob-size-limit-error#why-does-this-error-occur) or the [claim check pattern](https://dataengineering.wiki/Concepts/Software+Engineering/Claim+Check+Pattern) for large data.
65
+
Use [compression](/troubleshooting/blob-size-limit-error#payload-size-limit) or the [claim check pattern](https://dataengineering.wiki/Concepts/Software+Engineering/Claim+Check+Pattern) for large data.
66
66
67
67
### Over-optimization at the expense of observability
Copy file name to clipboardExpand all lines: docs/cloud/capacity-modes.mdx
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,12 +133,6 @@ This means that your default limit would be 800 APS.
133
133
134
134
## Provisioned Capacity {#provisioned-capacity}
135
135
136
-
:::tip Support, stability, and dependency info
137
-
138
-
Provisioned Capacity is currently in [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
139
-
140
-
:::
141
-
142
136
Provisioned Capacity provides an alternative to On-Demand Capacity by allowing you to control the limits on your Namespace based on your specific need.
143
137
144
138
|| Actions Per Second | Requests Per Second | Operations Per Second|
Copy file name to clipboardExpand all lines: docs/cloud/worker-health.mdx
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,12 @@ This page is a guide to monitoring a Temporal Worker fleet and covers the follow
39
39
-[How to detect misconfigured Workers](#detect-misconfigured-workers)
40
40
-[How to configure Sticky cache](#configure-sticky-cache)
41
41
42
+
:::tip
43
+
44
+
You can also inspect Workers and the Workers assigned to a Task Queue directly in the Temporal UI. See [Visualize Workers in the UI](/develop/worker-performance#visualize-workers).
45
+
46
+
:::
47
+
42
48
## Minimal Observations {#minimal-observations}
43
49
44
50
These alerts should be configured and understood first to gain intelligence into your application health and behaviors.
@@ -450,6 +456,14 @@ Set the `WorkerHeartbeatInterval` property on [`TemporalRuntimeOptions`](https:/
450
456
Set it to `null` to disable heartbeating.
451
457
452
458
</SdkTabs.DotNet>
459
+
<SdkTabs.Java>
460
+
461
+
_Available since Java SDK v1.35.0_
462
+
463
+
Set the heartbeat interval on [`WorkflowClientOptions.Builder`](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/WorkflowClientOptions.Builder.html) with `setWorkerHeartbeatInterval(Duration)`.
464
+
Set it to a negative `Duration` to disable heartbeating.
-**Temporal .NET SDK** (v1.12.0 or higher). See the [.NET Quickstart](https://docs.temporal.io/develop/dotnet/set-up-your-local-dotnet) for install instructions.
65
63
66
-
-**Temporal CLI** (Pre-release version with Standalone Activity support)
67
-
68
-
Download for your platform:
64
+
-**Temporal CLI** v1.7.0 or higher
69
65
70
-
```bash title="macOS (Apple Silicon)"
71
-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_darwin_arm64.tar.gz | tar xz
72
-
```
66
+
Install with Homebrew:
73
67
74
-
```bash title="macOS (Intel)"
75
-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_darwin_amd64.tar.gz | tar xz
76
-
```
77
-
78
-
```bash title="Linux (arm64)"
79
-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_linux_arm64.tar.gz | tar xz
68
+
```bash
69
+
brew install temporal
80
70
```
81
71
82
-
```bash title="Linux (amd64)"
83
-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_linux_amd64.tar.gz | tar xz
84
-
```
72
+
Or see the [Temporal CLI install guide](/cli#install) for other platforms.
85
73
86
74
Verify the installation:
87
75
88
76
```bash
89
-
./temporal --version
90
-
# temporal version 1.6.2-standalone-activity (Server 1.31.0-151.2, UI 2.47.2)
77
+
temporal --version
91
78
```
92
79
93
-
Move the binary to your PATH or run it from the current directory as `./temporal`.
94
-
95
-
:::warning
96
-
97
-
If you see `Standalone activity is disabled` when running commands, you are using the standard
98
-
Temporal CLI instead of the pre-release version above. The standard `brew install temporal` or
99
-
`brew upgrade temporal` does not include Standalone Activity support during Pre-release.
100
-
101
-
:::
102
-
103
80
Start the Temporal development server:
104
81
105
82
```bash
106
-
./temporal server start-dev
83
+
temporal server start-dev
107
84
```
108
85
109
86
This command automatically starts the Temporal development server with the Web UI, and creates the `default` Namespace.
@@ -251,7 +228,7 @@ You can pass the Activity as either a lambda expression or a string Activity typ
Workflow logic is constrained by [deterministic execution requirements](/workflow-definition#deterministic-constraints).
48
-
Therefore, each language is limited to the use of certain idiomatic techniques.
49
-
However, each Temporal SDK provides a set of APIs that can be used inside your Workflow to interact with external (to the Workflow) application code.
47
+
Workflow logic is constrained by [deterministic execution requirements](/workflow-definition#deterministic-constraints). Each Temporal SDK provides a set of APIs that can be used inside your Workflow to interact with application code outside the Workflow.
50
48
51
-
This means there are several things Workflows cannot do such as:
49
+
This means there are several things Workflows shouldn't do such as:
52
50
53
51
- Perform IO (network, disk, stdio, etc)
54
52
- Access/alter external mutable state
@@ -65,34 +63,28 @@ This is especially true with `Task`s.
65
63
Temporal requires that the deterministic `TaskScheduler.Current` is used, but many .NET async calls will use `TaskScheduler.Default` implicitly (and some analyzers even encourage this).
66
64
Here are some known gotchas to avoid with .NET tasks inside of Workflows:
67
65
68
-
- Do not use `Task.Run` - this uses the default scheduler and puts work on the thread pool.
69
-
- Use `Workflow.RunTaskAsync` instead.
70
-
- Can also use `Task.Factory.StartNew` with current scheduler or instantiate the `Task` and run `Task.Start` on it.
71
-
- Do not use `Task.ConfigureAwait(false)` - this will not use the current context.
72
-
- If you must use `Task.ConfigureAwait`, use `Task.ConfigureAwait(true)`.
73
-
- There is no significant performance benefit to `Task.ConfigureAwait` in workflows anyways due to how the scheduler works.
74
-
- Do not use anything that defaults to the default task scheduler.
75
-
- Do not use `Task.Delay`, `Task.Wait`, timeout-based `CancellationTokenSource`, or anything that uses .NET built-in timers.
76
-
-`Workflow.DelayAsync`, `Workflow.WaitConditionAsync`, or non-timeout-based cancellation token source is suggested.
77
-
- Do not use `Task.WhenAny`.
78
-
- Use `Workflow.WhenAnyAsync` instead.
66
+
- Use `Workflow.RunTaskAsync` instead of `Task.Run`. `Task.Run` uses the default scheduler and puts work on the thread pool.
67
+
- You can also use `Task.Factory.StartNew` with current scheduler or instantiate the `Task` and run `Task.Start` on it.
68
+
- If you need to use `Task.ConfigureAwait`, use `Task.ConfigureAwait(true)`. `Task.ConfigureAwait(false)` won't use the current context.
69
+
- There is no significant performance benefit to `Task.ConfigureAwait` in workflows because of how the scheduler works.
70
+
- Avoid anything that defaults to the default task scheduler.
71
+
- Use `Workflow.DelayAsync`, `Workflow.WaitConditionAsync`, or non-timeout-based cancellation token sources instead of `Task.Delay`, `Task.Wait`, timeout-based `CancellationTokenSource`, or anything that uses .NET built-in timers.
72
+
- Use `Workflow.WhenAnyAsync` instead of `Task.WhenAny`.
79
73
- Technically this only applies to an enumerable set of tasks with results or more than 2 tasks with results. Other
80
74
uses are safe. See [this issue](https://github.com/dotnet/runtime/issues/87481).
81
-
- Do not use `Task.WhenAll`
82
-
- Use `Workflow.WhenAllAsync` instead.
75
+
- Use `Workflow.WhenAllAsync` instead of `Task.WhenAll`.
83
76
- Technically `Task.WhenAll` is currently deterministic in .NET and safe, but it is better to use the wrapper to be
84
77
sure.
85
-
- Do not use `CancellationTokenSource.CancelAsync`.
86
-
- Use `CancellationTokenSource.Cancel` instead.
87
-
- Do not use `System.Threading.Semaphore` or `System.Threading.SemaphoreSlim` or `System.Threading.Mutex`.
88
-
- Use `Temporalio.Workflows.Semaphore` or `Temporalio.Workflows.Mutex` instead.
78
+
- Use `CancellationTokenSource.Cancel` instead of `CancellationTokenSource.CancelAsync`.
79
+
- Use `Temporalio.Workflows.Semaphore` or `Temporalio.Workflows.Mutex` instead of `System.Threading.Semaphore`, `System.Threading.SemaphoreSlim`, or `System.Threading.Mutex`.
89
80
-_Technically_`SemaphoreSlim` does work if only the async form of `WaitAsync` is used without no timeouts and
90
81
`Release` is used. But anything else can deadlock the workflow and its use is cumbersome since it must be disposed.
91
82
- Be wary of additional libraries' implicit use of the default scheduler.
92
83
- For example, while there are articles for `Dataflow` about [using a specific scheduler](https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/how-to-specify-a-task-scheduler-in-a-dataflow-block), there are hidden implicit uses of `TaskScheduler.Default`. For example, see [this bug](https://github.com/dotnet/runtime/issues/83159).
93
84
94
85
In order to help catch wrong scheduler use, by default the Temporal .NET SDK adds an event source listener for info-level task events.
95
86
While this technically receives events from all uses of tasks in the process, we make sure to ignore anything that is not running in a Workflow in a high performant way (basically one thread local check).
87
+
96
88
For code that does run in a Workflow and accidentally starts a task in another scheduler, an `InvalidWorkflowOperationException` will be thrown which "pauses" the Workflow (fails the Workflow Task which continually retries until the code is fixed).
97
89
This is unfortunately a runtime-only check, but can help catch mistakes early. If this needs to be turned off for any reason, set `DisableWorkflowTracingEventListener` to `true` in Worker options.
Copy file name to clipboardExpand all lines: docs/develop/dotnet/workflows/versioning.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,8 @@ import { CaptionedImage } from '@site/src/components';
31
31
32
32
Since Workflow Executions in Temporal can run for long periods — sometimes months or even years — it's common to need to make changes to a Workflow Definition, even while a particular Workflow Execution is in progress.
33
33
34
-
The Temporal Platform requires that Workflow code is [deterministic](/workflow-definition#deterministic-constraints).
35
-
If you make a change to your Workflow code that would cause non-deterministic behavior on Replay, you'll need to use one of our Versioning methods to gracefully update your running Workflows.
34
+
The Temporal Platform requires that Workflow code is [deterministic](/workflow-definition#deterministic-constraints). If you make a change to your Workflow code that would cause non-deterministic behavior on Replay, you'll need to use one of our Versioning methods to gracefully update your running Workflows. This only applies to Workflow orchestration logic. Non-deterministic work such as API calls, and database queries should be placed in Activities, which Temporal retries reliably.
35
+
36
36
With Versioning, you can modify your Workflow Definition so that new executions use the updated code, while existing ones continue running the original version.
37
37
There are two primary Versioning methods that you can use:
0 commit comments