2014-07-02 30 views
0

我想知道是否有可能有多个PHP工人与暴发户。我的问题是,一个工人已经不够我的工作了,所以我很乐意有2-3个工人。更好的办法是自动调整工人数量。运行多个工人与暴发守护进程

我使用:

# Info 
description "My PHP Worker" 
author  "Jonathan" 

# Events 
start on startup 
stop on shutdown 

# Automatically respawn 
respawn 
respawn limit 20 5 

# Run the script! 
# Note, in this example, if your PHP script returns 
# the string "ERROR", the daemon will stop itself. 
script 
    [ $(exec /usr/bin/php -f /path/to/your/script.php) = 'ERROR' ] && (stop; exit 1;) 
end script 

Run php script as daemon process THX找到@Jonathan

回答

0

基本上,与上没有起点和作为stop-myworkers停止一个实例的工作。然后开始另一项工作,在启动脚本中启动一些具有不同实例ID的工人,并在关机时发出上述停止事件。