Skip to content

Commit b98e56f

Browse files
add tips to reduce latency
1 parent db59016 commit b98e56f

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

docs-v2/pages/troubleshooting.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,18 @@ Pipedream also operates a [built-in key-value store](/data-stores/) that you can
246246

247247
Use Pipedream's [built-in Delay actions](/workflows/flow-control/#delay) to delay a workflow at any step.
248248

249+
### How can my workflow run faster?
250+
251+
Here are a few things that can help your workflow execute faster:
252+
253+
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.
254+
255+
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.
256+
257+
3. **Simplify Your Workflow:** Reduce the number of steps and [segments](/workflows/control-flow#workflow-segments) in your workflow. This lowers the overhead involved in managing step execution and exports.
258+
259+
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.
260+
249261
### How can I save common functions as steps?
250262

251263
You can create your own custom triggers and actions ("components") on Pipedream using [the Component API](/components/api/). These components are private to your account and can be used in any workflow.

docs-v2/pages/workflows/settings.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ By default, workflows run with {process.env.MEMORY_LIMIT} of memory. If you're p
112112

113113
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.
114114

115+
<Callout type="info">
116+
**Reducing Workflow Latency**
117+
118+
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.
119+
For other ways to improve your workflow's performance, see [Troubleshooting](/troubleshooting#how-can-my-workflow-run-faster).
120+
121+
</Callout>
122+
115123
**Pipedream charges credits proportional to your memory configuration**. When you modify your memory settings, Pipedream will show you the number of credits you'll be charged per execution. [Read more here](/pricing/#how-does-workflow-memory-affect-credits).
116124

117125
### Concurrency and Throttling

docs-v2/pages/workflows/triggers.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ import got from "got";
195195
export default defineComponent({
196196
async run({ steps, $ }) {
197197
const pipeline = promisify(stream.pipeline);
198-
198+
199199
await pipeline(
200200
got.stream(steps.trigger.event.body.raw_body_url),
201201
fs.createWriteStream(`/tmp/raw_body`)
@@ -295,6 +295,14 @@ By default, when you send a [valid HTTP request](#valid-requests) to your endpoi
295295

296296
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.
297297

298+
299+
<Callout type="info">
300+
**Reducing Workflow Latency**
301+
302+
To reduce latency for HTTP requests, return a static response 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. For more information, see [Sources](https://pipedream.com/docs/sources).
303+
304+
</Callout>
305+
298306
#### Customizing the HTTP response
299307

300308
If you need to issue a custom HTTP response from a workflow, you can either:

0 commit comments

Comments
 (0)