flower

“Unknown task” error in Celery Flower when posting a new task

百般思念 提交于 2019-12-11 01:38:05
问题 I'm running celery 3.1.11 and flower 0.6.0 . I have a celery application configured as such; # myapp.tasks.celery.py from __future__ import absolute_import from celery import Celery class Config(object): BROKER_URL = 'amqp://' CELERY_RESULT_BACKEND = 'amqp' CELERY_TASK_RESULT_EXPIRES = None CELERY_RESULT_SERIALIZER = 'json' CELERY_INCLUDE = [ 'myapp.tasks.source', 'myapp.tasks.page', 'myapp.tasks.diffusion', 'myapp.tasks.place', ] ) celery = Celery('myapp') celery.config_from_object(Config)

Celery time statistics per-task-name

做~自己de王妃 提交于 2019-12-10 16:49:08
问题 I have some fairly busy celery queues, but not sure which tasks are the problematic ones. Is there a way to aggregate results to figure out which tasks are taking a long time? I have 10-20 workers on 2-4 servers. Using redis as the broker and as the result backend as well. I noticed the busy queues on Flower, but can't figure out how to get time statistic aggregated per task. 回答1: Method 1: If you have enabled logging when celery workers are started, they log time taken for each task. $

Access named volume from container when not running as root?

蹲街弑〆低调 提交于 2019-12-06 08:20:32
问题 I'm running Celery under Docker Compose. I'd like to make Celery's Flower persistent. So I do: version: '2' volumes: [...] flower_data: {} [...] flower: image: [base code image] ports: - "5555:5555" volumes: - flower_data:/flower command: celery -A proj flower --port=5555 --persistent=True --db=/flower/flower However, then I get: IOError: [Errno 13] Permission denied: 'flower.dat' I ran the following to elucidate why: bash -c "ls -al /flower; whoami; celery -A proj flower --persistent=True -

Celery task history

十年热恋 提交于 2019-12-05 10:39:59
I am building a framework for executing tasks on top of Celery framework. I would like to see the list of recently executed tasks (for the recent 2-7 days). Looking on the API I can find app.backend object, but cannot figure out how to make a query to fetch tasks. For example I can use backends like Redis or database. I do not want to explicitly write SQL queries to database. Is there a way to work with task history/results with API? I tried to use Flower, but it can only handle events and cannot get history before its start. You need to keep the task results in a backend, for example Redis.

Access named volume from container when not running as root?

戏子无情 提交于 2019-12-04 13:47:17
I'm running Celery under Docker Compose. I'd like to make Celery's Flower persistent. So I do: version: '2' volumes: [...] flower_data: {} [...] flower: image: [base code image] ports: - "5555:5555" volumes: - flower_data:/flower command: celery -A proj flower --port=5555 --persistent=True --db=/flower/flower However, then I get: IOError: [Errno 13] Permission denied: 'flower.dat' I ran the following to elucidate why: bash -c "ls -al /flower; whoami; celery -A proj flower --persistent=True --db=/flower/flower" This made it clear why: flower_1 | drwxr-xr-x 3 root root 4096 Mar 10 23:05 . flower

Celery works, but with flower doesn't work

試著忘記壹切 提交于 2019-12-04 07:14:19
I have installed celery and RabitMQ and flower. I am able to browse to the flower port. I have the following simple worker that I can attach to celery and call from a python program: # -*- coding: utf-8 -*- """ Created on Sat Dec 12 16:37:33 2015 @author: idf """ from celery import Celery app = Celery('tasks', broker='amqp://guest@localhost//') @app.task def add(x, y): return x + y This program calls it # -*- coding: utf-8 -*- """ Created on Sat Dec 12 16:40:16 2015 @author: idf """ from tasks import add add.delay(36, 5) I start celery like this: idf@DellInsp:~/Documents/Projects/python3$

How do I add authentication and endpoint to Django Celery Flower Monitoring?

白昼怎懂夜的黑 提交于 2019-12-03 10:38:23
I've been using flower locally and it seems easy enough to setup and run, but I can't see how I would set it up in a production environment. In particular, how can I add authentication and how would I define a url to access it? For custom address, use the --address flag. For auth, use the --basic_auth flag. See below: # celery flower --help Usage: /usr/local/bin/celery [OPTIONS] Options: --address run on the given address --auth regexp of emails to grant access --basic_auth colon separated user-password to enable basic auth --broker_api inspect broker e.g. http://guest:guest@localhost:15672

How to get the failed tasks in Celery?

青春壹個敷衍的年華 提交于 2019-12-01 10:12:39
I am using celery to process some tasks. I can see how many are active or scheduled etc, but I am not able to find any way to see the tasks that have failed. Flower does show me the status but only if it was running when the task was started and failed. Is there any command to get all the tasks that have failed (STATUS: FAILURE) ? I do have the task id when the task was created. But there are millions of them. So I can't check one by one even if there is a way to check it by task ID. But if there is such a command, please let me know. RichVel Celery doesn't make it easy to find a failed task

How to get the failed tasks in Celery?

情到浓时终转凉″ 提交于 2019-12-01 09:07:22
问题 I am using celery to process some tasks. I can see how many are active or scheduled etc, but I am not able to find any way to see the tasks that have failed. Flower does show me the status but only if it was running when the task was started and failed. Is there any command to get all the tasks that have failed (STATUS: FAILURE) ? I do have the task id when the task was created. But there are millions of them. So I can't check one by one even if there is a way to check it by task ID. But if

并行处理框架Celery的Web监控管理服务-Flower

三世轮回 提交于 2019-12-01 05:08:32
Flower: Real-time Celery web-monitor Flower是Celery的一个实时监控和管理Web界面工具,目前仍在活跃的开发之中,但已经是一个很重要的可用工具了。这是推荐使用的Celery监控工具,原来的基于Django-Admin monitor、celerymon、ncurses的监控管理已经过时。 Flower在快速的开发和变化之中, 你也可以得到相对稳定的版本。 Features 使用Celery Events进行实时监视 Task进度和历史。 显示task详细信息 (参数,启动时间,运行时间,其它...) 统计数据和图形表示。 远程控制 查看worker状态和统计信息。 关闭和重启worker实例。 控制worker池的大小和自动伸缩的设置。 查看和修改worker实例消费的队列。 查看当前运行的任务。 查看 tasks的调度 (ETA/countdown)。 查看保留和重新唤醒的tasks。 应用实践和频度限制。 配置的查看。 唤醒和终止tasks。 HTTP的 API接口。 OpenID鉴权方法。 运行的截屏: More screenshots : 安装和使用 使用pip安装Flower: $ pip install flower #如果没有pip,使用sudo apt-get install python-pip进行安装。 运行