Skip to content

Commit

Permalink
FRIDGE-1084 Change default concurrency limit (#517)
Browse files Browse the repository at this point in the history
* fix: change default concurrency to 10

* chore: update readme

* chore: changesets
  • Loading branch information
victoray authored Apr 9, 2024
1 parent cdf9e3a commit 8dee2e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/sour-goats-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-labs/plugin-serverless': patch
'@twilio-labs/serverless-api': patch
---

Change default concurrency limit from 50 to 10
4 changes: 2 additions & 2 deletions packages/plugin-serverless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ USAGE
### Concurrency

When deploying lots of Functions and Assets it is possible to run up against the enforced concurrency limits of the Twilio API. You can limit the concurrency and set how many times the library retries API requests using environment variables.

The default concurrency is 50 and the default number of retries is 10. You can change this by setting environment variables. The following would set concurrency to 1, only 1 live request at a time, and retries to 0, so if it fails it won't retry.
It is advisable to keep the concurrency low (around 10-15) to avoid hitting the rate limits of the Twilio API.
The default concurrency is 10 and the default number of retries is 10. You can change this by setting environment variables. The following would set concurrency to 1, only 1 live request at a time, and retries to 0, so if it fails it won't retry.

```sh-session
export TWILIO_SERVERLESS_API_CONCURRENCY=1
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-api/src/api/utils/http_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (typeof retryLimit === 'undefined') {

let concurrency = process.env.TWILIO_SERVERLESS_API_CONCURRENCY;
if (typeof concurrency === 'undefined') {
concurrency = '50';
concurrency = '10';
}

export const RETRY_LIMIT = parseInt(retryLimit, 10);
Expand Down

0 comments on commit 8dee2e8

Please sign in to comment.