A web-crawling process runs on a fleet of t2.micro EC2 instances. Instances poll an SQS queue of target URLs, crawl each URL in 10 seconds or less, and write results to a shared Amazon EFS file system mounted on every instance. URLs are added to the queue infrequently, and metrics show instances sit idle when the queue is empty. You must redesign for cost optimization. Which two changes together are most cost-effective?
Choose an answer
Tap an option to check your answer.
Correct answer: Refactor the web-crawling process into an AWS Lambda function and configure the function to pull messages from the SQS queue., Modify the web-crawling process to store results in Amazon S3..
Why this is the answer
The current setup with EC2 instances polling an SQS queue and sitting idle when the queue is empty is inefficient and costly. Refactoring the web-crawling process into an AWS Lambda function is a cost-effective solution because Lambda is serverless and billed per invocation and duration, eliminating costs for idle compute time. Configuring Lambda to pull messages directly from SQS creates an event-driven architecture, automatically scaling compute resources up and down with demand. Storing results in Amazon S3 is also cost-effective because S3 is highly scalable, durable, and offers very low storage costs compared to a shared Amazon EFS file system, especially for infrequently accessed data. EFS charges for throughput and storage, which can be more expensive for large volumes of data that don't require file system semantics. Replacing t2.micro instances with m5.8xlarge instances, even with a reduced fleet size, would likely increase costs due to the significantly higher price of m5.8xlarge instances, and still incur costs for idle time. Storing results in Amazon Neptune or Amazon Aurora Serverless MySQL would introduce database costs and complexity that are likely unnecessary for simple web crawling results, which are better suited for object storage like S3.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed