optimize consistent_hash with map

This commit is contained in:
liyingxin
2022-02-18 22:45:57 +08:00
parent cf4f26fa3f
commit 37a1009677
3 changed files with 87 additions and 36 deletions

View File

@@ -73,7 +73,7 @@ void register_upstream_hosts()
},
true,
[](const char *path, const char *query, const char *fragment) -> unsigned int {
return 1; // according to consistent_hash this will hit server[0]
return 511702306; // according to consistent_hash this will hit server[0]
});
UpstreamManager::upstream_add_server("manual", "127.0.0.1:8001");
UpstreamManager::upstream_add_server("manual", "127.0.0.1:8002");