Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run background jobs with elastic beanstalk

I am trying to start a background job in elastic beanstalk, the background job has an infinite loop so it never returns a response and so I receive this error:" Some instances have not responded to commands.Responses were not received from [i-ba5fb2f7]."

I am starting the background job in the elastic beanstalk .config file like this: 06_start_workers: command: "./workers.py &"

Is there any way to do this? I don't want elastic beanstalk to wait for a return value of that process ..

like image 689
João Abrantes Avatar asked Apr 28 '13 09:04

João Abrantes


People also ask

How do I run AWS background jobs?

You can run background tasks in build environments. To do this, in your buildspec, use the nohup command to run a command as a task in the background, even if the build process exits the shell. Use the disown command to forcibly stop a running background task.

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.

What workloads can you deploy using Elastic Beanstalk?

Elastic Beanstalk is a service for deploying and scaling web applications and services. Upload your code and Elastic Beanstalk automatically handles the deployment—from capacity provisioning, load balancing, and auto scaling to application health monitoring.

Which AWS services can be used with Elastic Beanstalk?

Elastic Beanstalk uses core AWS services such as Amazon Elastic Compute Cloud (EC2), Amazon Elastic Container Service (ECS), AWS Auto Scaling, and Elastic Load Balancing (ELB) to easily support applications that need to scale to serve millions of users.


1 Answers

fixed it, just needed to write this command instead:

command: "nohup ./workers.py > foo.out 2> foo.err < /dev/null &"

like image 51
João Abrantes Avatar answered Oct 13 '22 11:10

João Abrantes