Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb负载均衡如何实现
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 6.1.1
[Reproduction Path] How to achieve TiDB load balancing
[Encountered Problem: Problem Phenomenon and Impact] How to achieve TiDB load balancing
[Resource Configuration] Can OpenResty achieve load balancing?
[Attachment: Screenshot / Log / Monitoring]
You can use LB components like haproxy, or you can use the official LB TiProxy. Of course, using openresty for reverse proxy is also okay.
For software, use HAProxy; for hardware, use F5 and other load balancers.
nginx can indeed proxy like this.
Our approach is to add a layer of Haproxy reverse proxy in front of TIDB Serve. The application just needs to connect to Haproxy. You can refer to this.
Has TiProxy been officially released?
Not yet, but TiDB Cloud is available as a feature for external services.
Currently using HAProxy + Keepalived is quite effective.
I am also looking into this load balancing. I am not sure if the tidb-loadbalance client load balancing can be used in a production environment.
TiDB itself currently does not have a general tidb-server load balancing component. The official recommendation is to use third-party components for load balancing. Options include nginx or haproxy+keepalived or other LB tools, as long as they can distribute client traffic evenly to different tidb server nodes.
You can consider implementing it in hardware or software. The front-end application manually configures different nodes.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.