brefphp / laravel-bridge

Package to use Laravel on AWS Lambda with Bref
https://bref.sh/docs/frameworks/laravel.html
MIT License
314 stars 63 forks source link

Rate Limit #3

Closed matheus-lucena closed 4 years ago

matheus-lucena commented 4 years ago

There is some way to create a rate limit in the execution of the SQS, because I have a queue that processes sending email via SES, however I have a limitation of sending emails per second.

mnapoli commented 4 years ago

One solution is to throttle the Lambda by setting its reservedConcurrency setting in serverless.yml (for example to 5). That limits the number of Lambda instances (i.e. Laravel workers) that will run concurrently.

Here is a visual explanation: https://twitter.com/matthieunapoli/status/1239960297529622528 I'm currently working on a book that explains all of this, but in the meantime maybe the tweet can help.