1

I am currently using SQS(fifo) + Lambda trigger architecture. Whenever a message is issued to SQS, a Lambda function is created and processed by the internal poller.

This is perfectly normal, typical SQS + Lambda processing logic. But I want to limit the maximum number of Lambdas created per second. No matter how hundreds of thousands of messages are delivered to SQS, the Lambda internal poller rate-limits these messages to create a Lambda function, and I want to write this rate limiting logic myself.

Is it possible? If possible, I would appreciate it if you could leave any related materials! Also, if you have a better recommended architecture than SQS + Lambda, please share!

shimo
  • 2,156
  • 4
  • 17
  • 21
  • You can sill write your own SQS consumer (on EC2 or ECS) and process on your own pace. I prefer SQS+Lambda too for its simplicity (even it is not possible to change the polling parameters) – gusto2 Aug 25 '21 at 06:06

1 Answers1

0

But I want to limit the maximum number of Lambdas created per second.

You do this by setting concurrency limit of your lambda. If you only want one function, set it to 1.

and I want to write this rate limiting logic myself.

You can't change internal logic of a lambda's SQS pooler.

Marcin
  • 215,873
  • 14
  • 235
  • 294