exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 51 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 51
Topic #: 1
[All AWS Certified Developer Associate Questions]

A Developer is working on a serverless project based in Java. Initial testing shows a cold start takes about 8 seconds on average for AWS Lambda functions.
What should the Developer do to reduce the cold start time? (Choose two.)

  • A. Add the Spring Framework to the project and enable dependency injection.
  • B. Reduce the deployment package by including only needed modules from the AWS SDK for Java.
  • C. Increase the memory allocation setting for the Lambda function.
  • D. Increase the timeout setting for the Lambda function.
  • E. Change the Lambda invocation mode from synchronous to asynchronous.
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ipindado2020
Highly Voted 3 years, 6 months ago
Difficult question as it is planned... A: This does not reduce start up time (in fact it can aggravate the problem) B: This is true only if the question assumes that the Java code is using AWS SDK (not remarked). C. This is true as increasing the memory will increase the assigned CPU and will reduce the start up time D. This can mitigate the problem but it doesn´t reduce the start up time as requested. E. This can mitigate the problem but it doesn´t reduce the start up as requested. So for me I go for B & C
upvoted 38 times
captainpike
2 years, 1 month ago
IMO your justification for E in incorrect. It will solve the cold start problem. Check https://github.com/awslabs/aws-serverless-java-container/wiki/Quick-start---Spring-Boot#asynchronous-initialization. Answer is BE in my opinion
upvoted 1 times
borisgor
2 years ago
hi, the link you provided says : 1- return control back to AWS Lambda just before the 10 seconds timeout expires. 2- By default, Serverless Java Container will wait for an additional 10 seconds. Taking advantage of asynchronous-init depends on treshold 10 sec but question says 8 sec , before timeout. Although E option sounds making much more sense than B , just confused with 8 sec vs 10 sec
upvoted 1 times
...
...
...
NoCrapEva
Highly Voted 3 years, 6 months ago
B & C Ref: https://hackernoon.com/im-afraid-you-re-thinking-about-aws-lambda-cold-starts-all-wrong-7d907f278a4f "...Alternatively, you could consider reducing the impact of cold starts by reducing the length of cold starts: by authoring your Lambda functions in a language that doesn’t incur a high cold start time — i.e. Node.js, Python, or Go. Choose a higher memory setting for functions on the critical path of handling user requests (i.e. anything that the user would have to wait for a response from, including intermediate APIs) Optimizing your function’s dependencies, and package size..."
upvoted 16 times
...
sumanshu
Most Recent 4 months, 1 week ago
Selected Answer: BC
B) Correct - Larger deployment packages can increase the cold start time because Lambda must load and initialize all the code and dependencies.Reducing the size of the deployment package can significantly reduce initialization time. In particular, only include the parts of the AWS SDK for Java that are required for the Lambda function, instead of including the entire SDK. C) Correct - AWS Lambda allocates CPU power based on the memory allocation you set for your function. Increasing the memory allocation provides more CPU power, which can improve the cold start time.
upvoted 1 times
sumanshu
4 months, 1 week ago
A) Eliminated - The Spring Framework is typically heavyweight and adds a lot of overhead,
upvoted 1 times
sumanshu
4 months, 1 week ago
D) Eliminated - The timeout setting specifies how long Lambda will wait for the function to execute before terminating it.
upvoted 1 times
...
...
...
Baalhammun
1 year, 2 months ago
Selected Answer: BC
By procceeding with elimination, A- increases cold start time as SpringFramework is a big dependency and it is not mentioned the java app is using spring! D- Lambda timeout doesnt decrease cold start time E- Invocation mode doesnt decrease cold start time so by eliminating these two we have B- true if java is already using aws sdk C- true because increasing RAM with AWS is proportionate with CPU => more CPU less cold start time
upvoted 1 times
...
SD_CS
1 year, 2 months ago
Selected Answer: BC
A - Spring framework dependency injection has nothing to do with start up time. B- This could help by easing the start up process C- Provisioning more memory might help with the start-up D- Nothing to do with cold start E- I don't think this can mitigate a cold start problem
upvoted 1 times
...
Teemo2023
1 year, 4 months ago
E is wrong. Invocation mode depends upon the trigger: https://docs.aws.amazon.com/lambda/latest/operatorguide/invocation-modes.html
upvoted 1 times
...
sara_exam_topics
1 year, 6 months ago
Selected Answer: BC
B. Reduce the deployment package size by including only the needed modules from the AWS SDK for Java. Cold starts can be slow when a large deployment package is involved because it takes time to load and initialize all the resources. By reducing the package size, you can decrease the initialization time. C. Increase the memory allocation setting for the Lambda function: Increasing the memory allocated to a Lambda function also increases its CPU power and network bandwidth. Lambda functions with more memory tend to initialize faster because they have more resources available for execution. A side effect of this is that it can improve cold start times.
upvoted 3 times
...
rcaliandro
1 year, 10 months ago
Selected Answer: BC
By exclusion I would say B and C. If we use the SDK, we do have only include the liraries that we really need. Furthemore, if we increase the memory to the lambda function, also the CPU will be increased and we can observe a significant increase of the performance
upvoted 1 times
...
captainpike
2 years, 1 month ago
The answer is BE Justification for E: https://github.com/awslabs/aws-serverless-java-container/wiki/Quick-start---Spring-Boot#asynchronous-initialization. Answer is BE in my opinion
upvoted 1 times
...
pancman
2 years, 1 month ago
Saw this question in the exam today (Feb 2023)
upvoted 2 times
suru003
1 year, 12 months ago
what did you answer?
upvoted 1 times
...
...
gpit
2 years, 5 months ago
Selected Answer: AB
Spring has onApplicationEvent method which maybe used to warmup the environment. But the real solution should be Provisioned Concurrency. See "Reducing cold starts with Provisioned Concurrency" from https://aws.amazon.com/blogs/compute/operating-lambda-performance-optimization-part-1/
upvoted 2 times
...
juaneks
2 years, 9 months ago
B and C
upvoted 1 times
...
idqc
3 years, 1 month ago
Selected Answer: BC
BC are the correct answers
upvoted 2 times
...
Nitin_Ramnani
3 years, 2 months ago
Selected Answer: BC
B & C A: This does not reduce start up time (in fact it can aggravate the problem) B: This is true only if the question assumes that the Java code is using AWS SDK (not remarked). C. This is true as increasing the memory will increase the assigned CPU and will reduce the start up time D. This can mitigate the problem but it doesn´t reduce the start up time as requested. E. This can mitigate the problem but it doesn´t reduce the start up as requested. So for me I go for B & C
upvoted 3 times
captainpike
2 years, 1 month ago
IMO your justification for E in incorrect. It will solve the cold start problem. Check https://github.com/awslabs/aws-serverless-java-container/wiki/Quick-start---Spring-Boot#asynchronous-initialization. Answer is BE in my opinion
upvoted 1 times
...
...
JP_PA
3 years, 2 months ago
Selected Answer: BC
ANS: B&C
upvoted 2 times
...
ranga_reddy
3 years, 3 months ago
Selected Answer: A
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-before-you-start.html
upvoted 1 times
dark_cherrymon
2 years, 5 months ago
that's dynamo db not lambda
upvoted 1 times
...
...
ranga_reddy
3 years, 3 months ago
Selected Answer: BC
It's B and C
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago