Skip to content

Support SO_REUSEPORT #13808

@SunRunAway

Description

@SunRunAway

Feature Request

Is your feature request related to a problem? Please describe:

Describe the feature you'd like:

Support SO_REUSEPORT for TiDB

After Linux version 3.9, TCP and UDP support for the SO_REUSEPORT socket option; that support was implemented in a series of patches by Tom Herbert. The new socket option allows multiple sockets on the same host to bind to the same port, and is intended to improve the performance of multithreaded network server applications running on top of multicore systems.

Benefits:

  1. For multicore systems, multiple instances of tidb-server can listen to a same port providing service. Here's a picture to demonstrate how it's working. Note that ports of the three instance is the same (4000), but the status port is not the same (for monitoring each instance).
  2. Support graceful upgrading if we have a supervisor process to manage all tidb-server instance in one machine.

Describe alternatives you've considered:

  1. tidb-ansible may need to be modified because it's waiting for the port of tidb-server listening to make sure the process is started. After supporting SO_REUSEPORT, each tidb-server on a same machine may be listening to a same port.

Teachability, Documentation, Adoption, Migration Strategy:

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/serverfeature/acceptedThis feature request is accepted by product managershelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.priority/P1The issue has P1 priority.type/feature-requestCategorizes issue or PR as related to a new feature.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions