0
votes

Im running Jmeter 2.13, and was wondering how to mimic a browser.

Ive done everything I can to ensure the headers are the same (keep-alive, "Retrieve All Embedded Resources", "User concurrent pool") but when I monitor my apache server-status I can see the main page request being kept alive and the static resources are open/download/close. If I compare this to accessing the site with IE I see a longer keep-alive on the static resources.

Does anyone have any suggestions to extending the keepalive on the static resources?

1

1 Answers

3
votes

By default thread(s) which download embedded resources inherit all the settings from parent sampler, it includes:

  • connect timeout
  • response timeout
  • follow redirects
  • keep alive or close the connection

You can look into HTTPHC4Impl.java source yourself, the relevant method is

protected void setupRequest(URL url, HttpRequestBase httpRequest, HTTPSampleResult res)

The difference in JMeter and browser behaviours may be caused by missing HTTP Cache Manager. Real life browsers download embedded resources. Well-behaved browsers send "Connection: close" header in order to release server and client resources. All the browsers download embedded resources only once, on subsequent requests the resource is returned from browser's cache.

So double check settings in your HTTP Request Defaults test element (remember that local HTTP Request sampler settings override the defaults)