Skip to content

Disable Nagle's Algorithm #921

@bgrainger

Description

@bgrainger

According to https://en.wikipedia.org/wiki/Nagle%27s_algorithm:

In general, since Nagle's algorithm is only a defense against careless applications, it will not benefit a carefully written application that takes proper care of buffering; the algorithm has either no effect, or negative effect on the application.

Since MySqlConnector does buffer writes (it has to know the length of the data that will be transmitted in order to create the MySQL packet header), it seems that Nagle's Algorithm is unnecessary, and possibly harmful.

It may be beneficial to set SocketOptionName.NoDelay on the socket opened by the client, in case the server is using delayed ACKs?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions