celery

How do I choose a task_id using celery?

For now I get a task_id from the async_result and have to save it the get it back later. Would be better if I knew what the task_id what made of so I can calculate it back instead of pulling from the DB. E.G: set a task with task_id=("%s-%s" % (user_id, datetime)). ...

Workaround for celery task priority on RabbitMQ?

Hi, I am running Django with Celery on top of RabbitMQ as a queue to handle some data processing tasks. I am kicking off celery tasks when a user first signs up, as well as periodically to update their data. However, I'd like to of course give priority to the tasks running users who are currently online. I noticed there was a priority se...

Anyone else having trouble keeping ghettoq running inthe background with django-celery?

nohup python manage.py celeryd -f queue.log 2>queue.err 1>queue.out & Handles one request fine, then the client app posting the next job to the queues fails with this traceback. tasks.spawn_job.delay(details) File "/releases/env/lib/python2.6/site-packages/celery/task/base.py", line 321, in delay return self.apply_async(args, ...

Abort a running task in Celery within django

I would like to be able to abort a task that is running from a Celery queue (using rabbitMQ). I call the task using task_id = AsyncBoot.apply_async(args=[name], name=name, connect_timeout=3) where AsyncBoot is a defined task. I can get the task ID (assuming that is the long string that apply_async returns) and store it in a database...

Does this web app require a task queue?

Background I have a web app that will create an image from user input. The image creation could take up to a couple seconds. Problem If I let the server thread, that is handling the request/response also generate the image, that is going to tie up a thread for a couple seconds, and possibly bog down my server, affect performance, kill...

Django Celery AbortableTask usage

I'm trying to use the AbortableTask feature of Celery but the documentation example doesn't seem to be working for me. The example given is: from celery.contrib.abortable import AbortableTask def MyLongRunningTask(AbortableTask): def run(self, **kwargs): logger = self.get_logger(**kwargs) results = [] for ...

Can't get Celery run_every property to work

I'm trying to create some Celery Periodic Tasks, and a few of them need to have the ability to change the run_every time at runtime. The Celery documentation says I should be able to do this by turning the run_every attribute into a property (http://packages.python.org/celery/faq.html#can-i-change-the-interval-of-a-periodic-task-at-runt...

Is the revoke functionality needs extra api calls to stop the task in queue from execution ?

I have a worker with concurrency set to 1 and a task that goes into infinite loop [for testing]. I submit a task T1 and the worker gets it and goes to work. I submit another task, it gets it and since its busy with T1 still, T2 goes into Queue [rabbitMQ]. I tried T2.revoke() and revoke(t2.task_id) And checked with the inspect to see th...

How to store the result of a delay-call using celery in a django view?

I`ve followed the guidelines in http://celeryq.org/docs/django-celery/getting-started/first-steps-with-django.html and created a view that calls my test method in tasks.py: import time from celery.decorators import task @task() def add(x, y): time.sleep(10) return x + y But if my add-method takes a long time to respond, how c...

Using celery in a django app to run script with root priviliges?

I need to run some commands on my ubuntu box where my django project resides that requires root privileges, from within my django project. I'm using celery to fire off an asynch process, this process in turn calls shell commands that requires root privileges to succeed. How can I do this without risking creating huge security holes? P...

celery 2.x @periodic_task's not showing up in task registry

I've recently updated to celery 2.0 and I'm trying to use the new (to me) decorators for periodic tasks: @periodic_task(run_every=timedelta(days=1)) def some_task(**kwargs): #task here I also have some other code is my site that lists periodic tasks and how often they run using from celery.registry import tasks to get the list ...

AMQP implementations with Celery

I wanted to get your opinions on the merits of different AMQP implementations to be used with celery. I am looking particularly at message prioritization and job queue sizes. What are your thoughts? ...

IOError with Celeryd on large data processing

I'm doing some largish scale data processing with nltk. In doing so we iterate through 2-3000 files sitting on the server, reading through them all, making changes, and closing them out. This is all handled via Celery tasks. The only problem is that we often find ourselves encountering this: IOError: [Errno 5] Input/output error A qui...

django-celery without an ampq server (rabbitmq)

I am using celery for distributed task processing. I wanted to deploy my work on a web-host, just to show the working of my project. So how can i get djcelery to use a database (sqlalchemy) as backend with django instead of rabbitmq or other ampq servers. ...

Is Celery appropriate for use with many small, distributed systems?

I'm writing some software which will manage a few hundred small systems in “the field” over an intermittent 3G (or similar) connection. Home base will need to send jobs to the systems in the field (eg, “report on your status”, “update your software”, etc), and the systems in the field will need to send jobs back to the server (eg, “a fa...

How to enable rotation of log files for celeryd with djcelery ?

I have below settings in my celery configuration file: CELERYD_LOG_DEBUG='FALSE' CELERYD_LOG_FILE=r'/var/log/celery/celeryd.log' CELERYD_LOG_LEVEL="ERROR" I looked at the settings file of the celery and there is no option to specify the log file size limit in the configuration. Even the code looks like its using the StreamHandler in...

Celery, Django.. making a Task / thread launch sub-task / threads?

I'm using celery with django and am trying to get a Task, like the one below: class task1 (Task) def run (self): launch_some_other_task.delay() But it doesn't seem to be working, I can go into more detail as far as my code but figured I would just ask first if this sort of thing will work as doesn't seem to be working for me....

Why do I have to put the project name when importing tasks when using Django with Celery?

I just installed and configured Celery with RabbitMQ for a Django project and I was having an issue running tasks when I imported them like so: from someapp.tasks import SomeTask It worked when I added the project name: from myproject.someapp.tasks import SomeTask I tried adding this into the settings.py file but it doesn't change ...

Developing with Django+Celery without running `celeryd`?

In development, it's a bit of a hassle to run the celeryd as well as the Django development server. Is it possible to, for example, ask celery to run tasks synchronously during development? Or something similar? ...

Django Celery Database for Models on Producer and Worker

I want to develop an application which uses Django as Fronted and Celery to do background stuff. Now, sometimes Celery workers on different machines need database access to my django frontend machine (two different servers). They need to know some realtime stuff and to run the django-app with python manage.py celeryd they need acc...