服务网关 - 性能压测

一、测试环境

1、硬件环境

1.1、LoaderRunner集群

  • 控制节点:10.110.20.181
  • 执行节点:10.106.1.41
  • 执行节点:10.10.11.172

1.2、直接访问

  • http://10.110.20.196:8080/DemoWeb/rest/SpringJson/GetJson2.do?param11=req11&param12=req12&param21=req21&param22=req22

1.3、网关转发

  • http://10.110.20.191:8080/api-gateway-engine/API/LsqGrp1/V0001/LsqApi1A?param11=req11&param12=req12&param21=req21&param22=req22

  • 10.110.20.191 -> 10.110.20.196:8080

2、测试用例

2.1、

2.2、

2.3、

二、直接访问和网关转发

1、直接访问

1.1、测试脚本

#include "web_api.h"

Action()
{
int HttpRetCode;
web_add_cookie("MUID=1758581795A969EC26F352D291A96FCA; DOMAIN=www.bing.com");

web_add_header("Content-Type","application/json");
web_add_header("Accept","application/json");
web_add_header("x-cli-sign-signature","oGvqUMw7fZISooGjY8z3qbVeb49SdDyDQCBAKS3t4xc=");
web_add_header("x-cli-sign-client-key","f9993621997249ae8c930067011d0d8a");
web_add_header("x-cli-sign-headers","x-ca-front-timestamp,x-ca-front-nonce,x-ca-request-mode");
web_add_header("x-cli-ra-timestamp","1503383699505");
web_add_header("x-cli-ra-nonce","223344");
web_add_header("x-cli-run-mode","debug");

web_url("favicon.ico", 
"URL=http://10.110.20.196:8080/DemoWeb/rest/SpringJson/GetJson2.do?param11=req11&param12=req12&param21=req21&param22=req22", 
"Resource=1", 
"RecContentType=image/x-icon", 
"Referer=", 
"Snapshot=t1.inf", 
LAST);

//{"result11":"res11-req11","result12":"res12-req12","result21":"res21-req21","result22":"res21-req22"}

HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)
lr_log_message("The Vuser exec-succeed!");
else
lr_log_message("The Vuser exec-failed!");

return 0;

}

1.2、执行结果

 

2、网关转发

2.1、测试脚本

#include "web_api.h"

Action()
{
int HttpRetCode;
web_add_cookie("MUID=1758581795A969EC26F352D291A96FCA; DOMAIN=www.bing.com");

web_add_header("Content-Type","application/json");
web_add_header("Accept","application/json");
web_add_header("x-cli-sign-signature","oGvqUMw7fZISooGjY8z3qbVeb49SdDyDQCBAKS3t4xc=");
web_add_header("x-cli-sign-client-key","f9993621997249ae8c930067011d0d8a");
web_add_header("x-cli-sign-headers","x-ca-front-timestamp,x-ca-front-nonce,x-ca-request-mode");
web_add_header("x-cli-ra-timestamp","1503383699505");
web_add_header("x-cli-ra-nonce","223344");
web_add_header("x-cli-run-mode","debug");

web_url("favicon.ico",
"URL=http://10.110.20.191:8080/api-gateway-engine/API/LsqGrp1/V0001/LsqApi1A?param11=req11&param12=req12&param21=req21&param22=req22",
"Resource=1",
"RecContentType=image/x-icon",
"Referer=",
"Snapshot=t1.inf",
LAST);

//{"result11":"res11-req11","result12":"res12-req12","result21":"res21-req21","result22":"res21-req22"}

HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)
lr_log_message("The Vuser exec-succeed!");
else
lr_log_message("The Vuser exec-failed!");

return 0;

}

2.2、测试结果

3、结果分析

3.1、分析过程

     前者每秒8000,后者每秒1800

3.2、分析代码

      后者比前者多了一个网关的tomcat请求响应,多了几次redis存取

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值