From ef9ca7d10b1afead78660be71e962234bf38a6e3 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Tue, 9 Apr 2024 09:49:53 +0300 Subject: [PATCH 1/3] fix: change default concurrency to 10 --- packages/serverless-api/src/api/utils/http_config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/serverless-api/src/api/utils/http_config.ts b/packages/serverless-api/src/api/utils/http_config.ts index f365a2d1..96bcca06 100644 --- a/packages/serverless-api/src/api/utils/http_config.ts +++ b/packages/serverless-api/src/api/utils/http_config.ts @@ -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); From af8b15ffccd4d943e35751a8ade698783d7730e8 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Tue, 9 Apr 2024 09:51:48 +0300 Subject: [PATCH 2/3] chore: update readme --- packages/plugin-serverless/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-serverless/README.md b/packages/plugin-serverless/README.md index e2c9421a..e73b1c5d 100644 --- a/packages/plugin-serverless/README.md +++ b/packages/plugin-serverless/README.md @@ -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 From 319a405ca653e2d66d2f74cc7992ad86e40b9cfd Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Tue, 9 Apr 2024 10:21:56 +0300 Subject: [PATCH 3/3] chore: changesets --- .changeset/sour-goats-help.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/sour-goats-help.md diff --git a/.changeset/sour-goats-help.md b/.changeset/sour-goats-help.md new file mode 100644 index 00000000..9d4b2eb6 --- /dev/null +++ b/.changeset/sour-goats-help.md @@ -0,0 +1,6 @@ +--- +'@twilio-labs/plugin-serverless': patch +'@twilio-labs/serverless-api': patch +--- + +Change default concurrency limit from 50 to 10