Bug 59034 - Parallel downloads connection management is not realistic
Summary: Parallel downloads connection management is not realistic
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.13
Hardware: SGI All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
: 59029 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-19 15:09 UTC by benoit.wiart
Modified: 2016-02-21 21:55 UTC (History)
1 user (show)



Attachments
Test Plan used for benching against a Tomcat 8.30 (26.95 KB, application/xml)
2016-02-21 15:32 UTC, Philippe Mouawad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.wiart 2016-02-19 15:09:29 UTC
Each parallel sampler execution create a new httpclient + connection pool.
That's bad as :
- it does not reproduce the browser max connection per host limit
- the connections are not re-used between download as a browser would do
Comment 1 Philippe Mouawad 2016-02-21 15:31:11 UTC
Hi,
I submitted this PR for this:
https://github.com/apache/jmeter/pull/135

Please be aware that patch would not work if PR 132 for Bug 52073 was applied as the Thread Pool in the fix is shared among all threads while for now there is 1 pool per Virtual User Thread.


If the PR 132 was applied, a solution would be for example to:

- Create a Session Manager that generate a zone per virtual user (with UUID)
- The current HTTPCLIENTS_CACHE_PER_THREAD_AND_HTTPCLIENTKEY would be available per the virtual user key
- This would make it sharing possible without switching to InheritableThreadLocal


I benchmarked current patch vs current trunk (5 minutes test / 15 threads):

Before:
summary = 499819 in 00:05:07 = 1627.8/s Avg:    14 Min:     0 Max: 11821 Err:    26 (0.01%)

After:
summary = 1177289 in 00:05:07 = 3834.1/s Avg:     4 Min:     0 Max:  2172 Err:    38 (0.00%)



As you can see:
- Throughput is 135% higher
- Response times are also much more realistic
- Compared to bench mentionned in Bug 58950, there is no more huge ephemeral ports consumption and no more CPU pause during the test


Feedback very welcome
Comment 2 Philippe Mouawad 2016-02-21 15:32:22 UTC
Created attachment 33577 [details]
Test Plan used for benching against a Tomcat 8.30
Comment 3 Philippe Mouawad 2016-02-21 21:46:17 UTC
*** Bug 59029 has been marked as a duplicate of this bug. ***
Comment 4 Philippe Mouawad 2016-02-21 21:55:21 UTC
Author: pmouawad
Date: Sun Feb 21 21:49:31 2016
New Revision: 1731570

URL: http://svn.apache.org/viewvc?rev=1731570&view=rev
Log:
Bug 59034 - Parallel downloads connection management is not realistic
Bugzilla Id: 59034

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jmeter/trunk/xdocs/changes.xml



Based on:
https://github.com/apache/jmeter/pull/135
https://github.com/apache/jmeter/pull/136