"Reduce cost or Increase performance ? Why not both : Thanks to Lambda tweaking!!"
Arnauv Kaushik
AWS Educate Challenge winner || AWS certified hands-on Solutions Architect || Ex- Coca-Cola Company || Drummer || MCU geek and dog lover
Contents : Serverless Architecture + Lambda tweaking + Load Testing + Run comparison
The main advantage of using Serverless architecture/components is that there are ?? ???????????? that come with serverless :
1 - No need to provision or manage any servers.
2 - NEVER pay for idle resources.
3 - Autoscales, no need to manage scaling.
4 - Inherently highly available.
?????? ????????????????????????/?????????? - brief version
1 - IAM policy and role - Access to DDB, Cloudwatch.
2 - Lambda - create the function CRUD logic resides here.
3 - APIG - Create a REST API - POST method (due to payload to enter items or list DDB items).
4 - DynamoDB - Create table.
5 - POSTMAN - to test API calls and Load testing simulation.
???????? ??????????????
Using POSTMAN to simulate - Run vCPUs for a certain duration.
领英推荐
???????????????? ?? - The default 128-512 MB Lambda memory - 20 vCPUs for 2 minutes
???????????????? ?? - 512-1024 MB Lambda memory - 20 vCPUs for 2 minutes
Note that you can go to the Lambda function, and tweak it under “Configuration” as per the screenshot and edit as needed.
?????????????? :
POSTMAN has this “Compare Runs ” feature that I have added in the screenshot that shows both runs together and displays the differences in stats.
????????????????????:
The allocated memory for a lambda function is directly proportional to the vCPUs and hence computer capacity behind it, so the tradeoff is using more memory for less duration of the lambda function. So where many may think that more memory invites more cost, it also reduces your computation time which is what Lambda is charged for!
Lambda tweaking is how you can get a balance between cost optimization and performance efficiency.
???????? : I will be posting a detailed(techy) version of this hands-on soon to help you be able to set it up from scratch and load test yourself, play around with lambda and this serverless architecture.
If you have any questions, suggestions for future posts, feel free to reach out, I‘ll be happy to help from my experience!
#AWS #Serverless #Microservice #CostOptimization #PerformanceEfficiency
Solution Architect @Telus Digital-|AWS| System Design| Solution Architecture |DevOps & Cloud | Kubernetes| CI/CD| Terraform| GCP| HA| Scalability| Reliability| Security | Cost Optimization | Disaster Recovery
4 个月Good one Arnauv. There is always a trade of between cost and performance while building highly available and scalable architecture but this one really loved it.
Data Analyst @ OpenSky Data Systems | Microsoft Certified: Power BI Data Analyst Associate
4 个月Insightful
AWS Solution Architect | 3X AWS | Terraform | Kubernetes | EKS | DXC Diamond Award Winner
4 个月Very informative Arnauv!! Thanks for sharing.