supervisord

How to execute more than one background process in laravel?

自古美人都是妖i 提交于 2019-12-04 02:40:49
First of all, I know about queues and now have good experience with queues. The problem with the queue is, it is a queue. I want to execute multiple functions or commands together in the background. Queues will keep second command or function in a queue and will execute once the first one is done executing! For example, I have a table with ~3,000,000 records and I want to process them faster. What I can do is divide them into 5 equal chunks and execute 5 commands altogether so that I can utilize my CPU as well as process data 5 times faster. So, How can I do this with Laravel? Queues are not

Valid Architecture for a Message Queue & Worker System in PHP?

余生颓废 提交于 2019-12-04 02:17:14
I'm trying to wrap my head around the message queue model and jobs that I want to implement in a PHP app: My goal is to offload messages / data that needs to be sent to multiple third party APIs, so accessing them doesnt slow down the client. So sending the data to a message queue is ideal. I considered using just Gearman to hold the MQ/Jobs, but I wanted to use a Cloud Queue service like SQS or Rackspace Cloud Queues so i wouldnt have to manage the messages. Here's a diagram of what I think I should do: Questions: My workers, would be written in PHP they all have to be polling the cloud queue

supervisord配置

…衆ロ難τιáo~ 提交于 2019-12-03 18:13:57
supervisord配置 之前配置过supervisord,时间长了还是忘记了,最近再一次配置,记录下过程,方便以后再次配置。 1 安装supervisord 由于我安装了python,所以直接安装就可以: pip install supervisor 安装后,调用命令: echo_supervisord_conf > /etc/supervisord/supervisor.conf 注意:可能echo_supervisord_conf不在你的环境变量目录下,可能要查找,通常在python环境的bin目录下,如果不在可以去这个目录查找。 在对应的目录下,可以找到该文件 在对应的目录下找到该文件,然后最下面的修改如下,具体的其他信息可以参考其他文章,把最后的include开放出来: [ include ] files= /usr/local /etc/supervisord /conf.d/ *.conf 然后新建conf.d文件夹,新建一个文件,odoo-server.conf [program:good] command= python2. 7 odoo-bin -c odoo-server-good.conf stdout_logfile= /usr/local/var/log/supervisor/odoo-gooderp.log stderr_logfile= /usr

Centos 7.X 安装 supervisord

送分小仙女□ 提交于 2019-12-03 18:13:44
supervisord 是Linux/Unix系统下的一个进程管理工具 风.foxiswho 安装 yum install supervisor 设置开机启动 systemctl enable supervisord .service 配置文件 supervisord 的配置 文件是 /etc/supervisord.conf 自定义配置文件目录是 /etc/supervisord.d ,该目录下文件已 .ini 为后缀 supervisord 命令 启动 systemctl start supervisord.service 关闭 systemctl stop supervisord.service 重启 systemctl restart supervisord .service 配置进程 例如有个nginx 进程设置 vim /etc/supervisord .d /nginx .ini 内容如下 [program:nginx] ;directory = /www/lanmps/bin ; 程序的启动目录 command = /www/lanmps/bin/nginx start ; 启动命令,可以看出与手动在命令行启动的命令是一样的 autostart = true ; 在 supervisord 启动的时候也自动启动 startsecs = 5 ; 启动 5

supervisor 的配置文件的使用

£可爱£侵袭症+ 提交于 2019-12-03 18:13:30
本文不陈述配置文件中的参数,而是关于配置文件的使用,强调2点 1. 对于supervisor 而言,配置文件在不手动指定的情况下 -c 参数 $CWD/supervisord.conf $CWD/etc/supervisord.conf /etc/supervisord.conf 所以要小心配置文件被错误使用 2. supervisorctl 与supervisord 进程进行通讯默认使用的是 tcp 连接 [inet_http_server] port = 127.0.0.1:9001 username = user password = 123 但是出于安全考虑很多人使用的是unix域套接字, [unix_http_server] file = /tmp/supervisor.sock chmod = 0777 chown= nobody:nogroup username = user password = 123 所以在使用 supervisorctl 时,如果 supervisorctl 无法查找到配置文件, supervisorctl 无法获知与 supervisord 该如何通讯,你可能会看到如下错误 root@xxx:/home/operation# supervisorctl status http://localhost:9001 refused

supervisord安装,启动/关闭,添加开机自启动服务

大憨熊 提交于 2019-12-03 18:13:16
centos7安装supervisord yum -y install supervisor 安装路径/usr/bin/supervisord,配置文件/etc/supervisor.conf 一、手动启动/关闭 supervisor手动启动: /usr/bin/supervisord -c /etc/supervisor.conf supervisor手动关闭: /usr/bin/supervisorctl stop all 先关闭supervisor启动脚本,之后再关闭supervisord服务 kill pid supervisord开机自启动脚本(各版本系统): https://github.com/Supervisor/initscripts 二、添加开机自启动服务: centos7 开机自启动脚本: vim /lib/systemd/system/supervisord.service # supervisord service for sysstemd (CentOS 7.0+) # by ET-CS (https://github.com/ET-CS) [Unit] Description=Supervisor daemon [Service] ExecStart=/usr/bin/supervisord ExecStop=/usr/bin

supervisord监控服务常用技巧

陌路散爱 提交于 2019-12-03 18:12:45
supervisord(http://supervisord.org/introduction.html)是一个非常优秀的进程管理工具,使用Python开发。它可以在类UNIX系统的方式让用户来准确地监视和控制后台一定数量的服务进程。并作为一个天使进程让后台进程在当发生内部错误退出、或者进程被意外杀死时自动重启。除此之外,supervisord可以监控TCP端口,让其他主机通过客户端了命令supervisorctl通过HTTP协议直接对Server端进程进行启停,避免让进程/服务器管理者直接接触Shell或root用户。进程之间也有一个优先级和进程组关系,让管理员使用start all和stop all的关系来启动。 1.手动启动: supervisord -c /etc/supervisor/supervisord.conf 可以通过 pstree -p | grep supervisord 命令查看服务已启动,还可以查看log日志 cat /tmp/supervisord.log 2. 用 supervisorctl 查看已经被监控的program ( 注:直接用 #supervisorctl 会提示:http://localhost:9001 refused connection ) supervisorctl -c /etc/supervisor/supervisord

supervisor 命令操作大全

拜拜、爱过 提交于 2019-12-03 18:12:32
命令操作: 启动supervisor的服务器端supervisord 【启动supervisord】 supervisord - c / etc / supervisor / supervisord . conf 或 supervisord 【停止supervisord】 supervisorctl shutdown 【重新加载配置文件】 supervisorctl reload 【进程管理】 启动supervisord管理的所有进程 supervisorctl start all 停止supervisord管理的所有进程 supervisorctl stop all 启动supervisord管理的某一个特定进程 supervisorctl start program - name // program-name为[program:xx]中的xx 停止supervisord管理的某一个特定进程 supervisorctl stop program - name // program-name为[program:xx]中的xx 重启所有进程或所有进程 supervisorctl restart all // 重启所有supervisorctl reatart program-name // 重启某一进程,program-name为[program:xx]中的xx

使用 supervisor 管理进程遇到的问题

ぐ巨炮叔叔 提交于 2019-12-03 18:12:03
# supervisorctl status unix:///var/tmp/supervisor.sock refused connection # supervisord -c /etc/supervisord.conf Error: could not find config file /etc/supervisor/supervisord.conf For help, use /usr/bin/supervisord -h # whereis supervisord.conf supervisord: /usr/bin/supervisord /etc/supervisord.conf /etc/supervisord # supervisord -c /etc/supervisord.conf Unlinking stale socket /var/tmp/supervisor.sock # unlink /tmp/supervisor.sock unlink: cannot unlink `/tmp/supervisor.sock’: No such file or directory # unlink /var/tmp/supervisor.sock # supervisorctl status unix:///var/tmp/supervisor.sock no

supervisord

核能气质少年 提交于 2019-12-03 18:11:43
supervisord easy_install install supervisor echo _supervisord_conf > /etc/supervisord.conf run supervisord vi /etc/supervisord.conf [program:ejiakao] command =/ data /panda/ejiakao.sh directory =/ data /panda user =tomcat vi /data/panda/ejiakao.sh #!/bin/sh echo run ejiakao-api /data/jdk1. 7.0 _79/bin/java -jar /data/panda/edriving-api-dev- 0.0 . 4 - 20160401.1404 .jar --spring.profiles.active=dev start ejiakao with supervisor using comman supervisorctl start ejiakao . ok, then ps aux |grep java and try kill -9 $pid , then ps aux |grep java , you see it a new pid  REF * http://supervisord.org