Jmeter随机定时器+光油问题

时间:2014-03-25 11:32:15

标签: apache http timer jmeter varnish

我有一个简单的jmeter计划,使用Uniform Random Timer

Random Delay Maximum (in milliseconds): 15000.0
Constant Delay Offset (in milliseconds): 5000

我正在使用的HTTP标头数据:

Content-Type     application/x-www-form-urlencoded
Accept-Language  lt,en-us;q=0.7,en;q=0.3
Accept           text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent           Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
Referer          http://.../.../tao/Main/login
Accept-Encoding  gzip, deflate

请求数据:

POST http://.../.../tao/Main/login

POST data:
loginForm_sent=1&login=u509&password=demo&processUri=&activityUri=&connect=Log+in

Cookie Data:
tao_XK0R3qTp=uijd30hi0gls2i9l2i2ikr97b3

Request Headers:
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Accept-Language: lt,en-us;q=0.7,en;q=0.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
Referer: http://.../.../tao/Main/login
Accept-Encoding: gzip, deflate
Content-Length: 81
Host: ...

当我不使用随机计时器时,这是有效的。但是当我使用随机计时器时,这个HTTP请求不起作用。

Thread Name: ... 1-1
Sample Start: 2014-03-25 13:16:54 EET
Load time: 1
Latency: 0
Size in bytes: 1939
Headers size in bytes: 0
Body size in bytes: 1939
Sample Count: 1
Error Count: 1
Response code: Non HTTP response code: org.apache.http.NoHttpResponseException
Response message: Non HTTP response message: The target server failed to respond

Response headers:


HTTPSampleResult fields:
ContentType: 
DataEncoding: null

HTTP请求响应数据错误:

org.apache.http.NoHttpResponseException: The target server failed to respond
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:95)
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:61)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
    at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
    at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:481)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1094)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)

清漆配置: 我还没有改变任何东西,所以配置是默认的:

backend default {
     .host = "127.0.0.1";
     .port = "8080";
}

从这个我可以假设由于某种原因apache服务器没有得到这个请求,或者超时? 所以结束我的问题:当我使用Varnish并且jmeter有随机定时器时,这个HTTP请求不起作用。当我删除随机计时器时,清漆没有问题。现在,当我不使用清漆时,这可以使用和不使用随机计时器。我想这更像是对想法/帮助的要求而不是问题。我似乎无法解决这个问题。

1 个答案:

答案 0 :(得分:0)

似乎我必须将会话超时添加到/etc/default/varnish/

 DAEMON_OPTS="-a :80 \
              -T localhost:6082 \
              -f /etc/varnish/default.vcl \
              -S /etc/varnish/secret \
              -s malloc,256m \
              -p sess_timeout=300"

虽然我不喜欢增加会话超时,但如果你们中任何人知道这个问题的更好答案,请继续回答。

相关问题