如何将CELERY放到后台执行?
就是要注意supervisord.conf的目录存放位置。
放在DJANGO的PROJ目录下,是最佳位置。
https://thomassileo.name/blog/2012/08/20/how-to-keep-celery-running-with-supervisor/
如何你不幸的和我一样,无法PIP只能用setup.py的话,可能celery和supervisord都要用绝对目录
[program:celeryd] command=/usr/local/python27/bin/celery worker --app=ism -c 4 -l info stdout_logfile=/var/log/celeryd.log stderr_logfile=/var/log/celeryd.log autostart=true autorestart=true startsecs=10 stopwaitsecs=600
~~~~~~~~~~~~~~~~
How to keep Celery running with supervisorMon 20 August 2012 by Thomas Sileo
Supervisor is a Python program that allows you to control and keep running any unix processes. It can also restart crashed processes. I use it to make sure Celery workers are always running.
Im using virtualenv, Celery 3.0.5, and supervisor 3.0. Im assuming Celery is already installed and configured.
InstallationFirst, you need to install supervisor in your virtualenv and generate a configuration file.
I store a supervisord.conf config file at the root of each project, and also, be careful to use theabsolute path to the Python interpreter of the virtualenv.
$ pip install supervisor $ cd /path/to/your/project $ echo_supervisord_conf supervisord.conf
Next, just add this section after the [supervisord] section:
[program:celeryd] command=/home/thomas/virtualenvs/yourvenv/bin/celery worker --app=myapp -l info stdout_logfile=/path/to/your/logs/celeryd.log stderr_logfile=/path/to/your/logs/celeryd.log autostart=true autorestart=true startsecs=10 stopwaitsecs=600
Its a simplified version of the Celery supervisor example configuration file, adapted to work with virtualenvs.
UsageJust run supervisord in your project directory.
$ supervisord
Then, you can use the supervisorctl command to enter the interactive shell. Type help to get started. You can also execute supervisor command directly:
$ supervisorctl tail celeryd $ supervisorctl restart celerydAnd you ?
If you have any tips or suggestions, dont hesitate !
~~~~~~~~~~~~~~~
python-windows命令行启动appium及杀掉对应接口进程 文章目录 windows命令行启动appium及杀掉对应接口进程 一.环境配置 1.安装命令行版appium 2.安装appium-doctor检测 3.python安装Appium-Python-Client: 4.定位uiautomatorviewer.bat 5.查看主包名主类名Activity 二.python-appium启动app 1.appium启动一加计算器相关参数: 2.windows查看端口 三.windows杀掉对应进程
Django配置celery(非djcelery)执行异步任务和定时任务 所有演示均基于Django2.0 celery是一个基于python开发的简单、灵活且可靠的分布式任务队列框架,支持使用任务队列的方式在分布式的机器/进程/线程上执行任务调度。采用典型的生产者-消费者模型,主要由三部分组成: 消息队列broker:broker实际上就是一个MQ队列服务,可以使...
ansible默认只会创建5个进程,所以一次任务只能同时控制5台机器执行.那如果你有大量的机器需要控制,或者你希望减少进程数,那你可以采取异步执行.ansible的模块可以把task放进后台,然后轮询它.
相关文章
- 精品微信小程序ssm的国产动漫论坛网站+后台前后分离VUEjs
- 投票系统+后台管理系统|前后分离VUE
- 精品微信小程序ssm户外体能训练教学平台+后台管理系统|前后分离VUE
- 总结:基于flask+vue搭建的电商后台管理系统——大学毕业设计出售
- 140.(前端)数据统计获取后台数据显示——使用echarts让数据用图表方式展示
- 修改WordPress后台登录地址,提高安全性
- 前台传递给后台的JSON字符串中的引号 “” 在JAVA后台被转义为 "
- php中怎么实现后台执行?
- Linux的后台执行进程之nohup
- 【笔记】Vue Element+Node.js开发企业通用管理后台系统——电子书上传功能开发
- 【笔记】Vue Element+Node.js开发企业通用管理后台系统——用户登录(中)
- redis修改后台启动
- .NET Selenium WebDriver操作调用浏览器后台执行Js(JavaScript)代码
- ASP.NET Core 后台方法中解析视图(View)获取生成的html字符串
- 【Python+selenium】浏览器后台运行 隐藏窗口执行
- Linux前台的程序转到后台执行(关闭终端而不杀死命令)
- 带你用vue撸后台 系列
- Linux后台监控命令