Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

301
Visualizações
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)
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda