How does AWS Lambda scale - Reserve Capacity - AWS Service Deep Dive

  Рет қаралды 5,942

Complete Coding - Master AWS Serverless

Complete Coding - Master AWS Serverless

Күн бұрын

In this video we'll talk about the process of automatic Lambda scaling and some issues that can arise with this. We'll then talk about reserve capacity and how that can resolve one of the issues with automatic scaling but brings a few other of it's own.

Пікірлер: 36
@SeanLarge1
@SeanLarge1 2 жыл бұрын
this might be the only video on youtube without a thumbs down, great break down!
@CompleteCoding
@CompleteCoding 2 жыл бұрын
1 year, 2k views and no thumbs down. Pretty happy with that :D
@josealbert7806
@josealbert7806 2 жыл бұрын
Great lineup explanation, highly appreciated.
@CompleteCoding
@CompleteCoding 2 жыл бұрын
Thanks Jose
@savanvadalia
@savanvadalia 3 жыл бұрын
Very helpul, please keep making these in depth videos
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Thanks, will do!
@sonia10647
@sonia10647 3 жыл бұрын
Great video. Easy to understand. Thanks.
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Glad it was helpful!
@amrhossam8058
@amrhossam8058 2 жыл бұрын
very good explanation bro
@sparrowestes962
@sparrowestes962 Жыл бұрын
Thanks for the clear explanations!
@CompleteCoding
@CompleteCoding Жыл бұрын
Glad it was helpful!
@piyushraj7901
@piyushraj7901 3 жыл бұрын
indepth and great content , thanks for sharing
@CompleteCoding
@CompleteCoding 3 жыл бұрын
Glad you liked it!
@giridharansubramanian3923
@giridharansubramanian3923 Жыл бұрын
Great video again!
@CompleteCoding
@CompleteCoding Жыл бұрын
Glad you enjoyed it!
@Naveenkumar-hs7ec
@Naveenkumar-hs7ec Жыл бұрын
awesome explanation
@CompleteCoding
@CompleteCoding Жыл бұрын
Glad you liked it
@ray811030
@ray811030 2 жыл бұрын
Thanks for your sharing
@CompleteCoding
@CompleteCoding 2 жыл бұрын
Thanks for watching!
@karthikvenkataram4790
@karthikvenkataram4790 10 ай бұрын
👏👏👏👏👏
@florianb2572
@florianb2572 Жыл бұрын
Hum, and how does it work with an async request without await in it? like I return a 200 to the client, but I still have some running code in it. The lambda function cool down as soon as there is a return or it keeps working while the JS stack is not empty? The answer seems clear but I just want to be sure ?
@CompleteCoding
@CompleteCoding Жыл бұрын
There is a configuration option in Lambda to either kill any processes that are running when you return, or to leave the lambda running until the JS event stack is empty. In general you should never return until all of your processes are completed. If you need to have something that runs a lot longer but you need to return an API response, it is best to invoke another process (fire EventBridge Event, add SQS event, call another lambda, trigger step function, etc) and then return your response. You handle that long running task' in another process.
@praneeth0820
@praneeth0820 3 жыл бұрын
Great content, very useful !! One suggestion - would be great if you can bump up ur speach rate, nothing serious but sounds very scripted and cautious !!!!
@CompleteCoding
@CompleteCoding 3 жыл бұрын
If you want you can speed up youtube videos using the setting cog on the player. I tend to watch a lot of videos on 1.5 speed and pause it if I need to
@ray811030
@ray811030 2 жыл бұрын
Can I say QPS for lambda at most is 1000? by default
@CompleteCoding
@CompleteCoding 2 жыл бұрын
You can have 1000 lambdas running at any one time. That doesn't mean 1000 QPS though. If a lambda only runs for 100ms, you could do 1000 requests and then another 1000 100ms later => 10K QPS. On the other side if your lambda takes 5 seconds to run, you could start 1000 at the same time, but have to wait 5s before starting the next 1000. This averages to 200 QPS.
@mohammedramadan3480
@mohammedramadan3480 2 жыл бұрын
can I ask for 100k request per second ( 100k concurrency limit ) ? if yes, do you know how much does it cost ?
@CompleteCoding
@CompleteCoding 2 жыл бұрын
You could ask for a lambda concurrency of 100K but I think AWS might say no- or at least as for a very good reason. Do you mean 100K requests/second or 100K concurrent request. These number are only the same if every request takes exactly 1s to run. Cost - assuming constant 100K requests/s for 0.3s per request 60s * 60m * 24h * 30d = 259 200 Million lambda invokes = $51,840 259.2 B invokes * 128mb * 0.3s * Lambda GB/s cost = $162,000.324 These are just estimate costs. Things that could change this 100k/s is probably the peak rate, what is the total invokes/month? how long would the lambda need to run for? What size memory does it need? If you're triggering with API Gateway then that's an extra cost. It sound like your use case might not be well suited to Serverless.
@mohammedramadan3480
@mohammedramadan3480 2 жыл бұрын
​@@CompleteCoding thank you so much for that and yes serverless might not be good for my use case but the thing is i expect to receive about 2million requests/day minimum ( for 100k users ) lets say 1m read and 1m write to databases if the 100k users are connected in the same time and that indeed is going to happen i'm sure that they won't do the same action that call the same lambda but i want to make sure that i don't have slow performance this is copy paste from AWS calculator i have increased it to 3 million requests / day and yes i won't need more than 128MB for memory Unit conversions Amount of memory allocated: 128 MB x 0.0009765625 GB in a MB = 0.125 GB Pricing calculations 90,000,000 requests x 1,000 ms x 0.001 ms to sec conversion factor = 90,000,000.00 total compute (seconds) 0.125 GB x 90,000,000.00 seconds = 11,250,000.00 total compute (GB-s) 11,250,000.00 GB-s x 0.0000166667 USD = 187.50 USD (monthly compute charges) 90,000,000 requests x 0.0000002 USD = 18.00 USD (monthly request charges) 187.50 USD + 18.00 USD = 205.50 USD Lambda costs - Without Free Tier (monthly): 205.50 USD
@CompleteCoding
@CompleteCoding 2 жыл бұрын
@@mohammedramadan3480 Those numbers look about right. The only real unknown at the moment is how long the Lambda will need to run to perform the task. If it runs less than 1s then it will be cheaper, if it runs longer then costing more
@swaminathbera6407
@swaminathbera6407 8 ай бұрын
​@@CompleteCodingNice perspective, What would you suggest for; say I have 2000 users that open my app and I need 6000 concurrent execution (3lambdas x 2000users), but after that I do not these many concurrent requests until all app users open the app again at same time?
@CompleteCoding
@CompleteCoding 8 ай бұрын
If you did have such highly spiky traffic then you have two choices. Always have enough capacity - this could be using lambda reserved capacity, fargate or ec2 (probably as ECS cluster). None of these scale down If you know that users open the app at a certain time (at half time in a football game) then you use fargate and program it to scale up just before the high spike in traffic. This idea of going from zero to 6000 requests is never going to be one that has a nice solution
@maxpapirovnyk4304
@maxpapirovnyk4304 Жыл бұрын
informative, but boring :) informative wins, thanks
@CompleteCoding
@CompleteCoding Жыл бұрын
But boring can be so interesting
@swaminathbera6407
@swaminathbera6407 8 ай бұрын
I didn't find it boring
AWS Lambda Global Variables - The Good the Bad & the Ugly - AWS Service Deep Dive
9:44
Complete Coding - Master AWS Serverless
Рет қаралды 6 М.
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 67 МЛН
Always be more smart #shorts
00:32
Jin and Hattie
Рет қаралды 45 МЛН
ОСКАР ИСПОРТИЛ ДЖОНИ ЖИЗНЬ 😢 @lenta_com
01:01
AWS Lambda Function Execution and Cold Start
13:17
Be A Better Dev
Рет қаралды 19 М.
AWS SQS vs SNS vs EventBridge - When to Use What?
22:37
Be A Better Dev
Рет қаралды 167 М.
Node.JS Lambda Async vs Callback - Timeout issues and callbackWaitsForEmptyEventLoop
8:10
Complete Coding - Master AWS Serverless
Рет қаралды 6 М.
AWS re:Invent 2022 - A closer look at AWS Lambda (SVS404-R)
57:56
How to achieve Concurrency Control in AWS Lambda
8:23
Yan Cui
Рет қаралды 2 М.
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,6 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,9 МЛН
Худший продукт Apple
0:53
Rozetked
Рет қаралды 212 М.