Lambda Provisioned Concurrency Metrics

0

I have an isolated account with a lambda function that has provisioned concurrency (PC) set to 500 and PC autoscaling on 06. The autoscale min capacity is set to 500, and the autoscale max capacity is set to 1000. On a load test, the lambda metrics show:

  • Concurrent execution ~189
  • Provisioned concurrent execution ~144
  • Invocation ~ 427,698
  • PC invocation ~300,504
  • PC spillover invocation ~127,194
  • PC utilization ~28.5% What I don't understand is why spillover when PC utilization is only at 28%? I would assume this spillover invocation will have a cold start. which I try to avoid using PC, but the PC was not 100% utilized yet. does that mean that even with PC we can not avoid cold start?
已提問 1 年前檢視次數 511 次
2 個答案
1
已接受的答案

What is your rate of invocations? Is it more than 5000/sec? If so, you are hitting the Invocations per Second limit, which is set to 10 times the number of configured provisioned concurrency. In your case 10*500=5000 invocations/sec.

profile pictureAWS
專家
Uri
已回答 1 年前
profile picture
專家
已審閱 1 年前
1

The presence of spillover invocations in your scenario indicates that your provisioned concurrency (PC) is not sufficient to handle the current load. While the PC utilization is only at 28.5%, it's important to note that this metric represents the ratio of the provisioned concurrent executions being used to the total provisioned concurrency. It doesn't necessarily reflect the actual demand or the number of concurrent invocations at any given moment.

In your case, the load test shows that you had a peak of 189 concurrent executions, but your provisioned concurrency was set to 500. This means that during the test, there were instances where the available provisioned concurrency was fully utilized, resulting in spillover invocations. These spillover invocations occur when the provisioned concurrency is exhausted, and additional requests cannot be immediately served by existing instances.

Cold starts can still happen with provisioned concurrency, but their occurrence is minimized compared to using on-demand concurrency. When a cold start occurs, it means that the lambda function needs to initialize a new execution environment to handle the incoming request. With provisioned concurrency, you can pre-warm a certain number of instances to minimize the impact of cold starts, but if the demand exceeds the provisioned concurrency, spillover invocations may experience cold starts.

To address the spillover invocations and potential cold starts, you have a few options:

Increase Provisioned Concurrency: If the load test consistently exceeds the provisioned concurrency, consider increasing the provisioned concurrency limit to better accommodate the peak demand and minimize spillover invocations.

Adjust Auto Scaling Parameters: Review your auto scaling configuration and ensure that the min and max capacity are set appropriately. If the current settings are not effectively scaling to meet the demand, you may need to fine-tune these parameters to better align with your application's requirements.

Monitor and Analyze Load Patterns: Understand the patterns and fluctuations in your application's load. Analyze the metrics over time to identify peak usage periods and adjust your provisioned concurrency and auto scaling settings accordingly.

By optimizing the provisioned concurrency and auto scaling parameters based on your application's load patterns, you can better utilize provisioned concurrency and minimize spillover invocations and potential cold starts.

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南