AWS Certified Developer Associate · Free Practice Question Medium

Question 34

A company is running an application built on AWS Lambda functions. One Lambda function has performance issues when it has to download a 50 MB file from the internet every execution. This function is called multiple times a second.

What solution would give the BEST performance increase?

  • A

    Increase the Lambda maximum execution time

  • B

    Cache the file in Amazon S3

  • C

    Cache the file in the /tmp directory

  • D

    Put an Elastic Load Balancer in front of the Lambda function

Reveal correct answer

Correct answer: C

Explanation

The /tmp directory provides 512 MB of storage space that can be used by a function. When a file is cached by a function in the /tmp directory it is available to be used by subsequent executions of the function which will reduce latency.

CORRECT: "Cache the file in the /tmp directory" is the correct answer.

INCORRECT: "Increase the Lambda maximum execution time" is incorrect as the function is not timing out.

INCORRECT: "Put an Elastic Load Balancer in front of the Lambda function" is incorrect as this would not reduce latency or improve performance.

INCORRECT: "Cache the file in Amazon S3" is incorrect as this would not provide better performance as it would still need to be retrieved from S3 for each execution if it is not cached in the /tmp directory.

References:

https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html

Save time with our AWS cheat sheets:

https://digitalcloud.training/aws-lambda/

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need