{"id":5207,"date":"2022-12-09T09:00:00","date_gmt":"2022-12-09T08:00:00","guid":{"rendered":"https:\/\/blog.besharp.it\/?p=5207"},"modified":"2023-03-29T15:28:38","modified_gmt":"2023-03-29T13:28:38","slug":"lambda-at-scale-tips-tricks-to-make-your-serverless-application-scalable","status":"publish","type":"post","link":"https:\/\/blog.besharp.it\/lambda-at-scale-tips-tricks-to-make-your-serverless-application-scalable\/","title":{"rendered":"Lambda at scale: Tips & Tricks to make your Serverless application scalable"},"content":{"rendered":"\n
NOTE: all quotas in this article refer to the date on which the article has been written. They could change over time.<\/em><\/p>\n\n\n\n
Introduction<\/h1>\n\n\n\n
Serverless, serverless and serverless… If you are familiar with our blog, this is one of the words we like the most. <\/p>\n\n\n\n
It allows you to focus entirely on the application code, forget about your infrastructure, and pay only for the computational power used.<\/p>\n\n\n\n
However, there are many aspects to consider when it comes to serverless computing to avoid unpleasant surprises (perhaps in production). Your application must not only be cloud-native but also serverless-native.<\/p>\n\n\n\n
This article will give you many hints and tips to keep in mind when developing an application on Lambda at scale. <\/p>\n\n\n\n
So let’s summarize some aspects to remember when working with Lambda on large numbers.<\/p>\n\n\n\n
Pay attention to the concurrency<\/h1>\n\n\n\n
When working on Lambda, one of the first limits to keep in mind is the maximum concurrency per region, 1000 by default. This means there can be a maximum of 1000 simultaneous Lambda executions for each AWS region. This limit is shared across all Lambda instances, being a region-level constraint.<\/p>\n\n\n\n
Therefore, if you have several workloads in the same region, it could be useful to configure reserved concurrency for each workload to set a maximum cap for each of them and avoid behaviors that are difficult to analyze and resolve.<\/p>\n\n\n\n
In this way, the various workloads will not “steal” the availability of Lambda if ever one of these must scale suddenly.<\/p>\n\n\n\n
In many cases, the limit of 1000 is not enough. Fortunately, this limit is soft,<\/em> so it can be increased directly from the AWS console up to a few thousand. Remember that you often have to “justify” many quota increases to AWS.<\/p>\n\n\n\n
And if that’s still not enough? The organization of your AWS accounts might need a little overhaul; maybe you need to properly configure an AWS Organization and create AWS accounts for each workload and each environment.<\/p>\n\n\n\n