From 8cc32315971dc6d18be82a01bb5c2cd73a1974e0 Mon Sep 17 00:00:00 2001 From: tangshimin Date: Fri, 1 Jul 2022 17:29:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4demo=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20feat:=20=E8=B0=83=E6=95=B4=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 31 +-------------------- constant/tl_ops_constant_balance_api.lua | 4 +-- constant/tl_ops_constant_balance_cookie.lua | 4 +-- constant/tl_ops_constant_balance_header.lua | 6 ++-- constant/tl_ops_constant_balance_param.lua | 8 +++--- constant/tl_ops_constant_service.lua | 2 +- constant/tl_ops_constant_waf_api.lua | 2 +- constant/tl_ops_constant_waf_cc.lua | 2 +- constant/tl_ops_constant_waf_cookie.lua | 2 +- constant/tl_ops_constant_waf_header.lua | 2 +- constant/tl_ops_constant_waf_ip.lua | 2 +- constant/tl_ops_constant_waf_param.lua | 2 +- doc/README_EN.md | 29 +------------------ 13 files changed, 19 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index a177029..eba4585 100644 --- a/README.md +++ b/README.md @@ -15,39 +15,10 @@ qq交流群 : 624214498,欢迎有兴趣的童鞋提交PR, 持续更新中 .... -## 性能压测 - -### 版本 : openresty-1.19.3.1 - -### 机器 : 腾讯云2核4g - - ![图片](https://qnproxy.iamtsm.cn/16559798756003.png "图片") - - -### 正常压测结果,执行压测命令 : `ab -n 10000 -c 50 http://127.0.0.1/` , 单个请求耗时约3.7ms - - ![图片](https://qnproxy.iamtsm.cn/16559785692014.png "图片") - - -### 开启tl-ops-manage网关后 【健康检查,路由统计,熔断限流,负载均衡】,执行压测命令 : `ab -n 10000 -c 50 http://127.0.0.1/` ,单个请求耗时约4.6ms - - ![图片](https://qnproxy.iamtsm.cn/16559817202461.png "图片") - - # 说明文档 -- [x] [tl-ops-manage详细文档-推荐](https://book.iamtsm.cn) - -- [x] [路由模块简要文档](doc/tl-ops-balance.md) - -- [x] [健康检查模块简要文档](doc/tl-ops-health.md) - -- [x] [熔断限流模块简要文档](doc/tl-ops-limit.md) - -- [x] [数据模块简要文档](doc/tl-ops-store.md) - - +[tl-ops-manage详细文档](https://book.iamtsm.cn) # 特性 diff --git a/constant/tl_ops_constant_balance_api.lua b/constant/tl_ops_constant_balance_api.lua index cb1d4ac..910357c 100644 --- a/constant/tl_ops_constant_balance_api.lua +++ b/constant/tl_ops_constant_balance_api.lua @@ -14,14 +14,14 @@ local tl_ops_constant_balance_api = { }, demo = { point = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, url = "/*", -- 当前url匹配规则 service = "tlops-demo", -- 当前url路由到的service node = 0, -- 当前url路由到的service下的node的索引 host = "tlops1.com", -- 当前url处理的域名范围 }, random = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, url = "/*", -- 当前url匹配规则 service = "tlops-demo", -- 当前url路由到的service host = "tlops1.com", -- 当前url处理的域名范围 diff --git a/constant/tl_ops_constant_balance_cookie.lua b/constant/tl_ops_constant_balance_cookie.lua index d2393e9..c2a6d1c 100644 --- a/constant/tl_ops_constant_balance_cookie.lua +++ b/constant/tl_ops_constant_balance_cookie.lua @@ -14,7 +14,7 @@ local tl_ops_constant_balance_cookie = { }, demo = { point = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, key = "_tl_session_id", -- 当前cookie匹配名称 value = { -- 当前cookie名称对应值列表 "ok","ok1","ok2" @@ -24,7 +24,7 @@ local tl_ops_constant_balance_cookie = { host = "tlops1.com", -- 当前cookie处理的域名范围 }, random = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, key = "_tl_session_id", -- 当前cookie匹配名称 value = { -- 当前cookie名称对应值列表 "ok","ok1","ok2" diff --git a/constant/tl_ops_constant_balance_header.lua b/constant/tl_ops_constant_balance_header.lua index f3ef376..7e51ae9 100644 --- a/constant/tl_ops_constant_balance_header.lua +++ b/constant/tl_ops_constant_balance_header.lua @@ -14,9 +14,8 @@ local tl_ops_constant_balance_header = { }, demo = { point = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, key = "content-type", -- 当前请求头匹配名称 - value = "text/fragment+html", -- 当前请求头名称对应值 value = { -- 当前请求头名称对应值列表 "text/fragment+html","text/plain" }, @@ -25,9 +24,8 @@ local tl_ops_constant_balance_header = { host = "tlops1.com", -- 当前请求头处理的域名范围 }, random = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, key = "content-type", -- 当前请求头匹配名称 - value = "text/fragment+html", -- 当前请求头名称对应值 value = { -- 当前请求头名称对应值列表 "text/fragment+html","text/plain" }, diff --git a/constant/tl_ops_constant_balance_param.lua b/constant/tl_ops_constant_balance_param.lua index 0645d21..d5acc48 100644 --- a/constant/tl_ops_constant_balance_param.lua +++ b/constant/tl_ops_constant_balance_param.lua @@ -14,7 +14,7 @@ local tl_ops_constant_balance_param = { }, demo = { point = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, key = "_tl_id", -- 当前请求参数匹配名称 value = { -- 当前请求参数名称对应值列表 "text/fragment+html","text/plain" @@ -24,7 +24,7 @@ local tl_ops_constant_balance_param = { host = "tlops1.com", -- 当前请求参数处理的域名范围 }, random = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, key = "_tl_id", -- 当前请求参数匹配名称 value = { -- 当前请求参数名称对应值列表 "text/fragment+html","text/plain" @@ -33,8 +33,8 @@ local tl_ops_constant_balance_param = { host = "tlops1.com", -- 当前请求参数处理的域名范围 } }, - rule = { -- cookie rule 策略 - point = "point", -- cookie路由可指定到具体节点 + rule = { -- rule 策略 + point = "point", -- 路由可指定到具体节点 random = "random" -- 随机路由可指定到具体服务 }, } diff --git a/constant/tl_ops_constant_service.lua b/constant/tl_ops_constant_service.lua index 6d6ca70..e0b036d 100644 --- a/constant/tl_ops_constant_service.lua +++ b/constant/tl_ops_constant_service.lua @@ -10,7 +10,7 @@ local tl_ops_constant_service = { }, demo = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, name = "tlops-demo-node", -- 当前节点name service = "service", -- 当前节点所属service protocol = "http://", -- 当前节点协议头 diff --git a/constant/tl_ops_constant_waf_api.lua b/constant/tl_ops_constant_waf_api.lua index eb0d509..da9f171 100644 --- a/constant/tl_ops_constant_waf_api.lua +++ b/constant/tl_ops_constant_waf_api.lua @@ -14,7 +14,7 @@ local tl_ops_constant_waf_api = { open = true, scope = scope.global, demo = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, host = "tlops.com", -- 当前生效的域名 value = ".git", -- 当前匹配的规则 service = "tlops-demo", -- 当前生效的service diff --git a/constant/tl_ops_constant_waf_cc.lua b/constant/tl_ops_constant_waf_cc.lua index 1cb10a1..ad05742 100644 --- a/constant/tl_ops_constant_waf_cc.lua +++ b/constant/tl_ops_constant_waf_cc.lua @@ -15,7 +15,7 @@ local tl_ops_constant_waf_cc = { open = true, scope = scope.global, demo = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, host = "tlops.com", -- 当前生效的域名 time = 60, -- cc记录过期时间 count = 100, -- time内触发次数 diff --git a/constant/tl_ops_constant_waf_cookie.lua b/constant/tl_ops_constant_waf_cookie.lua index c5dcbd7..2c14422 100644 --- a/constant/tl_ops_constant_waf_cookie.lua +++ b/constant/tl_ops_constant_waf_cookie.lua @@ -14,7 +14,7 @@ local tl_ops_constant_waf_cookie = { open = true, scope = scope.global, demo = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, host = "tlops.com", -- 当前生效的域名 value = "select.", -- 当前匹配的正则 service = "tlops-demo", -- 当前生效的service diff --git a/constant/tl_ops_constant_waf_header.lua b/constant/tl_ops_constant_waf_header.lua index 1a11770..2a60a91 100644 --- a/constant/tl_ops_constant_waf_header.lua +++ b/constant/tl_ops_constant_waf_header.lua @@ -14,7 +14,7 @@ local tl_ops_constant_waf_header = { open = true, scope = scope.global, demo = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, host = "tlops.com", -- 当前生效的域名 keys = { -- 拦截的请求头名称列表 "User-Agent","Accept" diff --git a/constant/tl_ops_constant_waf_ip.lua b/constant/tl_ops_constant_waf_ip.lua index 808b699..484f6ed 100644 --- a/constant/tl_ops_constant_waf_ip.lua +++ b/constant/tl_ops_constant_waf_ip.lua @@ -14,7 +14,7 @@ local tl_ops_constant_waf_ip = { open = true, scope = scope.global, demo = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, host = "tlops.com", -- 当前生效的域名 value = "127.0.0.1", -- 当前匹配的规则 service = "tlops-demo", -- 当前生效的service diff --git a/constant/tl_ops_constant_waf_param.lua b/constant/tl_ops_constant_waf_param.lua index d389c79..2a84cb9 100644 --- a/constant/tl_ops_constant_waf_param.lua +++ b/constant/tl_ops_constant_waf_param.lua @@ -14,7 +14,7 @@ local tl_ops_constant_waf_param = { open = true, scope = scope.global, demo = { - id = snowflake.generate_id( 100 ), -- default snow id + id = 1, host = "tlops.com", -- 当前生效的域名 value = "java.lang", -- 当前匹配的规则 service = "tlops-demo", -- 当前生效的service diff --git a/doc/README_EN.md b/doc/README_EN.md index 8b45db3..f482a01 100644 --- a/doc/README_EN.md +++ b/doc/README_EN.md @@ -13,37 +13,10 @@ QQ : 624214498, welcome to submit PR, we will continue to update .... 中文翻译 -# Performance stress test - -### Version : openresty-1.19.3.1 - -### Machine: Tencent Cloud 2 core 4g - - ![Picture](https://qnproxy.iamtsm.cn/16559798756003.png "Picture") - - -### For normal pressure test results, execute the pressure test command: `ab -n 10000 -c 50 http://127.0.0.1/` , a single request takes about 3.7ms - - ![Picture](https://qnproxy.iamtsm.cn/16559785692014.png "Picture") - - -### After enabling the tl-ops-manage gateway [health check, routing statistics, fuse current limiting, load balancing], execute the stress test command: `ab -n 10000 -c 50 http://127.0.0.1/` , single The request takes about 4.6ms - - ![Picture](https://qnproxy.iamtsm.cn/16559817202461.png "Picture") - - # Documentation -- [x] [tl-ops-manage detailed documentation](https://book.iamtsm.cn) - -- [x] [Brief documentation of routing module](tl-ops-balance.md) - -- [x] [Brief Documentation of Health Check Module](tl-ops-health.md) - -- [x] [Brief Documentation of Fusing Current Limiting Module](tl-ops-limit.md) - -- [x] [Data Module Brief Documentation](tl-ops-store.md) +[tl-ops-manage detailed documentation](https://book.iamtsm.cn) # Features