ngx_stream_split_clients_module

ngx_stream_split_clients_module모듈 (1.11.3)도 분할 테스트 알려진 A / B 테스팅에 적합한 변수를 생성한다.

구성 예

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

A/B 테스트를 위한 변수를 생성합니다. 예를 들면 다음과 같습니다.

split_clients "${remote_addr}AAA" $variant { 
               0.5% .one; 
               2.0% .2; 
               * ""; 
}

원래 문자열의 값은 MurmurHash2를 사용하여 해시됩니다. 주어진 예에서, 0 21,474,835 내지 (0.5 %) 대응의 값에 해시 값 ".one"의 $variant변수 해시 값 값 21,474,836 107,374,180 (2 %)에 대응에서 ".two", 해시 값 107,374,181 내지 4294967295 대응하는 값 ""( 빈 문자열).