- 論壇徽章:
- 0
|
本帖最后由 henhaoqi 于 2012-04-10 00:57 編輯
回復(fù) 246# aaaaaa
我用jmeter壓的,剛剛發(fā)現(xiàn)如果設(shè)置max-age為600,基本是對(duì)的,到了10分鐘有時(shí)超一點(diǎn),最多的超20秒(10分鐘后20秒)后訪問服務(wù)器
設(shè)置為120、180。。。360都非常不準(zhǔn),360的時(shí)候是這樣的
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
是不是還有個(gè)什么算法和訪問次數(shù)有關(guān)啊?或者有個(gè)什么閥值配置有問題?
如果設(shè)置max-age為60,直接使用瀏覽器訪問時(shí)是好的,但是壓測(cè)時(shí)就有問題。
按照您的要求,我把取樣器的結(jié)果打出來了,先給您看看max-age=60時(shí)后臺(tái)服務(wù)器的訪問間隔
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
然后看看測(cè)試日志中c45(c46重新訪問服務(wù)器了)的響應(yīng):
<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的響應(yīng)
<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已經(jīng)是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(毫秒)。
哦,對(duì)了,我是使用了regex_remap把querystring去掉了的,所以所有的URL最后到后臺(tái)服務(wù)器都轉(zhuǎn)成了http://json.proxy.ast.com:8080/json。即使是不用regex_remap,我也測(cè)試過,一樣的結(jié)果。
是很詭異啊 |
|