A developer has written an AWS Lambda function. The function is CPU-bound. The developer wants to ensure that the function returns responses quickly. How can the developer improve the function's performance?
Option B is correct, the only adjustable parameter (in terms of hardware) is lambda memory. Increasing lambda memory will result in automatic adjustment of CPU.
Lambda memory is adjustable from 128 MB upto 10 GB
A) Eliminated - We cannot directly control the CPU core count.
B) Correct - increasing memory not only gives more memory but also allocates more CPU power to the function.
C) Eliminated - Reserved concurrency controls how many instances of the function can run at the same time, but it doesn’t improve the performance of a single function execution
D) Eliminated - Increasing the timeout allows the function to run longer, but it doesn’t improve the speed of the function
==> discard A: can't directly increase lambda CPU
==> discard C: concurrecny for handling many tasks at same time capacibility, not increase speed response when CPU-bound
=> discard D: be not relevant, increase maximum time to wait function to finish
B: with lambda, you can increase memory, implicity CPU usage for lambda also up too
Quote 'If a function is CPU-, network- or memory-bound, then changing the memory setting can dramatically improve its performance.' at https://docs.aws.amazon.com/lambda/latest/operatorguide/computing-power.html
Lambda allocates CPU power in proportion to the amount of memory configured. You can read more here:
https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console
Increasing the function's CPU core count is not an option in AWS Lambda. AWS Lambda automatically manages the allocation of CPU power and only allows scaling of memory.
. Increase the function's memory.
The performance of an AWS Lambda function is primarily determined by the amount of allocated memory. When you increase the memory, you also increase the available CPU and network resources. This can result in faster execution times, especially for CPU-bound functions. Increasing the CPU core count, reserved concurrency, or timeout may not have as significant an impact on performance as increasing memory.
Adding more memory proportionally increases the amount of CPU, increasing the overall computational power available. If a function is CPU-, network- or memory-bound, then changing the memory setting can dramatically improve its performance.
https://docs.aws.amazon.com/lambda/latest/operatorguide/computing-power.html
On this particular question the answer is A.
while increasing memory can indirectly improve CPU performance, it's not always the most effective solution for CPU-bound functions, and increasing the CPU core count is usually a better option for improving performance in such cases. Please note - CPU-Bound functions. This question is to trick you
In this particular question it is B. You are right that in normal question it might be A but for a Lambda function you are not able to change the CPU. Lambda allocates CPU power in proportion to the amount of memory configured. You can read more here:
https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ihta_2031
Highly Voted 2 years agoKashan6109
Highly Voted 1 year, 9 months agosumanshu
Most Recent 4 months, 1 week agotrieudo
4 months, 2 weeks agorue_
6 months agotgood
8 months, 3 weeks ago65703c1
11 months, 1 week agoleonardoliveros
1 year, 5 months agojames2033
1 year, 5 months agoMajong
1 year, 11 months agoDevon_Fazekas
1 year, 11 months agogeekdamsel
1 year, 11 months agoBibay
1 year, 11 months agoblathul
2 years agoSyre
2 years agoMajong
1 year, 11 months agoUntamables
2 years, 1 month ago