ngx_http_split_clients_module 모듈
ngx_http_split_clients_module 모듈은 A/B 테스트(분할 테스트라고도 함)에 적합한 변수를 만들어요.
출처: 문서
본문
예시 구성 (Example Configuration)
http {
split_clients "${remote_addr}AAA" $variant {
0.5% .one;
2.0% .two;
* "";
}
server {
location / {
index index${variant}.html;
지시어 (Directives)
| Syntax: | split_clients string $variable { ... } |
|---|---|
| Default: | — |
| Context: | http |
A/B 테스트용 변수를 만들어요. 예를 들어:
split_clients "${remote_addr}AAA" $variant {
0.5% .one;
2.0% .two;
* "";
}
원본 문자열의 값은 MurmurHash2로 해시돼요. 위 예시에서 해시 값 0부터 21474835 (0.5%)까지는 $variant 변수의 값 .one에 대응하고, 해시 값 21474836부터 107374180 (2%)까지는 값 .two에 대응하며, 해시 값 107374181부터 4294967295까지는 값 ""(빈 문자열)에 대응해요.