milamberspace commented on issue #6461:
URL: https://github.com/apache/jmeter/issues/6461#issuecomment-7046922936

   @orimarko thanks for looking into this!
   
   Short answer: yes, I think HttpClient4 (and HttpClient5) support is what 
this issue is really about, and I would rather not ship a 
Java-implementation-only option on its own.
   
   A bit of context: `AccessLogSampler` extends `HTTPSampler`, i.e. it is 
hard-wired to the `Java` implementation (`HttpURLConnection`). Adding a "Use 
Keep-Alive" option there helps, but connection reuse with `HttpURLConnection` 
relies on a JVM-wide pool shared by all threads (and capped by 
`http.maxConnections`), which is not very representative of independent virtual 
users. HttpClient4/5 give per-thread connection management, the 
`httpclient4.*`/`httpclient5.*` settings, HTTP/2 for HC5, etc.
   
   What I would suggest:
   
   1. Add an `Implementation` property to the Access Log Sampler 
(`HttpClient4`, `HttpClient5`, `Java`) and let the sampler delegate the actual 
request to the selected implementation, the same way `HTTPSamplerProxy` does 
(this is basically a clean version of the workaround mpol mentioned).
   2. Keep your "Use Keep-Alive" option as part of the same change.
   3. Backward compatibility: both should be opt-in. When the properties are 
missing (existing test plans) or left at their defaults, the sampler should 
behave exactly as today (`Java` implementation, no keep-alive), so nobody gets 
a behaviour change just by upgrading.
   4. Tests: the HTTP module tests use WireMock and are usually parameterized 
over the implementations (see `HttpSamplerTest.kt` or `TestDecompression`). A 
test checking connection reuse / the `Connection` header for each 
implementation would be great.
   5. Please also update the Access Log Sampler section in 
`xdocs/usermanual/component_reference.xml` and add an entry in 
`xdocs/changes.xml`.
   
   Happy to review the PR once it's ready.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to