Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elastic beanstalk deployment taking longer than timeout period, how do I increase timeout period

Tags:

Elastic beanstalk deployment of a new environment for an application using the AWS website warns

Create environment operation is complete, but with command timeouts. Try increasing the timeout period 

and although it eventually shows environment as green trying to connect to the url just gives

Service Temporarily Unavailable  The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.  

An earlier version of the application works fine, but in the ebextensions it has to copy a large file from s3 and then unzip it, this takes quite a while. The earlier version of the application only has to copy a 3GB file but the new version has to copy a 6GB file and as I can see no other errors Im guessing this has caused the timeout and prevented tomcat starting.

But how do I increase the timeout, I cannot see where I am meant to do it ?

like image 473
Paul Taylor Avatar asked Aug 28 '14 20:08

Paul Taylor


People also ask

How long is EB deploy?

You can see that for eb deploy when there are no Docker cache layers, there is about a 1 minute and 26 seconds deployment speed improvement.

Which Elastic Beanstalk deployment approaches allow you to maintain full capacity while performing an update?

To maintain full capacity during deployments, you can configure your environment to launch a new batch of instances before taking any instances out of service. This option is known as a rolling deployment with an additional batch.

When should you not use Elastic Beanstalk?

Elastic Beanstalk isn't great if you need a lot of environment variables. The simple reason is that Elastic Beanstalk has a hard limit of 4KB to store all key-value pairs. The environment had accumulated 74 environment variables — a few of them had exceedingly verbose names.


1 Answers

You can do this using option settings. Option settings can be specified using ebextensions.

Create a file in your app source in a directory called .ebextensions. Lets say the file is .ebextensions/01-increase-timeout.config.

The contents of the file should be:

option_settings:     - namespace: aws:elasticbeanstalk:command       option_name: Timeout       value: 1000 

Note this file is in YAML format. After this you can update your environment with this version of source code.

From documentation for this option setting:

Timeout: Number of seconds to wait for an instance to complete executing commands.

For example, if source code deployment tasks are still running when you reach the configured timeout period, AWS Elastic Beanstalk displays the following error: "Some instances have not responded to commands. Responses were not received from ." You can increase the amount of time that the AWS Elastic Beanstalk service waits for your source code to successfully deploy to the instance.

You can read more about ebextensions here. Documentation on option settings is available here.

like image 93
Rohit Banga Avatar answered Oct 27 '22 22:10

Rohit Banga