Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16277

tcp_nodelay session variable to enable / disable Nagle algorithm

    XMLWordPrintable

Details

    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.

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.