【问题标题】:Jmeter Random Timer + Varnish IssuesJmeter 随机定时器 + 清漆问题
【发布时间】:2014-05-03 05:16:22
【问题描述】:

我有一个简单的 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 请求不起作用。当我删除随机计时器时,清漆没有问题。现在,当我不使用清漆时,无论是否使用随机计时器,它都可以使用。我想这更像是对想法/帮助的请求而不是问题。我似乎无法解决这个问题。

【问题讨论】:

    标签: apache http timer jmeter varnish


    【解决方案1】:

    看来我必须将会话超时添加到/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"
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-04
      • 1970-01-01
      • 2014-07-07
      • 2017-05-29
      • 2021-09-30
      相关资源
      最近更新 更多