blob: 17637f29e23f5a0253a2d49732124e5ac6006781 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
=encoding utf-8
=head1 NAME
ngx_stream_split_clients_module - Module ngx_stream_split_clients_module
=head1
The C<ngx_stream_split_clients_module> module (1.11.3) creates
variables suitable for AE<sol>B testing, also known as split testing.
=head1 Example Configuration
stream {
...
split_clients "${remote_addr}AAA" $upstream {
0.5% feature_test1;
2.0% feature_test2;
* production;
}
server {
...
proxy_pass $upstream;
}
}
=head1 Directives
=head2 split_clients
B<syntax:> split_clients I<
I<C<string>>
I<C<$variable>> { B<...> } >
B<context:> I<stream>
Creates a variable for AE<sol>B testing, for example:
split_clients "${remote_addr}AAA" $variant {
0.5% .one;
2.0% .two;
* "";
}
The value of the original string is hashed using MurmurHash2.
In the example given, hash values from 0 to 21474835 (0.5%)
correspond to the
value C<".one"> of the C<$variant> variable,
hash values from 21474836 to 107374180 (2%) correspond to
the value C<".two">,
and hash values from 107374181 to 4294967295 correspond to
the value C<""> (an empty string).
|