
Answer-first summary for fast verification
Answer: Migrate the job to an AWS Lambda function with 1 GB memory and trigger it hourly with an Amazon EventBridge rule.
The most cost-effective solution is to use AWS Lambda, as it allows you to run code without provisioning or managing servers and you only pay for the compute time you consume. Given that the job runs for 10 seconds every hour and uses 1 GB of memory, AWS Lambda can handle this easily and with minimal cost compared to running an EC2 instance continuously. Therefore, the correct answer is B, which involves migrating the job to an AWS Lambda function with 1 GB memory and triggering it hourly with an Amazon EventBridge rule.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can a company minimize costs for a Java job on an EC2 instance that executes hourly, runs for 10 seconds, and uses 1 GB memory with occasional high CPU spikes?
A
Containerize the job with AWS App2Container and deploy it on AWS Fargate using Amazon ECS, specifying 0.5 vCPU and 1 GB memory.
B
Migrate the job to an AWS Lambda function with 1 GB memory and trigger it hourly with an Amazon EventBridge rule.
C
Containerize the job using AWS App2Container, then integrate it into the existing AMI, automating container stoppage post task completion.
D
Modify the schedule to stop the EC2 instance after job execution and start it again for the next job cycle.
No comments yet.