diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-03-29 17:38:01 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-03-29 20:59:06 -0700 |
commit | f65783b5a107fb515b46b17998b276d0fafd4be1 (patch) | |
tree | ec59efc0669bf81e6b04076ddecff571f11631ef /test/exec | |
parent | 2886debbe557b93b9964038225e4cae58ebcedc9 (diff) | |
download | unicorn-f65783b5a107fb515b46b17998b276d0fafd4be1.tar.gz |
Instead of having global options for all listeners, make all socket options per-listener. This allows reverse-proxies to pick different listeners to get different options on different sockets. Given a cluster of machines (10.0.0.1, 10.0.0.2, 10.0.0.3) running Unicorn with the following config: ------------------ 8< ---------------- listen "/tmp/local.sock", :backlog => 1 listen "*:8080" # use the backlog=1024 default ------------------ 8< ---------------- It is possible to configure a reverse proxy to try to use "/tmp/local.sock" first and then fall back to using the TCP listener on port 8080 in a failover configuration. Thus the nginx upstream configuration on 10.0.0.1 to compliment this would be: ------------------ 8< ---------------- upstream unicorn_cluster { # reject connections ASAP if we are overloaded server unix:/tmp/local.sock; # fall back to other machines in the cluster via "backup" # listeners which have a large backlog queue. server 10.0.0.2:8080 backup; server 10.0.0.3:8080 backup; } ------------------ 8< ---------------- This removes the global "backlog" config option which was inflexible with multiple machines in a cluster and exposes the ability to change SO_SNDBUF/SO_RCVBUF via setsockopt(2) for the first time.
Diffstat (limited to 'test/exec')
-rw-r--r-- | test/exec/test_exec.rb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index caada3b..5f91dc5 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -47,7 +47,6 @@ end HEAVY_CFG = <<-EOS worker_processes 4 timeout 30 -backlog 128 logger Logger.new('#{COMMON_TMP.path}') before_fork do |server, worker_nr| server.logger.info "before_fork: worker=\#{worker_nr}" |