[
https://issues.apache.org/jira/browse/HTTPCLIENT-2007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902337#comment-16902337
]
Venu Kemthur commented on HTTPCLIENT-2007:
------------------------------------------
Thanks Oleg. We were using Jersey 2 + Apache 4 connector and it did not have a
way to set UserTokenHandler
But yes, we were not reusing TLS; Added a NoOpUserTokenHandler and got the same
performance as Jdk 11 Http client
{code:java}
HttpClients.custom().setDefaultRequestConfig(requestConfig).setConnectionManager(poolingConnecionManager)
.setUserTokenHandler(new NoopUserTokenHandler()).build();{code}
{code:java}
data_received..............: 17 MB 281 kB/s
data_sent..................: 91 MB 1.5 MB/s
http_req_blocked...........: avg=739.69µs min=1µs med=3µs max=406.89ms
p(90)=6µs p(95)=7µs
http_req_connecting........: avg=105.83µs min=0s med=0s max=42.1ms p(90)=0s
p(95)=0s
http_req_duration..........: avg=155.41ms min=49.61ms med=129.34ms max=4.09s
p(90)=265.76ms p(95)=318.03ms
http_req_receiving.........: avg=60.74µs min=21µs med=51µs max=6.12ms
p(90)=82µs p(95)=95µs
http_req_sending...........: avg=22.71µs min=7µs med=19µs max=5.68ms
p(90)=32µs p(95)=38µs
http_req_tls_handshaking...: avg=629.18µs min=0s med=0s max=370.81ms p(90)=0s
p(95)=0s
http_req_waiting...........: avg=155.33ms min=49.55ms med=129.26ms max=4.09s
p(90)=265.68ms p(95)=317.97ms
http_reqs..................: 35967 599.447696/s
iteration_duration.........: avg=166.69ms min=50.81ms med=139.54ms max=4.11s
p(90)=268.37ms p(95)=321.4ms
iterations.................: 35967 599.447696/s
vus........................: 100 min=100 max=100
vus_max....................: 100 min=100 max=100{code}
> Performance Issue with Pooled Connection Manager + Custom socket factory
> -------------------------------------------------------------------------
>
> Key: HTTPCLIENT-2007
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2007
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (classic)
> Affects Versions: 4.5.9
> Reporter: Venu Kemthur
> Priority: Major
>
> We are using HttpClient 4.5.9 to connect to a service which expects Client
> Cert (MTLS)
> Since we are using PoolingHttpClientConnectionManager, had to use the
> following mechanism to create and set a LayeredConnectionSocketFactory when
> instantiating PoolingHttpClientConnectionManager
> {code:java}
> ConnectionSocketFactory plainsf = <...>
> LayeredConnectionSocketFactory sslsf = <...>
> Registry<ConnectionSocketFactory> r =
> RegistryBuilder.<ConnectionSocketFactory>create()
> .register("http", plainsf)
> .register("https", sslsf)
> .build();
> HttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(r);
> HttpClients.custom()
> .setConnectionManager(cm)
> .build();{code}
> Tested this service with K6 load testing tool and see latency in seconds.
> Seems like it keeps growing from milliseconds (20ms) all the way to 8 seconds.
> K6 in a minute could only do 45 QPS with this latency.
> Sample run
> {code:java}
> data_received..............: 1.6 MB 27 kB/s
> data_sent..................: 6.9 MB 115 kB/s
> http_req_blocked...........: avg=8.92ms min=1µs med=3µs max=424.79ms
> p(90)=6µs p(95)=13µs
> http_req_connecting........: avg=1.42ms min=0s med=0s max=46.53ms p(90)=0s
> p(95)=0s
> http_req_duration..........: avg=2.1s min=57.25ms med=2.11s max=5.96s
> p(90)=4.1s p(95)=4.22s
> http_req_receiving.........: avg=71.79µs min=23µs med=55µs max=6.19ms
> p(90)=89µs p(95)=102µs
> http_req_sending...........: avg=25.37µs min=9µs med=20µs max=2.38ms
> p(90)=35µs p(95)=43µs
> http_req_tls_handshaking...: avg=7.49ms min=0s med=0s max=385.7ms p(90)=0s
> p(95)=0s
> http_req_waiting...........: avg=2.1s min=57.18ms med=2.11s max=5.96s
> p(90)=4.1s p(95)=4.22s
> http_reqs..................: 2721 45.349907/s
> iteration_duration.........: avg=2.11s min=64.04ms med=2.11s max=6.12s
> p(90)=4.11s p(95)=4.22s
> iterations.................: 2721 45.349907/s
> vus........................: 100 min=100 max=100
> vus_max....................: 100 min=100 max=100{code}
> Same code when replaced with JDK 11 HttpClient could do 600 QPS!
> We are using this client in other scenarios (non-MTLS) and we have no issues
> in that path.
> Is there a known issue with *Pooling Connection Manager*
> +*SSLConnectionSocketFactory*
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]