[英]thin starts two ruby processes per server, kills wrong one
I'm starting up three thin processes with bundle exec thin start -C /etc/thin/staging.yml
我正在使用
bundle exec thin start -C /etc/thin/staging.yml
三个瘦进程
I use rvm, ruby version is ree-1.8.7 我使用rvm,ruby版本为ree-1.8.7
Contents of /etc/thin/staging.yml
: /etc/thin/staging.yml
内容:
---
timeout: 30
pid: /home/myuser/apps/g/shared/pids/thin.pid
max_persistent_conns: 512
servers: 3
chdir: /home/myuser/apps/g/current
port: 3040
require: []
log: /home/myuser/apps/g/shared/log/thin.log
daemonize: true
address: 0.0.0.0
max_conns: 1024
wait: 30
environment: staging
lsof -i :3040-3042
will show three ruby processes listening on ports 3040-3042, but the pid files contain three different (slightly lower) pids. lsof -i :3040-3042
将显示在端口3040-3042上侦听的三个ruby进程,但是pid文件包含三个不同(略低)的pid。 All six processes are called merb : merb : Master
这六个过程都称为
merb : merb : Master
When I stop thin with bundle exec thin stop -C /etc/thin/staging.yml
, thin first sends a QUIT signal to the processes in the pid files, then, after a timeout, a KILL signal. 当我使用
bundle exec thin stop -C /etc/thin/staging.yml
,thin首先向pid文件中的进程发送QUIT信号,然后在超时后发送KILL信号。
The pid files are now gone, the thin logs show that the server has stopped, but there are still three ruby processes listening on ports 3040-3042, so a subsequent thin start
will fail. pid文件现在不见了,瘦日志显示服务器已停止,但是仍然有三个ruby进程在端口3040-3042上侦听,因此后续的
thin start
将失败。
The only differences between the output of lsof -p
of both processes is a /lib/libnss_files-2.12.so library and a postgres socket. 这两个进程的
lsof -p
输出之间的唯一区别是/lib/libnss_files-2.12.so库和postgres套接字。
My questions are: 我的问题是:
thin stop
? thin stop
期间超时? Apparently the Merb bootloader does a fork. 显然,Merb引导加载程序会进行分叉。 How braindead is that!
那是多么的死脑筋!
Set Merb::Config[:fork_for_class_load] = false
in your config.ru
. 在您的
config.ru
设置Merb::Config[:fork_for_class_load] = false
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.