[MDEV-16277] tcp_nodelay session variable to enable / disable Nagle algorithm Created: 2018-05-23  Updated: 2018-08-28  Resolved: 2018-08-14

Status: Closed
Project: MariaDB Server
Component/s: Server
Fix Version/s: 10.4.0

Type: Task Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: jdbc

Issue Links:
Relates
relates to CONJ-638 enabling nagle algorithm server side ... Closed

 Description   

Our JDBC driver implements technique called protocol pipelining, which is sends multiple (N) requests at once (they can be normal query COM_QUERY, COM_STMT_EXECUTE, and mix of those ), and only then waits for N responses to come back.

Both normal statements and prepared statements can be batched. This , according to JDBC spec is only used for updates statements.

JDBC driver optimizes sending on its part, however server could help to further optimize the pipelining. The problem is that server does not use TCP efficiently in this case, and (since it unconditionally disables Nagle algorithm), packs a lot (tens of thousands) tiny OK packets into large TCP segments.

The task is to make Nagle possible again, via a session variable. client would add 2 COM_QUERY packets to batch, "set session tcp_nodelay=0" prepends the batch, and "set session tcp_nodelay=1" at the end, optimizing TCP communication.


Generated at Thu Feb 08 08:27:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.