‫So let's have a quick look at the
‫concurrency settings within our Lambda function.
‫And so for this under configuration,
‫we can find on the left hand side, the concurrency tab.
‫So right now we have the unreserved account concurrency
‫that we're using whenever this function run.
‫And we have an unreserved account concurrency
‫of 1000 for our entire accounts.
‫And this is shared across all the Lambda functions
‫in our account.
‫But you can edit this, and instead you're saying,
‫okay, this Lambda function probably needs some concurrency
‫of 20, and you can reserve it.
‫In which case, when you save this, then what happens
‫is that we have 20 reserve concurrency
‫for this Lambda function.
‫And your account has 980 unreserved account concurrency
‫available to all the other functions.
‫So to test concurrency, what we can do is that
‫we can reserve concurrency of zero.
‫Which means that the function is always throttled,
‫which is a good use case to test.
‫So now, if we go into our code.
‫Or just, we click on test here and just click on test
‫then, calling the invoke API action failed
‫because we have exceeded the rate.
‫So this is the kind of error message you will get
‫whenever you go over your reserve concurrency.
‫So this is why it is good to set it to zero,
‫just to be able to deal with this use case
‫maybe in your applications, okay?
‫But we can fix this by going back into the concurrency
‫and use the unreserved account currency
‫or reserve a specific currency for our function.
‫Now, if we test this function right now,
‫then the execution will work and we'll get
‫the results directly from within this window, right here.
‫Okay, great.
‫Back into our function.
‫We can also provision concurrency to
‫remove these cold starts.
‫And the cold starts wiz,
‫are whenever your application first starts
‫and it takes a bit of time to initialize.
‫In which case we want to keep a warm pool of them,
‫the function available to reduce these cold starts.
‫And this is the Provisioned Concurrency Configuration.
‫So in this case, we need to add a configuration
‫and you can set the provisioned concurrency
‫either for as alias or a version.
‫And we'll see aliases and version very, very soon.
‫So alias, we don't have any right now.
‫And versions, we cannot apply it to the latest
‫because latest is not working for provisioned concurrency,
‫we need to publish a version.
‫So we'll see how to do this in the future lectures.
‫But right now, just want to show you where the setting is.
‫And then whenever you have a provisioned concurrency
‫for example, we say,
‫hey, we want to have five as provisioned concurrency.
‫We're going to get some cost associated with it.
‫So make sure that you set a number that makes sense for you
‫and this is not free.
‫So we're not going to say this,
‫anyway, we cannot as of right now.
‫But that's it for the concurrency settings in Lambda.
‫I hope this makes sense.
‫And I will see you in the next lecture.