component/serverfeature/acceptedhelp wantedpriority/P1type/feature-request
描述
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:
- 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).
- Support graceful upgrading if we have a supervisor process to manage all tidb-server instance in one machine.
Describe alternatives you've considered:
tidb-ansiblemay need to be modified because it's waiting for the port oftidb-serverlistening to make sure the process is started. After supporting SO_REUSEPORT, eachtidb-serveron a same machine may be listening to a same port.
Teachability, Documentation, Adoption, Migration Strategy: