- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
Supervisord 无法让 redis worker 继续运行,我的 worker 仍然以状态代码 12 退出并重生。我的 redis 容器在应用程序的 docker 网络上(主管所在的位置)
我遵循 laravel 的文档:https://laravel.com/docs/5.8/queues#supervisor-configuration
我试图守护命令和一些代码更新我也将我的 Debian 更新为 Stretch 和 Docker我在本地测试了所有这些,一切正常......
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work redis --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=8
priority=10
redirect_stderr=true
stdout_logfile=/var/log/worker.log
api:
image: gitlab.ladechetterieduweb.com:5555/lddw/backend:latest
container_name: backend-lddw-develop
restart: always
working_dir: /var/www
volumes:
- ./config/api:/var/env
- ./app/storage:/var/www/storage
- ./logs/laravel:/var/www/storage/logs
- ./logs/supervisord:/var/log
depends_on:
- db
command: /bin/bash -c "cp /var/env/.env /var/www/.env && supervisord -c /etc/supervisord.conf --nodaemon"
networks:
- app-network
redis:
image: redis:5.0.3-stretch
restart: always
ports:
- 6379:6379
container_name: redis-lddw-develop
volumes:
- redis_data:/data
- ./config/redis:/usr/local/etc/redis
command: /bin/bash -c "cp /usr/local/etc/redis/rc.local /etc/rc.local && redis-server --appendonly yes"
networks:
- app-network
2019-06-25 21:50:15,199 CRIT Set uid to user 0
2019-06-25 21:50:15,199 WARN No file matches via include "/etc/supervisor/conf.d/*.conf"
2019-06-25 21:50:15,295 INFO RPC interface 'supervisor' initialized
2019-06-25 21:50:15,295 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2019-06-25 21:50:15,457 INFO RPC interface 'supervisor' initialized
2019-06-25 21:50:15,457 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-06-25 21:50:15,457 INFO supervisord started with pid 1
2019-06-25 21:50:16,460 INFO spawned: 'php-fpm' with pid 10
2019-06-25 21:50:16,461 INFO spawned: 'laravel-worker_00' with pid 11
2019-06-25 21:50:16,463 INFO spawned: 'laravel-worker_01' with pid 12
2019-06-25 21:50:16,464 INFO spawned: 'laravel-worker_02' with pid 13
2019-06-25 21:50:16,467 INFO spawned: 'laravel-worker_03' with pid 14
2019-06-25 21:50:16,469 INFO spawned: 'laravel-worker_04' with pid 15
2019-06-25 21:50:16,472 INFO spawned: 'laravel-worker_05' with pid 16
2019-06-25 21:50:16,474 INFO spawned: 'laravel-worker_06' with pid 17
2019-06-25 21:50:16,476 INFO spawned: 'laravel-worker_07' with pid 18
2019-06-25 21:50:17,667 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,667 INFO success: laravel-worker_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,667 INFO success: laravel-worker_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,667 INFO success: laravel-worker_02 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,667 INFO success: laravel-worker_03 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,668 INFO success: laravel-worker_04 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,668 INFO success: laravel-worker_05 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,668 INFO success: laravel-worker_06 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:17,668 INFO success: laravel-worker_07 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_00 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_02 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_03 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_05 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_06 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_07 (exit status 12; not expected)
最佳答案
您的工作人员正在退出,状态为 12:
2019-06-25 21:50:26,205 INFO exited: laravel-worker_00 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_02 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_03 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_05 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_06 (exit status 12; not expected)
2019-06-25 21:50:26,205 INFO exited: laravel-worker_07 (exit status 12; not expected)
当您的工作人员消耗过多内存时会触发此退出代码,请参阅: https://github.com/laravel/framework/blob/5.8/src/Illuminate/Queue/Worker.php#L204
$this->memoryExceeded($options->memory) 返回 true 并退出。
您有 2 个选择,减少 worker 的内存占用或增加允许的内存。由于默认值非常低 (128MB),您可以尝试添加一些内存。
要更改允许给您的工作人员的内存,您必须编辑您的主管配置:
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work redis --sleep=3 --tries=3 --memory=1024
autostart=true
autorestart=true
user=www-data
numprocs=8
priority=10
redirect_stderr=true
stdout_logfile=/var/log/worker.log
请参阅我在命令部分添加到您的 conf 的 --memory
问候
关于laravel - docker : Worker keep exiting and respawn and 99% CPU,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56762759/
我正在使用 BusyBox,但我认为我的问题很笼统。这是我的 inittab 文件中其中一条 tty 行的示例。 tty1::respawn:/sbin/getty -n -l /usr/bin/lo
我正在使用 Respawn清理我的测试数据库,但是当这个方法执行时: public static Task ResetCheckpoint() => Checkpoint.Reset(Configur
我是一名文凭学生,正在制作一个基于处理的游戏,这是一款塔防游戏,女主角将向冲向城堡的僵尸射箭。我对此有多个问题。 充电器僵尸被击杀后不会重生。 当我只射杀一只充电器僵尸时,所有充电器僵尸都一起死了。
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: what does this mean in c int a:16; ? 这里的:1是什么意思: ... u
我正在使用 upstart 来启动/停止/自动重启守护进程。其中一个守护进程 fork 4 次。 upstart cookbook声明它只支持两次 fork 。有解决方法吗? 它是如何失败的 如果我尝
场景: 我有一个在 linux 上运行的进程,该进程在后台通过连接在 /etc/init.d/ 的脚本启动,称为 MyApp 这只是一个没有的 shell 脚本.sh。以下是我的init.d脚本脚本
Supervisord 无法让 redis worker 继续运行,我的 worker 仍然以状态代码 12 退出并重生。我的 redis 容器在应用程序的 docker 网络上(主管所在的位置) 我
我的主 php 服务器出现问题,其中主 php5-fpm进程将被 HUP 杀死信号。在主进程被杀死后,它将无法重生。由于每个子进程只允许处理一定数量的请求,因此它们最终会死掉而不会产生任何其他子进程。
我是一名优秀的程序员,十分优秀!