-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New changelogs * Up to date with new changelogs
- Loading branch information
Showing
61 changed files
with
331 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
# Concurrency Limits | ||
|
||
The Concurrency Limits feature allows you to define concurrency limits for scripts and inline scripts within flows. Its primary goal is to prevent exceeding the API Limit of the targeted API, eliminating the need for complex workarounds using worker groups. | ||
The Concurrency Limits feature allows you to define concurrency limits for scripts, flows and inline scripts within flows. Its primary goal is to prevent exceeding the API Limit of the targeted API, eliminating the need for complex workarounds using worker groups. | ||
|
||
The Concurrency Limit operates globally and across flow runs. It involves two key parameters: "Maximum number of runs" and the "Per time window (seconds)." | ||
|
||
When jobs reach the concurrency limit, they are automatically queued for execution at the next available optimal slot given the time window. | ||
|
||
## Concurrency limit of Script | ||
|
||
Concurrency limit can be set from the metadata menu. Pick "Concurrency" and define a time window and max number of executions of the flow within that time window. | ||
|
||
![Concurrency Limit](../../assets/code_editor/concurrency_limit.png.webp) | ||
|
||
## How it Works | ||
## Concurrency limit of flow | ||
|
||
From the Flow Settings menu, pick "Concurrency" and define a time window and max number of executions of the flow within that time window. | ||
|
||
![Concurrency limit of flow](../../assets/flows/concurrency_flow.png "Concurrency limit of flow") | ||
|
||
## Concurrency limit of scripts within flow | ||
|
||
The Concurrency Limit operates globally and across flow runs. It involves two key parameters: "Maximum number of runs" and the "Per time window (seconds)." | ||
|
||
Concurrency limit can be set from the metadata menu. | ||
Concurrency limit can be set for each step of a flow in the `Advanced` menu, on tab "Concurrency". | ||
|
||
When jobs reach the concurrency limit, they are automatically queued for execution at the next available optimal slot given the time window. | ||
![Concurrency Limit Scripts within Flow](../../assets/code_editor/concurrency_limit_flow.png.webp "Concurrency Limit Scripts within Flow") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Caching | ||
|
||
Caching is used to cache the results of a script, flow, flow step or app inline scripts for a specified number of seconds, thereby reducing the need for redundant computations when re-running the same step with identical input. | ||
|
||
When you configure caching, Windmill stores the result in a cache for the duration you specify. If the same runnable is re-triggered with the same input within this duration, Windmill instantly retrieves the cached result instead of re-computing it. | ||
|
||
This feature can significantly improve the performance of your scripts & flows, especially for steps that are computationally demanding or dependent on external resources, such as APIs or databases. | ||
|
||
## Cache scripts | ||
|
||
Caching a script means caching the results of that script for a certain duration. If the script is triggered with the same inputs during the given duration, it will return the cached result. | ||
|
||
<video | ||
className="border-2 rounded-xl object-cover w-full h-full" | ||
controls | ||
src="/videos/caching_script.mp4" | ||
/> | ||
|
||
<br/> | ||
|
||
You can enable caching for a script directly in the script metadata. Here's how you can do it: | ||
|
||
1. **Metadata**: From the Script Editor, pick the "Metdata" menu an scroll to "Cache". | ||
|
||
2. **Enable Caching**: To enable caching, toggle on "Cache the results for each possible inputs" and specify the desired duration for caching results (in seconds.) | ||
|
||
In the above example, the result of step the script will be cached for 180 seconds (4 minutes). If `u/henri/slow_function___base_11` is re-triggered with the same input within this period, Windmill will immediately return the cached result. | ||
|
||
## Cache flows | ||
|
||
Caching a flow means caching the results of that script for a certain duration. If the flow is triggered with the same flow inputs during the given duration, it will return the cached result. | ||
|
||
<video | ||
className="border-2 rounded-xl object-cover w-full h-full" | ||
controls | ||
src="/videos/caching_flow.mp4" | ||
/> | ||
|
||
<br/> | ||
|
||
You can enable caching for a flow directly in the flow settings. Here's how you can do it: | ||
|
||
1. **Settings**: From the Flow Editor, go to the "Settings" menu and pick the `Cache` tab. | ||
|
||
2. **Enable Caching**: To enable caching, toggle on "Cache the results for each possible inputs" and specify the desired duration for caching results (in seconds.) | ||
|
||
In the above example, the result of step the flow will be cached for 60 seconds. If `u/henri/example_flow_quickstart_no_slack` is re-triggered with the same input within this period, Windmill will immediately return the cached result. | ||
|
||
## Cache flow steps | ||
|
||
Caching a flow step means caching the results of that step for a certain duration. If the step is triggered with the same inputs during the given duration, it will return the cached result. | ||
|
||
<video | ||
className="border-2 rounded-xl object-cover w-full h-full" | ||
controls | ||
src="/videos/cache_for_steps.mp4" | ||
/> | ||
|
||
<br/> | ||
|
||
You can enable caching for a step directly in the step configuration. Here's how you can do it: | ||
|
||
1. **Select a step**: From the Flow Editor, select the step for which you want to cache the results. | ||
|
||
2. **Enable Caching**: To enable caching, navigate to the `Advanced` menu and select `Cache`. Toggle it on and specify the desired duration for caching results (in seconds.) | ||
|
||
![Caching result example](../../assets/flows/cache_steps.gif) | ||
|
||
In the above example, the result of step `a` will be cached for 86400 seconds (1 day). If `a` is re-triggered with the same input within this period, Windmill will immediately return the cached result. | ||
|
||
:::tip Step Mocking | ||
|
||
[Step mocking](../../flows/5_step_mocking.md) allows faster iteration. When a step is mocked, it will immediately return the mocked value without performing any computation. | ||
|
||
::: | ||
|
||
## Cache app inline scripts | ||
|
||
Caching an app inline script means caching the results of that script for a certain duration. If the script is triggered with the same inputs during the given duration, it will return the cached result. | ||
|
||
<video | ||
className="border-2 rounded-xl object-cover w-full h-full" | ||
controls | ||
src="/videos/caching_app.mp4" | ||
/> | ||
|
||
<br/> | ||
|
||
You can enable caching for an app inline script directly its editor settings. Here's how you can do it: | ||
|
||
1. **Settings**: From the Code Editor, go to the top bar and pick the `Cache` tab. | ||
|
||
2. **Enable Caching**: To enable caching, toggle on "Cache the results for each possible inputs" and specify the desired duration for caching results (in seconds.) | ||
|
||
In the above example, the result of step the script will be cached for 5 minutes. If `Inline Script 0` is re-triggered with the same input within this period, Windmill will immediately return the cached result. | ||
|
||
## Conclusion | ||
|
||
Caching is a powerful tool that can optimize your workflows in Windmill. By caching the results, you can eliminate unnecessary computation and accelerate your workflows. | ||
|
||
However, it's essential to use caching judiciously: while it can greatly enhance efficiency, overusing the cache or using it for unsuitable scripts or flows can result in outdated results or unwarranted memory usage. Always consider the nature of your step and the data it processes when deciding whether to enable caching. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-394 KB
docs/core_concepts/3_resources_and_types/add_resource_postgresql.png
Binary file not shown.
Binary file removed
BIN
-38.3 KB
docs/core_concepts/3_resources_and_types/add_resource_postgresql.png.avif
Binary file not shown.
Binary file removed
BIN
-76.7 KB
docs/core_concepts/3_resources_and_types/add_resource_postgresql.png.webp
Binary file not shown.
Binary file modified
BIN
+28.1 KB
(110%)
docs/core_concepts/3_resources_and_types/add_resource_type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-41.8 KB
docs/core_concepts/3_resources_and_types/add_resource_type.png.avif
Binary file not shown.
Binary file removed
BIN
-59.1 KB
docs/core_concepts/3_resources_and_types/add_resource_type.png.webp
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+28.2 KB
(110%)
docs/core_concepts/3_resources_and_types/resource_type_json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-33.5 KB
docs/core_concepts/3_resources_and_types/resource_type_json.png.avif
Binary file not shown.
Binary file removed
BIN
-65.5 KB
docs/core_concepts/3_resources_and_types/resource_type_json.png.webp
Binary file not shown.
Binary file modified
BIN
+69.3 KB
(110%)
docs/core_concepts/5_monitor_past_and_future_runs/1-runs-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-55.8 KB
docs/core_concepts/5_monitor_past_and_future_runs/1-runs-menu.png.avif
Binary file not shown.
Binary file removed
BIN
-90 KB
docs/core_concepts/5_monitor_past_and_future_runs/1-runs-menu.png.webp
Binary file not shown.
Binary file modified
BIN
+24.1 KB
(110%)
docs/core_concepts/5_monitor_past_and_future_runs/2-detail-per-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-56.7 KB
docs/core_concepts/5_monitor_past_and_future_runs/2-detail-per-run.png.avif
Binary file not shown.
Binary file removed
BIN
-71.5 KB
docs/core_concepts/5_monitor_past_and_future_runs/2-detail-per-run.png.webp
Binary file not shown.
Binary file modified
BIN
+228 KB
(180%)
docs/core_concepts/5_monitor_past_and_future_runs/3-scheduled-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-48.2 KB
docs/core_concepts/5_monitor_past_and_future_runs/3-scheduled-run.png.avif
Binary file not shown.
Binary file removed
BIN
-52 KB
docs/core_concepts/5_monitor_past_and_future_runs/3-scheduled-run.png.webp
Binary file not shown.
Binary file modified
BIN
+13.8 KB
(100%)
docs/core_concepts/5_monitor_past_and_future_runs/4-filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-39.6 KB
docs/core_concepts/5_monitor_past_and_future_runs/4-filters.png.avif
Binary file not shown.
Binary file removed
BIN
-55.7 KB
docs/core_concepts/5_monitor_past_and_future_runs/4-filters.png.webp
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.