ngx_stream_split_clients_module 模块

The ngx_stream_split_clients_module module (1.11.3) creates variables suitable for A/B testing, also known as split testing.

Example Configuration

stream {
   ...
   split_clients "${remote_addr}AAA" $upstream {
                 0.5%                feature_test1;
                 2.0%                feature_test2;
                 *                   production;
   }

   server {
       ...
       proxy_pass $upstream;
   }
}

Directives

Syntax:

split_clients string $variable { ... }
   

Default:

—    

Context:

stream
   

Creates a variable for A/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 ".one" of the $variant variable, hash values from 21474836 to 107374180 (2%) correspond to the value ".two", and hash values from 107374181 to 4294967295 correspond to the value "" (an empty string).

说说我的看法
全部评论(
没有评论
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号