This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl_set $dice 'sub { | |
if (@pool) { | |
push @pool, shift @pool; | |
} else { | |
@pool = ("/test1", "/test2"); | |
} | |
my $r = shift; | |
my $root = $r->variable("document_root"); | |
my $uri = $r->uri; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Balancing over 4 nodes by hashing URI (consistently with md5) | |
# onto 16 shards. | |
upstream x0 { server 192.168.0.2; server 192.168.0.3 backup; } | |
upstream x1 { server 192.168.0.2; server 192.168.0.4 backup; } | |
upstream x2 { server 192.168.0.2; server 192.168.0.5 backup; } | |
upstream x3 { server 192.168.0.2; server 192.168.0.3 backup; } | |
upstream x4 { server 192.168.0.3; server 192.168.0.4 backup; } |