一个支持负载均衡,健康检查的 TcpProxy

2016-10-05 18:27:20 +08:00
 zhengji

goTcpProxy

一个支持负载均衡,健康检查的 TcpProxy

Description

How To Compile

cd $GOPATH;
git clone http://github.com/zheng-ji/goTcpProxy;
make

How To Use

配置文件详解

bind: 0.0.0.0:9999      // 代理服务监听端口
wait_queue_len: 100     // 等待队列长度
max_conn: 10000         // 并发最大连接
timeout: 5              // 请求超时时间
failover: 3             // 后端服务允许失败次数
stats: 0.0.0.0:19999    // 健康检查接口
backend:                // 后端服务列表
    - 127.0.0.1:80
    - 127.0.0.1:81
log:
    level: "info"
    path: "/Users/zj/proxy.log"
// 运行服务
./goTcpProxy -c=etc/conf.yaml

3013 次点击
所在节点    分享创造
4 条回复
Yamade
2016-10-05 22:53:48 +08:00
http 来一个啊。
xu1ming
2016-10-06 11:19:16 +08:00
不错,学习了
tinybaby365
2016-10-07 12:18:45 +08:00
有考虑 go gc 时 stop the world 吗?
Beebird
2016-10-07 19:36:30 +08:00
跟 haproxy 的区别有哪些?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/310708

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX