Search code examples
performancejmeterperformance-testingjmeter-pluginsjmeter-5.0

Why Jmeter tests take too much time to set up HTTPS TrustAll Socket Factory?


I have set up JMeter to run Performance tests with 8 threads which will have different test loads. I am running the test using non GUI mode.

When I start test for the first time in a day, I see in the log file that first thread get stuck at one line with message "Setting up HTTPS TrsutAll Socket Factory". It stays there around 8-10 minutes and then tests resume without any issues.

SCREENSHOT

Due to this I am not able to get accurate result for my first thread.

Am I missing something in JMeter set up ? Really appreciate your input. TIA.

I have also tried recording logs and added Java.net.debug=all in systems.properties but it was no help as I was not able to see any errors and tests will start executing in 8-10 mins.


Solution

  • This Setting up HTTPS TrustAll Socket Factory is something which should be done in milliseconds

    enter image description here

    As per SSL Encryption chapter of JMeter documentation

    The JMeter HTTP samplers are configured to accept all certificates, whether trusted or not, regardless of validity periods, etc. This is to allow the maximum flexibility in testing servers.

    so the message is about JMeter creating a special SSL Socket Factory which trusts all certificates (expired, missing certificate in chain, unknown issuer, etc.

    You can try:

    • Increase JMeter logging verbosity to DEBUG level, maybe you will see what JMeter is doing for such long period of time
    • If JMeter will be "stuck" or "hangs" - take a thread dump and see what exactly threads are doing and what exactly they're waiting for
    • Additionally you can use a profiler tool like YourKit or JProfiler - it will give you the most comprehensive information
    • if nothing helps you can just use Filter Results Tool to remove sample results for first 8-10 minutes of your test but it's rather a workaround than a solution