What's the maximum number of virtual processor cores available in AWS Lambda?

前端 未结 3 1650
花落未央
花落未央 2020-12-29 20:12

I\'m trying to find the maximum number of virtual processor cores available in AWS Lambda. The official documentation implies that it scales with the amount of configured me

相关标签:
3条回答
  • 2020-12-29 20:27

    While AWS till today didn't disclose any details regarding processing power of AWS Lambda functions, they now did after announcing an increase of the maximum memory from 1536 MB to 3008 MB. Their documentation now states:

    Functions larger than 1536MB are allocated multiple CPU threads, and multi-threaded or multi-process code is needed to take advantage of the additional performance.

    Based on that, we can conclude that all AWS Lambda functions up to 1536 MB of memory have a single virtual processor core available, while functions with more memory have two cores available.

    Update:

    While that part of the documentation isn't available anymore, Chris Munns from AWS recently at the AWS Serverless Startup Day on 2018-07-10 disclosed that all AWS Lambda functions with more than 1.8GB of memory are running on multiple cores. So apparently the boundary between single-core and multi-core for AWS Lambda functions moved from 1.5GB to 1.8GB.

    0 讨论(0)
  • 2020-12-29 20:46

    You're asking the wrong question I think (or want to use Lambda for something where it's not built for). One Lambda function has only one or two cores available, however, the power in Lambda is that you can run hundreds of them at the same time. The default limit of the amount of active Lambda functions is 100, but this is just a limit to safeguard the infrastructure (and your wallet). You can ask for more.

    So your account can have 100 Lambda functions running at the same time, which you could see as 100 cores (however it's not). If you request a limit increase, this could also be 1000 or 10,000 or 100,000.

    Analogy: instead of having 1 100-core computer, you have 100 1-core computers.

    0 讨论(0)
  • 2020-12-29 20:54

    As per AWS Lambda documentation and forum, AWS doesn't state which instance types that AWS uses for this service. In the end of 2014, AWS used compute-optimize-like instances. And now, AWS uses general-purposes-like instances.

    The CPU share dedicated to a function is based off of the fraction of its allocated memory, per each of the two cores. For example, an instance with ~ 3 GB memory available for lambda functions where each function can have up to 1 GB memory means at most you can utilize ~ 1/3 * 2 cores = 2/3 of the CPU. The details may be revisited in the future, but that is the fractional nature of our usage model.

    You can only utilize the CPU power proportional to the memory. Although, the lower and higher memory are in a same instance, they will share proportional CPU power, which is the higher memory will get more CPU power. If you read your total CPU cores is 2, it doesn't mean that you can fully utilize all of the CPU.

    Currently, there is no way to configure CPU. Only total memory that you can adjust.

    0 讨论(0)
提交回复
热议问题