GeezerVison is showing github.com — Severe throughput regression after upgrading Netty from 4.1.124.Final to 4.1.125.Final · Issue #15852 · netty/netty
Severe throughput regression after upgrading Netty from 4.1.124.Final to 4.1.125.Final #15852DescriptionI'm a developer of the Gravitee API Management platform and we recently observed that after upgrading Netty to version 4.1.125.Final throughput dropped to about 1,000 RPS, whereas with version 4.1.124.Final we achieved around 2,500 RPS. No other code was changed in our stack during the test
| Metric |
Netty 4.1.125.Final |
Netty 4.1.124.Final |
| Mean requests per second |
~1000 req/s |
~2 500 req/s |
| Response time (avg / p95 / p99) |
54.3 / 94.0 / 107 ms |
23.9 / 26.2 / 28.6 ms |
| Container CPU usage |
0.788 cores |
0.502 cores |
| CPU throttling |
0.796 |
0.00846 |
| Responses / errors |
100 % HTTP 200, no errors |
100 % HTTP 200, no errors |
Environment
- Application: Gravitee APIM Gateway
- Deployment: Kubernetes
- Test scenario: 150 backend connections, GET requests, 62 virtual users
- Netty versions compared:
- 4.1.124.Final (no issue)
- 4.1.125.Final (regression)
we investigated a bit and found two commits that could potentially cause this problem.
4.1.125.Final Diff 4.1.124.Final: netty-4.1.124.Final...netty-4.1.125.Final
- Prevent HTTP request/response smuggling via chunk encoding 39d3ecf
- fix for zip bomb style attack 34894ac
We suspect the second one causing issues.
Could you help us understand what might cause such a large throughput drop in 4.1.125.Final? Any suggestions on further instrumentation or configuration to pinpoint the issue would be appreciated. I can share more details if needed Activitynormanmaurer commented on Nov 13, 2025 Can you share flame graph before and after the upgrade ? This should give some ideas. Reacted by Francesco Nigro wbabyte commented on Nov 14, 2025 franz1981 commented on Nov 14, 2025 normanmaurer commented on Nov 14, 2025 @wbabyte please provide flame graphs as html files so we can easily open them Reacted by Francesco Nigro wbabyte commented on Nov 14, 2025 you can use https://github.com/google/pprof or go tool pprof java-gravitee-apim-gateway_process_after.pb and you will find a lot of other tools if needed
I converted pprof to svg and top table for you
after-top.txt
before-top.txt


if you need web page do this go tool pprof -http=localhost:8080 java-gravitee-apim-gateway_process_after.pb wbabyte commented on Nov 14, 2025 franz1981 commented on Nov 24, 2025 @wbabyte
I can see JdkZlibDecoder.decode is nearly not present in the before one
(left: before right: after)
 franz1981 commented on Nov 24, 2025 In any case FYI @vietj
Please open this on Vertx side @wbabyte as well franz1981 commented on Nov 24, 2025 I agree w @wbabyte
FYI @normanmaurer
Looks like we don't batch/buffer decoding anymore and that 34894ac has introduced (especially visible when so few cores are used) this effect franz1981 commented on Nov 24, 2025 I see, regardless, another problem @wbabyte which is more related vertx
|
protected ByteBuf prepareDecompressBuffer(ChannelHandlerContext ctx, ByteBuf buffer, int preferredSize) { |
is asking vertx to allocate the big byte[] arrays required for decoding, but sadly, Vertx allocator is disabling using heap pooled buffers (Vertx 5 has changed that default) - try what's introduced by eclipse-vertx/vert.x#5262
Since we batch less, we clearly have more networking activity, but you have an increased (likely) allocation activity which I cannot spot on the flamegraphs.
Next time, please, use async profiler as it is, raw, because I can see from the profiling data that is enabled, including allocation profiling, but since I cannot access its produced data, I cannot help there franz1981 commented on Nov 24, 2025 In addition @wbabyte any change can you provide a Netty only reproducer? this will make much easier to spot if is something which need to be addressed here on on Vertx; I'm not very used to JDK SSL decoding so I cannot tell for sure franz1981 commented on Nov 25, 2025 wbabyte commented on Nov 25, 2025 Thank you @franz1981 for review it, really appreciate it
I will check whether enabling pooled buffers or adding -Dvertx.reuseNettyAllocators=true can fix this issue and next time I will try using async profiler. I’ll get back to you with the results later this week Reacted by Francesco Nigro franz1981 commented on Dec 2, 2025 wbabyte commented on Dec 4, 2025 @franz1981 sorry for delay. We enabled heap pooled buffers and added -Dvertx.reuseNettyAllocators=true but it shows the same results with degraded throughput remibaptistegio commented on Feb 20, 2026 Have you had a chance to look at my test results yet @franz1981 ? franz1981 commented on Feb 20, 2026 Not yet! This is the last netty version? I remember others complained about something the zip changes re Vertx added 2 commits that reference this issue on Mar 17, 2026This issue will close once commit 648028b is merged into the '4.1' branch.648028b This issue will close once commit 6b9a45f is merged into the '4.1' branch.6b9a45f franz1981 commented on Mar 17, 2026 Reacted by remibaptistegio added 6 commits that reference this issue on Mar 18, 2026This issue will close once commit 6a2e2ee is merged into the '4.1' branch.6a2e2ee This issue will close once commit c596333 is merged into the '4.1' branch.c596333 This issue will close once commit 3193a1b is merged into the '4.1' branch.3193a1b This issue will close once commit 6b96bc1 is merged into the '4.1' branch.6b96bc1 This issue will close once commit dc3b872 is merged into the '4.1' branch.dc3b872 This issue will close once commit e978307 is merged into the '4.1' branch.e978307 franz1981 commented on Mar 25, 2026 @remibaptistegio can we go ahead and close it via #16510?
Let me know if apart from the actual test you can see an improvement in some staging of production please Reacted by remibaptistegio
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|