-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathparams.json
6 lines (6 loc) · 4.74 KB
/
params.json
1
2
3
4
5
6
{
"name": "Tcpproxy",
"tagline": "一个支持主备/哈希/随机分配模式的负载均衡代理服务器",
"body": "# TcpProxy\r\n一个支持主备/哈希/随机分配模式的负载均衡代理服务器\r\n\r\n【TcpProxy技术交流QQ群】: 99328252 加入群:http://jq.qq.com/?_wv=1027&k=40qDFxw\r\n\r\n\r\n\r\n## 特性\r\n1. 分配策略丰富,支持二级、多种分配策略 \r\n >*负载均衡策略*: \r\n >第一级: 采用来源IP计算hash值来分配到对应的组; \r\n >第二级: 在组内采用配置的方式(master/hash/rand)分配到对应的节点。 \r\n \r\n2. 性能强悍(见后续性能测试) \r\n3. 自动检查后端服务器状态 \r\n\r\n\r\n## 获取\r\n```\r\ngo get -u github.com/yl365/TcpProxy\r\n```\r\n\r\n## 使用\r\n\r\n1、 修改配置文件config.json\r\n\r\n```\r\n{\r\n \"Listen\": \":18080\", //监听端口\r\n \"Mode\": \"master/hash/rand\", //分配模式,master/hash/rand根据场景选择一种\r\n \"AllHost\": [\r\n {\r\n \"min\": 0, //每组服务器的处理范围[0--999],每组分配不要重合\r\n \"max\": 333, \r\n \"Hosts\": [\r\n {\r\n \"IP\": \"127.0.0.1:2000\", \r\n \"status\": 0\r\n }, \r\n {\r\n \"IP\": \"127.0.0.1:2001\", \r\n \"status\": 0\r\n }\r\n ]\r\n }, \r\n {\r\n \"min\": 334, \r\n \"max\": 666, \r\n \"Hosts\": [\r\n {\r\n \"IP\": \"127.0.0.1:2002\", \r\n \"status\": 0\r\n }, \r\n {\r\n \"IP\": \"127.0.0.1:2003\", \r\n \"status\": 0\r\n }\r\n ]\r\n }, \r\n {\r\n \"min\": 667, \r\n \"max\": 999, \r\n \"Hosts\": [\r\n {\r\n \"IP\": \"127.0.0.1:2004\", \r\n \"status\": 0\r\n }, \r\n {\r\n \"IP\": \"127.0.0.1:2005\", \r\n \"status\": 0\r\n }\r\n ]\r\n }\r\n ]\r\n}\r\n```\r\n\r\n2、 在配置目录运行: nohup ./TcpProxy &\r\n\r\n\r\n## 性能测试\r\n\r\n后端服务器采用spark作为目标服务器: `./spark -port 52241 \"<h1>Ooops</h1>\" `\r\n\r\n1、 直连spark测试:\r\n\r\n``` \r\n[yl@mobile-server-61 bin]$ ./gobench -c 3000 -k -t 10 -u http://10.15.107.61:52241/\r\nDispatching 3000 clients\r\nWaiting for results...\r\n\r\nRequests: 729340 hits\r\nSuccessful requests: 729339 hits\r\nNetwork failed: 0 hits\r\nBad requests failed (!2xx): 0 hits\r\nSuccessful requests rate: 72933 hits/sec\r\nRead throughput: 9481420 bytes/sec\r\nWrite throughput: 6587163 bytes/sec\r\nTest time: 10 sec\r\n```\r\n\r\n2、 通过haproxy测试:\r\n\r\n```\r\n[yl@mobile-server-61 bin]$ ./gobench -c 3000 -k -t 10 -u http://10.15.107.61:8008/\r\nDispatching 3000 clients\r\nWaiting for results...\r\n\r\nRequests: 128291 hits\r\nSuccessful requests: 128291 hits\r\nNetwork failed: 0 hits\r\nBad requests failed (!2xx): 0 hits\r\nSuccessful requests rate: 12829 hits/sec\r\nRead throughput: 1667952 bytes/sec\r\nWrite throughput: 1155709 bytes/sec\r\nTest time: 10 sec\r\n```\r\n\r\n3、 通过TcpProxy测试:\r\n\r\n```\r\n[yl@mobile-server-61 bin]$ ./gobench -c 3000 -k -t 10 -u http://10.15.107.61:18080/\r\nDispatching 3000 clients\r\nWaiting for results...\r\n\r\nRequests: 403622 hits\r\nSuccessful requests: 403622 hits\r\nNetwork failed: 0 hits\r\nBad requests failed (!2xx): 0 hits\r\nSuccessful requests rate: 40362 hits/sec\r\nRead throughput: 5247086 bytes/sec\r\nWrite throughput: 3659598 bytes/sec\r\nTest time: 10 sec\r\n```\r\n\r\n欢迎试用并提出意见建议。如果发现bug,请Issues,谢谢!\r\n\r\n如果你觉得这个项目有意义,或者对你有帮助,或者仅仅是为了给我一点鼓励,请不要吝惜,给我一个*star*,谢谢!≡ω≡\r\n\r\n【TcpProxy技术交流QQ群】: 99328252 加入群:http://jq.qq.com/?_wv=1027&k=40qDFxw\r\n",
"note": "Don't delete this file! It's used internally to help with page regeneration."
}