Bug 59029

Summary: httpclient PoolingConnectionManager has inappropriate default values
Product: JMeter - Now in Github Reporter: benoit.wiart
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED DUPLICATE    
Severity: normal CC: p.mouawad
Priority: P2    
Version: 2.13   
Target Milestone: ---   
Hardware: Macintosh   
OS: Windows CE   

Description benoit.wiart 2016-02-18 17:20:43 UTC
looks like jmeter is using the PoolingConnectionManager default values.
From PoolingConnectionManager javadoc
* PoolingConnectionManager maintains a maximum limit of connection on
* a per route basis and in total. Per default this implementation will
* create no more than than 2 concurrent connections per given route
* and no more 20 connections in total.

We should initialize the MeasuringConnectionManager with better (higher) default values.
Comment 1 Sebb 2016-02-18 19:07:36 UTC
Each JMeter thread is intended to simulate an independent user.

So I'm not sure it makes sense to pool connections across threads.
In fact that was one of the issues with using the Java HTTP implementation - it was not possible to control connection pooling.

The defaults seem reasonable to me for a single user.
Comment 2 benoit.wiart 2016-02-18 20:48:30 UTC
a connection pool is created for each user (thread) see HTTPHC4Impl#setupClient
So this is not about sharing connections across threads.

Modern browsers use more connections than the current JMeter default.
see http://sgdev-blog.blogspot.fr/2014/01/maximum-concurrent-connection-to-same.html

Even for a single user, current defaults are not reasonable
Comment 3 Sebb 2016-02-18 21:19:10 UTC
JMeter is not a browser.

JMeter threads behave more like a single browser tab. A browser with a single tab does not need as many connections.

Unless you can show that there is a need to change the default, I think it should be left as it is. If there is a need to change the default for a particular test, then there should be a way to configure the values.
Comment 4 benoit.wiart 2016-02-18 22:47:09 UTC
> JMeter is not a browser.
thanx I wasn't aware... 
But, to be realist, the load should simulate a browser behavior.

> A browser with a single tab does not need as many connections.
Where did you take this information ?
I'm afraid that's wrong. Google for "browser max connection per host".
for example for ie 8 :
"The connection limit is per process, the browser will make the determination about process creation as a web site owner you can't really change that. The process may be shared between multiple tabs/windows or it may not, it depends on many factors outside your control."


the new default value will not change the "main" http samplers as for a given user they are executed sequentially.
But it will make the embedded resources parallel downloads more realistic.

a global parameter that let the user choose a custom value is fine BUT the default value should also be increased.

BTW, did you know that JMeter is not a browser ? ;-)
Comment 5 Philippe Mouawad 2016-02-21 21:46:17 UTC
Will be fixed within Bug 59034

*** This bug has been marked as a duplicate of bug 59034 ***
Comment 6 The ASF infrastructure team 2022-09-24 20:38:02 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3837