What components do you use for TiDB Server load balancing: HaProxy, ProxySQL, or others?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 请问大家都用什么组件做为TiDB Sever的负载均衡 HaProxy ProxySQL 还是其他的?

| username: breakyang

[TiDB Usage Environment] Production Environment
[TiDB Version] v7.1.0

| username: 裤衩儿飞上天 | Original post link

HAProxy

| username: breakyang | Original post link

Can HaProxy be deployed together with PD?

| username: breakyang | Original post link

If it’s Java, can the connector perform load balancing?

| username: 有猫万事足 | Original post link

The load on PD will be relatively high with only one instance. HAProxy doesn’t consume much resources, so it shouldn’t be a big problem.

The annoying thing about ProxySQL is that it is not content with just doing load balancing; it will check your SQL according to MySQL rules. SQL that originally ran without issues might be flagged by ProxySQL as problematic. When I used ProxySQL for load balancing before, it insisted that the character sets of two connection fields were inconsistent and reported an error. I checked for a long time and found that the character sets were unified, but I didn’t know how to solve it. I had to switch back to HAProxy.

If this issue can be resolved, ProxySQL has connection holding capabilities, so if one TiDB instance goes down, the client will be unaware. It should be better than HAProxy. There’s also TiProxy.

It’s an official product. There’s a demonstration video on Bilibili that looks good, but I haven’t tried it.

| username: zhanggame1 | Original post link

Using haproxy for testing, planning to use f5 in production.

| username: redgame | Original post link

HaProxy

| username: Kongdom | Original post link

haproxy + keepalived

| username: 大飞哥online | Original post link

Testing, pre-production KP
Production F5

| username: cassblanca | Original post link

Production F5 or Radware

| username: Billmay表妹 | Original post link

From @hey-hoho’s 专栏 - 这么多TiDB负载均衡方案总有一款适合你 | TiDB 社区

| username: charlesqing | Original post link

Theoretically, a Layer 4 proxy is relatively friendly to database applications.

| username: cy6301567 | Original post link

The standard configuration is haproxy + keepalived, right?

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.