anyone know how to slow down the flow of SQS messa...
# random
s
anyone know how to slow down the flow of SQS messages into Lambda? I have the default batch size of 10.. but obviously SQS is throwing stuff quickly at Lambda, and I’m getting AppSync throttle errors because it tried to call about 1000 mutations at once
g
It seems limiting the amount of messages is not really something SQS allows which is odd, you can set reserved concurrency so that lambda itself will only ever actually process however many messages you can but it will likely cause a backup and messages going to DLQ (https://betterprogramming.pub/lambda-sqs-trigger-and-concurrency-87131dad9a12) Is there any reason you cannot batch more than 10 at once?
You could also opt for just increasing the amount of requests you are allowed to do (https://console.aws.amazon.com/servicequotas/home/services/appsync/quotas/L-FC5E46D0)
s
I might try the reserved concurrency route. set it to 500, and bump up the max receive count of the queue to 5 instead of 3, so messages have a lesser chance of going into the DLQ
setting the Lambda polling SQS to a concurrency of 5 did the trick!