Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Lua Resty Etcd | 170 | 3 months ago | 15 | apache-2.0 | Perl | |||||
Nonblocking Lua etcd driver library for OpenResty | ||||||||||
Dnmp | 134 | 3 months ago | Shell | |||||||
docker-compose部署LNMP环境 Nginx/Openresty、MySQL(5.7、8.0、8.1)、PHP7.4(8.0、5.6)、Redis5.0、PHPMyAdmin、Xdebug、RabbitMQ、Nacos | ||||||||||
Ws Cloud Gateway | 73 | 15 days ago | 7 | apache-2.0 | Lua | |||||
基于 openresty + etcd 实现的轻量级网关服务 | ||||||||||
Lua Resty Upstream Etcd | 60 | 3 years ago | Lua | |||||||
An OpenResty lua module that can use upstream config in etcd and Kubernetes. | ||||||||||
Sysadvent 2014 | 9 | 8 years ago | Lua | |||||||
Repo to go along with my sysadvent 2014 post | ||||||||||
Elb | 7 | 4 years ago | 5 | January 10, 2018 | mit | Lua | ||||
Eru load balancer | ||||||||||
Deploybeta | 7 | 10 months ago | 2 | apache-2.0 | Go | |||||
A simple container platform based on reliable solutions. | ||||||||||
Api Gateway By Openresty | 1 | 5 years ago | apache-2.0 | Lua | ||||||
基于OpenResty(nginx+lua)的API网关 | ||||||||||
Docker_compose | 1 | 2 years ago | Shell | |||||||
搭建集群docker-compose.yml | ||||||||||
Lua Resty Etcd Discovery Client | 1 | 5 years ago | bsd-3-clause | Lua | ||||||
Lua etcd discovery client based on lua-resty-http |
基于 openresty + etcd 实现的轻量级网关服务
目前市面上已经有很多网关组件,ws-cloud-gateway 的定位是比更加轻量,只保留在实践中经常使用到的组件,同时可以自定义插件,针对不用业务,定制化个性功能。
项目中参考了 incubator-apisix,同时有部分代码直接引用了apisix源码。
travis 自动化构建服务器测试,开2个worker进程,QPS: 23459.84,平均延迟: 0.7毫秒
# wrk 测试
$ ./bin/travis-runner.sh after_success
+case_opt=after_success
+shift
+case ${case_opt} in
+after_success
+cat benchmark/out/wrk.out
Running 5s test @ http://127.0.0.1:10000/innerapi/hello
2 threads and 16 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 719.30us 544.56us 13.10ms 79.90%
Req/Sec 11.78k 1.38k 15.45k 72.55%
Latency Distribution
50% 693.00us
75% 0.92ms
90% 1.29ms
99% 2.23ms
119636 requests in 5.10s, 35.25MB read
Non-2xx or 3xx responses: 119636
Requests/sec: 23459.84
Transfer/sec: 6.91MB
服务启动时,将自己的节点信息注册到etcd,包括:服务名称、ip、端口
网关服务从 etcd 监听服务节点信息,保存到缓存中,从客户端请求的url中提取服务名称,通过服务名称查找节点信息,将请求转发到后端服务