The Art of Graceful ReloadinguWSGI graceful Python code deploy を参考に試していて、ごく単純な例のメモ。

  • http -> zerg-server
  • http -> zerg-pool
  • http -> subscription

をそれぞれ試したい。http も uwsgi で用意する。master は確認用に含めているだけ。

http://192.168.12.34:8080/ で確認する。

http -> zerg-server

# http proto -> uwsgi proto
[uwsgi]
master          = true
http            = 192.168.12.34:8080
http-to         = uwsg-zerg-server.sock
#http-modifier1 = 5 # worker の route でやることにする

# uwsgi proto -> zerg-server
[uwsgi]
master          = true
socket          = uwsg-zerg-server.sock
zerg-server     = uwsg-zerg-server

# worker -> zerg-server
[uwsgi]
master          = true
workers         = 1
zerg            = uwsg-zerg-server
#psgi           = hello.psgi # http-modifier1 = 5 の場合
mount           = app0=hello.psgi
#mount          = app1=hello.psgi # 複数可
route           = ^/ uwsgi:,5,0,app0

http -> zerg-pool

# http proto -> uwsgi proto
[uwsgi]
master          = true
http            = 192.168.12.34:8080
http-to         = uwsg-zerg-pool.sock

# zerg-pool server
[uwsgi]
master          = true
zerg-pool       = uwsg-zerg-pool:uwsg-zerg-pool.sock

# uwsgi proto -> worker -> zerg-pool server
[uwsgi]
master          = true
workers         = 1
socket          = uwsg-zerg-pool.sock
zerg            = uwsg-zerg-pool
mount           = app0=hello.psgi
route           = ^/ uwsgi:,5,0,app0

http -> subscription

# http proto -> uwsgi proto
master          = true
http            = 192.168.12.34:8080
http-to         = 192.168.12.34:8081

# uwsgi proto -> subscription
[uwsgi]
master          = true
fastrouter      = 192.168.12.34:8081
fastrouter-subscription-server = 192.168.12.34:8082

# subscription <-> worker 
[uwsgi]
master          = true
subscribe-to    = 192.168.12.34:8082:192.168.12.34:8080
socket          = 192.168.12.34:8100
mount           = app0=hello.psgi
route           = ^/ uwsgi:,5,0,app0

コメントする

perl adv
perl adv