Skip to content

test: enable TCP_NODELAY in SslEnd2EndTest - #93

Merged
elecharny merged 1 commit into
apache:2.2.Xfrom
ppkarwasz:test/ssl-end2end-tcp-nodelay
Nov 11, 2026
Merged

elecharny merged 1 commit into
apache:2.2.Xfrom
ppkarwasz:test/ssl-end2end-tcp-nodelay

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

SslEnd2EndTest (added in #77) takes about 11 minutes on Ubuntu runners but only about 9 seconds on Windows and macOS. In the latest 2.2.X run it accounts for 663 s of the 866 s spent in tests on Ubuntu, which pushes the Ubuntu jobs close to 15 minutes.

Cause

The test performs 2 × 4096 small echo round trips, and neither socket enables TCP_NODELAY. Nagle's algorithm then interacts with delayed ACKs (up to 40 ms on Linux), adding about 80 ms per round trip. Stack dumps show the main thread idle, waiting for the echo, not burning CPU.

Fix

Enable TCP_NODELAY on both the acceptor and the connector sessions in the test. Locally on Linux the class now runs in about 4 s instead of about 11 minutes.

This also unblocks the 15 minute job cap proposed in #58.

🤖 Generated with Claude Code

`SslEnd2EndTest` performs 8192 small echo round trips. Without `TCP_NODELAY`, Nagle's algorithm interacts with Linux delayed ACKs and adds about 80 ms to each round trip, so the test takes about 11 minutes on Ubuntu CI runners versus 9 seconds on Windows. With `TCP_NODELAY` it completes in about 4 seconds on Linux.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@elecharny
elecharny merged commit e8903ca into apache:2.2.X Nov 11, 2026
9 checks passed
@the-thing

Copy link
Copy Markdown
Member

https://github.com/apache/mina/actions/runs/43107600113/job/130814898000

Good stuff. I knew it would make a difference, but I didn't realize it would be that significant.

@elecharny

Copy link
Copy Markdown
Contributor

FTR, when I run the build on my Ubuntu machine, it takes 15 mins without the patch,; and only 4 mins with it.
Strange enough, on my Mac the build runs in 3mins only, even without the patch.

I frankly wonder what is the root cause on Ubuntu, there may be some Linux tuning that are different from Windows and BSD...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants