/* Useful celery config.

app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379') app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
Queue('hipri', routing_key='tasks.#'),
),
CELERY_ROUTES={
'tasks.tasks.add': {'queue': 'hipri'},
}
) */ celery -A tasks worker --loglevel=info # run the worker celery worker --help # list command-line options available celery multi start w1 -A proj -l info # start one or more workers in the background celery multi restart w1 -A proj -l info # restart workers celery multi stop w1 -A proj -l info # stop workers aynchronously celery multi stopwait w1 -A proj -l info # stop after executing tasks are completed celery multi start w1 -A proj -l info --pidfile=/var/run/celery/%n.pid --logfile=/var/log/celery/%n%I.log # create pid and log files in the current directory celery -A proj inspect active # control and inspect workers at runtime
celery -A proj inspect active --destination=celery@w1.computer celery -A proj inspect scheduled # list scheduled ETA tasks. celery -A proj control cancel_consumer # Force all worker to cancel consuming from a queue
celery -A proj control cancel_consumer foo -d worker1.local # Force an specified worker to cancel consuming from a queue celery -A proj inspect active_queues # Get a list of queues that workers consume
celery -A proj inspect active_queues -d celery@worker1 # Get a list of queues that a worker consumes celery -A proj inspect stats # show worker statistics. celery shell -I # Drop into IPython console. celery -A tasks result -t tasks.add dbc53a54-bd97-4d72-908c-937827009736 # See the result of a task. # Control workers
i = app.control.inspect()
i = app.control.inspect(['worker1.example.com', 'worker2.example.com'])
i.registered() // Show registred tasks for specified workers
i.active() // Get a list of active tasks
i.scheduled // Get a list of tasks waiting to be scheduled
i.reserved() # Get a list of tasks that has been received, but are still waiting to be executed
i.active_queue() # get active queues
app.control.broadcast('shutdown') # shutdown all workers
app.control.broadcast('shutdown', destination=['celer@worker']) app.control.ping()
app.control.ping(['celer@worker']) # Inspecting queues in Redis
redis-cli -h HOST -p PORT -n DATABASE_NUMBER llen QUEUE_NAME
LRANGE queue_name 0 10 # Redis client

最新文章

  1. Ubuntu 16.04 安装 Apache, MySQL, PHP7
  2. defer 和 async 本地对象和宿主对象
  3. Hibernate 测试分析 好多题都是没认真看题错了。
  4. EasyUI扩展方法
  5. 2016年11月5日 星期六 --出埃及记 Exodus 19:21
  6. Java集合Map接口与Map.Entry学习
  7. bzoj1391
  8. Linux学习笔记6——映射虚拟内存
  9. 【论文阅读】Parsing Clothing in Fashion Photographs(翻译与理解)
  10. 从数据库提取数据通过jstl显示在jsp页面上
  11. Java NIO 核心组件学习笔记
  12. Qt中使用CEF(Windows下)
  13. 区分window8中 ie10 window phone8
  14. 工作笔记——使用Jest时遇到的一些问题
  15. webpack浅析---入口篇
  16. DockerDesktop简单安装和使用
  17. MAC下是用brew安装Redis
  18. Ubuntu 18.10 安装PDF阅读器
  19. Java静态初始化,实例初始化以及构造方法
  20. Minimum Window Substring leetcode java

热门文章

  1. 关于selenium中的三种等待方式与EC模块的知识
  2. P5404-[CTS2019]重复【KMP,dp】
  3. YbtOJ#493-最大分数【斜率优化dp,分治】
  4. String(char[] value, boolean share) {
  5. Linux环境yum,安装MySQL
  6. IO之字符流
  7. Docker-初见
  8. storm卡顿修改
  9. 洛谷4322 SHOI2014 三叉神经树(LCT+思维)
  10. Dapr-简介及环境搭建