惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - xshy

11个炫目的免费PSD格式网站模板 推荐20个免费的icon图标集给web开发者 分享35个漂亮的苹果Logo壁纸 PPT模板欣赏及免费下载之商务、教育、科技类 50个免费的wordpress模板下载 7个工具助你在android手机上隐藏图片和视频 解决selenium-RC无法启动firefox浏览器进行java测试脚本的问题 selenium中文编码问题 使用loadrunner做性能测试 经验总结一 Web Application Stress Tool入门 一个U盘搞定Windows XP系统安装(http://www.wss123.net/wsso/20100815_72.html) 办公室电脑从业者多吃β胡萝卜素 在ArcGIS 10中轻松实现将应用移植到云计算平台 什么是CDN?CDN的用处是什么?有哪些著名的CDN? - xshy - 博客园 jQuery常见问题总结 - xshy - 博客园 u盘中毒后文件后缀变为exe,杀毒后文件被隐藏之解决办法(转载) java数据结构和算法——学习五 java数据结构和算法——学习四 java数据结构和算法——学习三
使用loadrunner做性能测试 经验总结二
xshy · 2011-05-11 · via 博客园 - xshy

问题:项目使用了Ajax技术,有些请求的参数巨多,主要是一些坐标对,对于跨域访问,使用了jsonp协议,但是发送请求使用Get方式,就会对请求长度有限制,浏览器在处理这种超过最大限制的请求时,是将一个请求分为两部分,相当于发两次请求。loadrunner在录制时,忠实地将这两个请求记录为两个web_url。记录下来的脚本如下所示:

web_url("commonhandler_4",
                "URL=http://www.mydomain.com/iserver/commonhandler?mapName=【。。。。此处省去若干参数串】&sectionCount=2&sectionIndex=0&jsonpUserID=1305099187125",
                "Resource=0",
                "Referer=http://www.mydomain.com/map/",
                "Mode=HTTP",
                LAST);

        web_url("commonhandler_5",
                "URL=http://www.mydomain.com/iserver/commonhandler?method=Search&t=1305099187125&jsonp=sm_callbacks[13050991871255502]&sectionCount=2&sectionIndex=1&jsonpUserID=1305099187125",
                "Resource=0",
                "Referer=http://www.mydomain.com/map/",
                "Snapshot=t336.inf",
                "Mode=HTTP",
                LAST);

这个脚本在重放时,虽然显示成功,但是却得不到返回结果,而且服务器端也没有接收到请求,结果日志如下:

Starting iteration 1.
Warning -27077: The "vuser_init" section contains web function(s) when the "Simulate a new user on each iteration" Run-Time Setting is ON.  This may produce unpredictable results with multiple iterations          [MsgId: MWAR-27077]
Starting action Action.
Action.c(6): web_url("commonhandler_4") was successful, 0 body bytes, 102 header bytes          [MsgId: MMSG-26386]
Action.c(16): web_url("commonhandler_5") was successful, 0 body bytes, 102 header bytes          [MsgId: MMSG-26386]
Ending action Action.

考虑一下,觉得问题应该和这个一个请求,分两个web_url有关系,每一个url都是不完整的。试过很多种方法后,最后总算找出一个行得通的方案:

两个请求合并为一个请求,这个请求中包含两个请求的参数,去掉jsonp相关的参数,和web服务器用来识别分段请求的两个参数sectionCount、sectionIndex。只保留服务器应用程序中用到的参数。这样,重放成功,服务端也得到了完整的请求。

这种方法为什么能行得通,还是一头雾水,看来还需要对loadrunner、浏览器对于http协议的支持继续深入研究。