Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

133
Vistas
How to use Celery to do asynchronous tasks AWS EC2?

We set up an asynchronous task using Django, celery and rabbitMQ. Here our goal is to perform tasks like video transcoding, Thumbnail generation, Image compression and Image scaling altogether

We followed the below tutorial to implement it and the asynchronous task is working properly in Localhost. For the production compatibility, we used supervisord to start celery workers and to restart in case of system reboot or crash.

http://michal.karzynski.pl/blog/2014/05/18/setting-up-an-asynchronous-task-queue-for-django-using-celery-redis/

When we tried to implement same in AWS EC2, we are unable to install and configure Supervisord in AWS EC2.so we have to start celery manually every time. Can anyone please help us how to install and how to handle this procedure on AWS EC2

The code we are using

task.py
from __future__ import absolute_import
from test_celery.celery import app
import time

@app.task
def longtime_add(x, y):
print 'long time task begins'
# sleep 5 seconds
time.sleep(5)
print 'long time task finished'
return x + y

celery.py
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
import afnity.settings as settings
from django.conf import settings


os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')


app = Celery('taskapp')

app.config_from_object('django.conf:settings')

if __name__ == '__main__':
app.start() 

settings.py

BROKER_URL = 'amqp://guest:guest@localhost//'
CELERY_RESULT_BACKEND = 'redis://%s:%d/%d' % ('localhost', 6379, 0)
about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda