AWS Elastic Beanstalk Worker environment deep dive

What is Elastic Beanstalk Worker?

Elastic Beanstalk Worker is a managed compute environment for long running tasks. By using worker, we can decouple web application front-end from a process that performs blocking operations so that your application stays responsive under load. When we provision a worker environment, we will get SQS queue along with the compute worker environment .You can only access the worker through the SQS Queue.

What are the use cases of Elastic Beanstalk Worker?

A long-running task that significantly increases the time to complete a request including,

Important things to know

Worker environments are not accessible from outside world. You do not have an endpoint or URL to access this environment. The only way to access, this environment is through associated Simple Queue Serves (SQS) which I explained in detail in the below section.

Elastic Beanstalk Worker Workflow

Worker Internal workflow
Worker Config

SQS Daemon (SQSD)

SQS Daemon is an inbuilt process that runs on a worker instance, which listens for messages in Amazon SQS queue. Once a message placed into the queue, SQSD (SQS Daemon) pulls the message and invoke an http POST method to http://localhost/ on port 80. The body of request contains message from the queue. If application returns a 200 message back, the SQSD will delete message from the queue otherwise it will be retrying from the queue.

Elastic beanstalk Tomcat8 Instance workflow

Tomcat8 worker instance internal working



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store