Blazemeter / jmeter-http2-plugin

HTTP2 plugin for Apache JMeter
Apache License 2.0
45 stars 27 forks source link

Direct buffer memory OOM when using http2 async controller #46

Closed serputko closed 8 months ago

serputko commented 1 year ago

General problem which appears in different usecases: When async controller is executed and there is no http2 connection yet or the connection is recreated, i see all the requests in controller include connection time, but the connection should be initiated only once. If there are many requests then is causes java.lang.OutOfMemoryError: Direct buffer memory. After OOM, everything is just wrecked and will not work properly

Jmeter props HTTP2Sampler.proxy_enabled=true HTTPSampler.response_timeout=240000 httpJettyClient.idleTimeout=300000 httpJettyClient.maxBufferSize=22214621 httpJettyClient.byteBufferPoolFactor=4 httpJettyClient.maxConnectionsPerDestination=100 httpJettyClient.maxRequestsPerConnection=200

jvm settings: -Xms1g -Xmx1g -XX:MaxMetaspaceSize=128M -XX:MaxDirectMemorySize=500M

Examples: Usecase 1 Thread Group - failing 32+ requests in async controller if more than 31 requests in http2 controller, all of them are failed Log contains java.lang.OutOfMemoryError: Direct buffer memory for the first iteration and “Pipelined requests not supported” for 2+ iterations Note that on second iteration of thread group first request from http2 controller is successful but is using http1 Click or press enter to display {:filename} in the image preview If reduce requests to 30-31 all are successful Click or press enter to display {:filename} in the image preview

Usecase 1.2 Thread Group - success 32+ requests in async controller if move 1 request before async controller In Usecase 1 all the requests have connect time in them, but I would expect to see connection only in first one, as we establish only 1 connection In Usecase 1 with 32+ failing requests in async controller, if we move 1 http2 request out of async controller, so it’s establishing connection, then all 32+, or in Usecase 1.2 ~80 requests are executed successfully without errors Click or press enter to display {:filename} in the image preview

Usecase 1.4 Thread Group - success 500 requests in async controller, 1 request before async controller Added 500 requests into async controller, part of requests are successful, another part is failed with java.lang.OutOfMemoryError: Direct buffer memory Click or press enter to display {:filename} in the image preview In Charles everything is fine, after 200 requests(httpJettyClient.maxRequestsPerConnection=200) new connection if opened, but again, plugin tries to open the connection with 300 requests, I see connect time in all of them, and the same as in “Usecase 1 Thread Group - failing 32+ requests in async controller”, it fails with direct buffer error Click or press enter to display {:filename} in the image preview

So we need to make plugin handle connection with 1 request and not cause direct buffer OOM on connection initiation or recreation

serputko commented 1 year ago

Shared screenshots and demo scenario in pm

3dgiordano commented 10 months ago

Hi @serputko

Final release of version 2.0.3 was done today. https://github.com/Blazemeter/jmeter-http2-plugin/releases/tag/v2.0.3

Soon it will be available in JMeter Plugins Manager.

serputko commented 10 months ago

🥳🥳

вт, 29 серп. 2023 р. о 05:18 David @.***> пише:

Hi @serputko https://github.com/serputko

Final release of version 2.0.3 was done today. https://github.com/Blazemeter/jmeter-http2-plugin/releases/tag/v2.0.3

Soon it will be available in JMeter Plugins Manager.

— Reply to this email directly, view it on GitHub https://github.com/Blazemeter/jmeter-http2-plugin/issues/46#issuecomment-1697332976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4NUWQYGBZL6LQHCSER2C3XXXMZLANCNFSM6AAAAAAXJ7FBSM . You are receiving this because you were mentioned.Message ID: @.***>

3dgiordano commented 8 months ago

Hi @serputko

This issue related to direct memory OOM is closed based on the fixes and alternatives to the problem proposed in version 2.0.3 If the issue was not resolved in that version, you can reopen the issue or create a new one.