- 论坛徽章:
- 0
|
本帖最后由 henhaoqi 于 2012-04-10 00:57 编辑
回复 246# aaaaaa
我用jmeter压的,刚刚发现如果设置max-age为600,基本是对的,到了10分钟有时超一点,最多的超20秒(10分钟后20秒)后访问服务器
设置为120、180。。。360都非常不准,360的时候是这样的
c274 Tue Apr 10 00:19:03 CST 2012
c6233 Tue Apr 10 00:21:09 CST 2012
c12524 Tue Apr 10 00:23:10 CST 2012
c19459 Tue Apr 10 00:25:13 CST 2012
是不是还有个什么算法和访问次数有关啊?或者有个什么阀值配置有问题?
如果设置max-age为60,直接使用浏览器访问时是好的,但是压测时就有问题。
按照您的要求,我把取样器的结果打出来了,先给您看看max-age=60时后台服务器的访问间隔
c1 Tue Apr 10 00:35:12 CST 2012
c46 Tue Apr 10 00:35:13 CST 2012
c487 Tue Apr 10 00:35:22 CST 2012
c511 Tue Apr 10 00:35:23 CST 2012
c565 Tue Apr 10 00:35:24 CST 2012
c655 Tue Apr 10 00:35:26 CST 2012
然后看看测试日志中c45(c46重新访问服务器了)的响应:
<httpSample lt="6" ts="1333989313050" lb="HTTP Request HTTPClient" rc="200" dt="text" by="146">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:42 GMT
json2jsonp: true
Content-Length: 146
Age: 1
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c45</java.net.URL>
</httpSample>
再看c46的响应
<httpSample lt="31" ts="1333989313057" lb="HTTP Request HTTPClient" rc="200" dt="text" by="146">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:43 GMT
json2jsonp: true
Content-Length: 146
Age: 0
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c46</java.net.URL>
</httpSample>
Age已经是0了
再看看c486(c487重新访问了)
<httpSample lt="27" ts="1333989322409" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:43 GMT
json2jsonp: true
Content-Length: 147
Age: 9
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c486</java.net.URL>
</httpSample>
c487的age就是0了
<httpSample lt="12" ts="1333989322437" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:52 GMT
json2jsonp: true
Content-Length: 147
Age: 0
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c487</java.net.URL>
</httpSample>
c510(c511后重新访问)
<httpSample lt="6" ts="1333989322876" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:52 GMT
json2jsonp: true
Content-Length: 147
Age: 1
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c510</java.net.URL>
</httpSample>
c511的:
<httpSample lt="23" ts="1333989322883" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:53 GMT
json2jsonp: true
Content-Length: 147
Age: 0
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c511</java.net.URL>
</httpSample>
c564(c565重新访问),age是1:
<httpSample lt="27" ts="1333989324115" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:53 GMT
json2jsonp: true
Content-Length: 147
Age: 1
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c564</java.net.URL>
</httpSample>
c565的:
<httpSample lt="12" ts="1333989324142" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:54 GMT
json2jsonp: true
Content-Length: 147
Age: 0
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c565</java.net.URL>
</httpSample>
c654(c655重新访问):
<httpSample lt="21" ts="1333989325969" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:54 GMT
json2jsonp: true
Content-Length: 147
Age: 2
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c654</java.net.URL>
</httpSample>
c655的:
<httpSample lt="25" ts="1333989325990" lb="HTTP Request HTTPClient" rc="200" dt="text" by="147">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=60
Server: ATS/3.0.4
Date: Mon, 09 Apr 2012 16:33:56 GMT
json2jsonp: true
Content-Length: 147
Age: 0
Connection: keep-alive
</responseHeader>
<java.net.URL>http://json.proxy.ast.com:8080/json?cb=c655</java.net.URL>
</httpSample>
ts就是timestamp(毫秒)。
哦,对了,我是使用了regex_remap把querystring去掉了的,所以所有的URL最后到后台服务器都转成了http://json.proxy.ast.com:8080/json。即使是不用regex_remap,我也测试过,一样的结果。
是很诡异啊 |
|