Question

Difficulty: HardAWS Elastic Beanstalk

A development team is deploying a worker application to an AWS Elastic Beanstalk Worker Tier environment. The application processes high-compute tasks received from an Amazon SQS queue, with each task taking approximately 4545 minutes (27002700 seconds) to complete. During testing, the team notices that tasks are frequently reprocessed by different worker instances before the original instance completes them, and the worker daemon logs indicate timeout failures before the application returns an HTTP status code. Which two configuration steps must the developer perform to resolve these issues and support this long-running processing requirement?

  1. Create a configuration file inside the `.ebextensions` directory with a `.config` extension, and set the `InactivityTimeout` parameter to 30003000 in the `aws:elasticbeanstalk:sqsd` namespace.Answer
  2. Create a configuration file inside the `.ebextensions` directory with a `.config` extension, and set the `VisibilityTimeout` parameter to 30003000 in the `aws:elasticbeanstalk:sqsd` namespace.Answer
  3. C
    Create a configuration file inside a folder named `ebextensions` (without a leading dot) at the root of the source bundle, and set the `InactivityTimeout` parameter to 30003000 in the `aws:elasticbeanstalk:sqsd` namespace.
  4. D
    Set the `VisibilityTimeout` of the SQS queue to 120120 seconds in the Amazon SQS console to ensure that failed processing attempts are quickly retried by other workers.
  5. E
    Configure the environment's deployment policy to Rolling to automatically adjust the Amazon SQS queue's connection pool and visibility timeout during periods of high resource utilization.

Answer

Create a configuration file inside the `.ebextensions` directory with a `.config` extension, and set the `InactivityTimeout` parameter to 30003000 in the `aws:elasticbeanstalk:sqsd` namespace; and create a configuration file inside the `.ebextensions` directory with a `.config` extension, and set the `VisibilityTimeout` parameter to 30003000 in the `aws:elasticbeanstalk:sqsd` namespace.
In an Elastic Beanstalk worker tier environment, the local daemon (`sqsd`) retrieves messages from an SQS queue and posts them to the application. If processing takes 4545 minutes (27002700 seconds), the daemon must wait longer than the default 300300 seconds for the HTTP response. Increasing `InactivityTimeout` in the `aws:elasticbeanstalk:sqsd` namespace to 30003000 seconds prevents premature HTTP timeouts. Concurrently, increasing the `VisibilityTimeout` in the same namespace to 30003000 seconds keeps the message hidden from other instances while the worker processes it, preventing duplicate processing.

Step-by-Step Solution

1
Analyze the worker tier daemon mechanics
Identify that the Elastic Beanstalk worker daemon (`sqsd`) pulls messages from SQS and forwards them via HTTP POST to the local application. The default HTTP connection inactivity timeout is 300300 seconds.
Since tasks take 4545 minutes (27002700 seconds), the daemon's connection will time out unless `InactivityTimeout` is increased.
2
Analyze message visibility constraints
Identify that the SQS visibility timeout must exceed the task processing time (27002700 seconds) to prevent duplicate processing by other worker instances.
Setting the `VisibilityTimeout` option in the daemon configuration to 30003000 seconds prevents the message from returning to the queue during processing.
3
Verify configuration file structure and namespace rules
Confirm that Elastic Beanstalk looks for configurations in the `.ebextensions/` directory at the root of the source bundle. The configuration must target the `aws:elasticbeanstalk:sqsd` namespace.
Any deviation in folder naming (e.g. omitting the leading dot) or using incorrect namespaces will result in the parameters being ignored.

Key Concept

AWS Elastic Beanstalk Worker Tier Daemon Configuration
Rate this question