apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.35k stars 2.1k forks source link

HTTPS requests using HC4 hang for 4-5 seconds when using IP's without reverse DNS under Windows #3038

Open asfimport opened 11 years ago

asfimport commented 11 years ago

Troels Liebe Bentsen (Bug 54449): When using HTTPClient4 with HTTPS, requests hangs for 4-5 seconds for each request when using IP's without reverse DNS, using the DNS names or adding the IP and DNS name to hosts file removes the delay. Also using HTTPClient3.1 instead seems to solve the issue.

I have added a plan that shows the issue.

Regards Troels

Created attachment http-hang-bug.jmx: Jmeter plan that shows the issue

http-hang-bug.jmx ````xml false false continue false 1 1 1 1358521659000 1358521659000 false 206.122.24.15 https GET true false true false false false saveConfig true true true true true true true false true true false false true false false false false false 0 true ````

Votes in Bugzilla: 2 Severity: minor OS: Windows XP

asfimport commented 11 years ago

Troels Liebe Bentsen (migrated from Bugzilla): Should note that this is on Windows 8

asfimport commented 11 years ago

Sebb (migrated from Bugzilla): Here is a stack dump during the pause:

"Thread Group 1-1" prio=6 tid=0x038f3c00 nid=0xd80 runnable [0x03b7f000] java.lang.Thread.State: RUNNABLE at java.net.Inet4AddressImpl.getHostByAddr(Native Method) at java.net.InetAddress$1.getHostByAddr(Unknown Source) at java.net.InetAddress.getHostFromNameService(Unknown Source) at java.net.InetAddress.getHostName(Unknown Source) at java.net.InetAddress.getHostName(Unknown Source) at sun.security.ssl.SSLSocketImpl.getHost(Unknown Source)

This will need further investigation.

asfimport commented 11 years ago

Sebb (migrated from Bugzilla): The stack dump was on WinXP using JMeter 2.8.

asfimport commented 11 years ago

@pmouawad (migrated from Bugzilla): Hello, What java version are you using ?

Regards

asfimport commented 11 years ago

Troels Liebe Bentsen (migrated from Bugzilla): C:\Users\TroelsLiebeBentsen>java -version java version "1.7.0_11" Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

asfimport commented 11 years ago

Sebb (migrated from Bugzilla): (In reply to comment 3)

The stack dump was on WinXP using JMeter 2.8.

2013/01/18 16:55:19 INFO - jmeter.JMeter: Version 2.8 r1393162 2013/01/18 16:55:19 INFO - jmeter.JMeter: java.version=1.7.0_11 2013/01/18 16:55:19 INFO - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM

asfimport commented 11 years ago

Sebb (migrated from Bugzilla): Using:

2013/01/18 17:25:52 INFO - jmeter.JMeter: Version 2.8 r1393162 2013/01/18 17:25:52 INFO - jmeter.JMeter: java.version=1.6.0_38 2013/01/18 17:25:52 INFO - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM 2013/01/18 17:25:52 INFO - jmeter.JMeter: os.name=Windows XP

I get similar results:

"Thread Group 1-1" prio=6 tid=0x03c4c400 nid=0x27c runnable [0x055ff000] java.lang.Thread.State: RUNNABLE at java.net.Inet4AddressImpl.getHostByAddr(Native Method) at java.net.InetAddress$1.getHostByAddr(InetAddress.java:852) at java.net.InetAddress.getHostFromNameService(InetAddress.java:532) at java.net.InetAddress.getHostName(InetAddress.java:475) at java.net.InetAddress.getHostName(InetAddress.java:447) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getHost(SSLSocketImpl.java:1971)

asfimport commented 11 years ago

@pmouawad (migrated from Bugzilla): I don't reproduce on Mac OSx: java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-10M3909) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

@sebb do you use the plan as is or do you point

@Troels Liebe Bentsen Is the IP in the test plan public ?

Thanks

asfimport commented 11 years ago

Sebb (migrated from Bugzilla): (In reply to comment 8)

I don't reproduce on Mac OSx: java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-10M3909) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

@sebb do you use the plan as is or do you point

Yes (except I unchecked "Follow redirects" - not relevant here)

@Troels Liebe Bentsen Is the IP in the test plan public ?

Thanks

asfimport commented 11 years ago

@pmouawad (migrated from Bugzilla): I reproduce on Windows 7 but not on Mac OS. Seems to affect Windows Family only.

Could be something related to this: http://www.velocityreviews.com/forums/showpost.php?p=2959030&postcount=8

asfimport commented 11 years ago

Sebb (migrated from Bugzilla): However the problem only affects HC4, not the HC3.1 or Java implementations.

So if it is a Windows issue, why is it being triggered by HC4 only?

I think it may be something to do with the way SSL verification is handled in HC4. Even though we use the HC4TrustAllSSLSocketFactory, it still invokes org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:91) which calls getSession, even though the session is not needed later.

I've not yet had a chance to try recoding to avoid this; if it is the cause then I think we may need to raise an enhancement request against HC4.

asfimport commented 11 years ago

@pmouawad (migrated from Bugzilla): I thought that:

asfimport commented 11 years ago

Hitesh (migrated from Bugzilla): Created attachment jmeter: Jmeter file for Mac OS x attached

jmeter ```` #! /bin/sh ## Licensed to the Apache Software Foundation (ASF) under one or more ## contributor license agreements. See the NOTICE file distributed with ## this work for additional information regarding copyright ownership. ## The ASF licenses this file to You under the Apache License, Version 2.0 ## (the "License"); you may not use this file except in compliance with ## the License. You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License. ## ============================================== ## Environment variables: ## JVM_ARGS - optional java args, e.g. -Dprop=val ## ## ============================================== # The following should be reasonably good values for most tests running # on Sun JVMs. Following is the analysis on which it is based. If it's total # gibberish to you, please study my article at # http://www.atg.com/portal/myatg/developer?paf_dm=full&paf_gear_id=1100010&detailArticle=true&id=9606 # # JMeter objects can generally be grouped into three life-length groups: # # - Per-sample objects (results, DOMs,...). An awful lot of those. # Life length of milliseconds to a few seconds. # # - Per-run objects (threads, listener data structures,...). Not that many # of those unless we use the table or tree listeners on heavy runs. # Life length of minutes to several hours, from creation to start of next run. # # - Per-work-session objects (test plans, GUIs,...). # Life length: for the life of the JVM. # This is the base heap size -- you may increase or decrease it to fit your # system's memory availablity: HEAP="-Xms2048m -Xmx2048m" # There's an awful lot of per-sample objects allocated during test run, so we # need a large eden to avoid too frequent scavenges -- you'll need to tune this # down proportionally if you reduce the HEAP values above: NEW="-XX:NewSize=256m -XX:MaxNewSize=256m" # This ratio and target have been proven OK in tests with a specially high # amount of per-sample objects (the HtmlParserHTMLParser tests): # SURVIVOR="-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50" # Think about it: trying to keep per-run objects in tenuring definitely # represents a cost, but where's the benefit? They won't disappear before # the test is over, and at that point we will no longer care about performance. # # So we will have JMeter do an explicit Full GC before starting a test run, # but then we won't make any effort (or spend any CPU) to keep objects # in tenuring longer than the life of per-sample objects -- which is hopefully # shorter than the period between two scavenges): # TENURING="-XX:MaxTenuringThreshold=2" # This evacuation ratio is OK (see the comments for SURVIVOR) during test # runs -- not so sure about operations that bring a lot of long-lived information into # memory in a short period of time, such as loading tests or listener data files. # Increase it if you experience OutOfMemory problems during those operations # without having gone through a lot of Full GC-ing just before the OOM: # EVACUATION="-XX:MaxLiveObjectEvacuationRatio=20%" # Avoid the RMI-induced Full GCs to run too frequently -- once every ten minutes # should be more than enough: RMIGC="-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000" # Increase MaxPermSize if you use a lot of Javascript in your Test Plan : PERM="-XX:PermSize=64m -XX:MaxPermSize=128m" # Finally, some tracing to help in case things go astray: #DEBUG="-verbose:gc -XX:+PrintTenuringDistribution" # Always dump on OOM (does not cost anything unless triggered) DUMP="-XX:+HeapDumpOnOutOfMemoryError" SERVER="-server" ARGS="$SERVER $DUMP $HEAP $NEW $SURVIVOR $TENURING $EVACUATION $RMIGC $PERM" java $ARGS $JVM_ARGS -jar "`dirname "$0"`/ApacheJMeter.jar" "$@" ````
asfimport commented 11 years ago

Sebb (migrated from Bugzilla): (In reply to comment 13)

Created attachment 30151 [details] Jmeter file for Mac OS x attached

Seems to be for a different bug report. Was this intended for https://github.com/apache/jmeter/issues/3092 ?

asfimport commented 11 years ago

@pmouawad (migrated from Bugzilla): Yes it's related to 54799

asfimport commented 10 years ago

Dzmitry Kashlach (migrated from Bugzilla): Failed to reproduce on Xubuntu 12.04 java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)

asfimport commented 10 years ago

@pmouawad (migrated from Bugzilla): Could this be an explanation:

asfimport commented 8 years ago

@pmouawad (migrated from Bugzilla): Anybody could test this bug on Windows again to see if it's still in 3.0 or current nightly ? Thanks