-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tips to reduce latency #13996
base: master
Are you sure you want to change the base?
Tips to reduce latency #13996
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request introduces updates to the documentation, focusing on enhancing workflow performance in Pipedream. Key changes include the addition of strategies for optimizing workflows, such as increasing memory allocation, returning static HTTP responses, simplifying workflows, and activating warm workers. Informational callouts regarding latency reduction for HTTP requests are also included, providing users with actionable advice to improve efficiency. Changes
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
docs-v2/pages/workflows/triggers.mdx (1)
198-198
: Consider removing the empty line.Adding an empty line does not affect the functionality and may be intended to improve the formatting. However, in documentation files, it's generally recommended to keep the content concise by avoiding unnecessary empty lines.
-
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- docs-v2/pages/troubleshooting.mdx (1 hunks)
- docs-v2/pages/workflows/settings.mdx (1 hunks)
- docs-v2/pages/workflows/triggers.mdx (2 hunks)
Additional comments not posted (3)
docs-v2/pages/workflows/settings.mdx (1)
115-121
: Excellent addition to the documentation!The callout provides a clear and actionable suggestion for reducing workflow latency by increasing memory allocation. Specifying the recommended value of 512MB and comparing it to the default of 256MB helps users understand the potential performance improvement.
Increased memory allocation allows the workflow to handle more data in memory without needing to rely on slower disk I/O operations. It also provides more resources for compute-intensive tasks, resulting in faster execution times.
Referencing the troubleshooting section for additional performance optimization strategies is a great way to encourage users to explore other techniques and gain a deeper understanding of the platform.
docs-v2/pages/troubleshooting.mdx (1)
249-260
: Excellent addition of performance optimization tips!The new "How can my workflow run faster?" section provides clear and actionable advice for users to improve their workflow performance. The tips cover key areas like resource allocation, response handling, simplification, and cold starts.
The consistent formatting, helpful tone, and links to relevant documentation make these tips easy to understand and implement. Including this section in the troubleshooting guide is a great way to proactively address common performance issues.
docs-v2/pages/workflows/triggers.mdx (1)
298-305
: LGTM!The informational callout provides a helpful tip for reducing workflow latency when handling HTTP requests. Returning a static response directly from the trigger configuration is an effective way to send the HTTP response immediately, without waiting for the remaining workflow steps to execute.
The reference to the "Sources" documentation is also useful for directing users to more detailed information on this topic.
|
||
Here are a few things that can help your workflow execute faster: | ||
|
||
1. **Increase Memory Allocation:** Increase your [workflow memory](/workflows/settings#memory) to at least 512 MB. Raising the memory limit will proportionally increase CPU resources, leading to improved performance and reduced latency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Increase Memory Allocation" -> "Increase memory"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the colon out of the bold here and in the rest of these sections
|
||
1. **Increase Memory Allocation:** Increase your [workflow memory](/workflows/settings#memory) to at least 512 MB. Raising the memory limit will proportionally increase CPU resources, leading to improved performance and reduced latency. | ||
|
||
2. **Return Static HTTP Responses:** If your workflow is triggered by an HTTP source, return a [static HTTP response](/workflows/triggers#http-responses) directly from the trigger configuration. This ensures the HTTP response is sent to the caller immediately, before the rest of the workflow steps are executed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Return Static HTTP Responses" -> "Return static HTTP responses". Generally we only capitalize the first words of these sections, or proper nouns or other Pipedream features, but see here how "static" and "responses" should be lowercase.
|
||
2. **Return Static HTTP Responses:** If your workflow is triggered by an HTTP source, return a [static HTTP response](/workflows/triggers#http-responses) directly from the trigger configuration. This ensures the HTTP response is sent to the caller immediately, before the rest of the workflow steps are executed. | ||
|
||
3. **Simplify Your Workflow:** Reduce the number of [steps](/workflows/steps#code-actions) and [segments](/workflows/control-flow#workflow-segments) in your workflow. This lowers the overhead involved in managing step execution and exports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
3. **Simplify Your Workflow:** Reduce the number of [steps](/workflows/steps#code-actions) and [segments](/workflows/control-flow#workflow-segments) in your workflow. This lowers the overhead involved in managing step execution and exports. | ||
|
||
4. **Activate Warm Workers:** Use and increase the number of dedicated workers to [eliminate cold starts](/workflows/settings#eliminate-cold-starts), ensuring your workflow is ready to execute immediately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change:
Use and increase the number of dedicated workers to eliminate cold starts, ensuring your workflow is ready to execute immediately.
to:
Use warm workers to reduce the startup time of workflows. Set as many warm workers as you want for high-volume traffic.
@@ -112,6 +112,14 @@ By default, workflows run with {process.env.MEMORY_LIMIT} of memory. If you're p | |||
|
|||
Increasing your workflow's memory gives you a proportional increase in CPU, so increasing your workflow's memory can reduce its overall runtime and make it more performant. | |||
|
|||
<Callout type="info"> | |||
**Reducing Workflow Latency** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use the same terminology you do in the troubleshooting guide: "How can my workflow run faster?"
<Callout type="info"> | ||
**Reducing Workflow Latency** | ||
|
||
To reduce latency from the trigger to the end of your workflow, consider increasing the memory allocation to at least 512MB. This will result in significantly better performance compared to the default 256MB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid duplicating the content you have in the troubleshooting guide, maybe just simplify and say:
@@ -295,6 +294,14 @@ By default, when you send a [valid HTTP request](#valid-requests) to your endpoi | |||
|
|||
When you're processing HTTP requests, you often don't need to issue any special response to the client. We issue this default response so you don't have to write any code to do it yourself. | |||
|
|||
|
|||
<Callout type="info"> | |||
**Reducing Workflow Latency** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same feedback from above here
WHY
Summary by CodeRabbit
New Features
Documentation