Skip to content

Improve test suite by disabling Nagle's algorithm on test sockets - #81

Merged
clue merged 1 commit into
ratchetphp:masterfrom
clue-labs:tcp-nodelay
Aug 6, 2026
Merged

Improve test suite by disabling Nagle's algorithm on test sockets#81
clue merged 1 commit into
ratchetphp:masterfrom
clue-labs:tcp-nodelay

Conversation

@clue

@clue clue commented Aug 1, 2026

Copy link
Copy Markdown
Member

This changeset improves the test suite by disabling Nagle's algorithm on the sockets used by the Autobahn test runners. Its compression test cases send a thousand messages each, and on PHP 7.4 every message larger than 8 KiB adds around 40 ms. This looks like the final segment being held back until the peer acknowledges the previous data, although this has not been confirmed at the packet level. Newer PHP versions are unaffected.

On CI this brings the PHP 7.4 job in line with the others and changes the slowest job from around 31 min to around 15 min. All 517 Autobahn test cases still run on every supported PHP version in both client and server mode and report the same results as before.

Refs #59 and #62

@clue clue added this to the 0.4.2 milestone Aug 1, 2026
@clue
clue requested a review from Copilot August 1, 2026 21:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the Autobahn-based test runners by disabling Nagle’s algorithm (enabling TCP_NODELAY) on the ReactPHP sockets used by the client and server test harnesses, aiming to reduce latency and speed up CI execution—especially on PHP 7.4.

Changes:

  • Configure the Autobahn echo server socket to use tcp_nodelay.
  • Configure the Autobahn client connector sockets to use tcp_nodelay.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/ab/startServer.php Adds TCP_NODELAY to the React socket server used by the Autobahn server runner.
tests/ab/clientRunner.php Adds TCP_NODELAY to the React socket connector used by the Autobahn client runner.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@clue
clue merged commit eff209f into ratchetphp:master Aug 6, 2026
14 checks passed
@clue
clue deleted the tcp-nodelay branch August 6, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants