Questions about tiproxy

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

Original topic: tiproxy 疑问

| username: ShawnYan

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed that caused the issue
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

If multiple tiproxy instances are started (for example, 2 tiproxy instances), how can I know which one the current connection is using (tiproxy 1 or 2)?

8/28

Marking this

| username: h5n1 | Original post link

There is no VIP feature.

| username: 像风一样的男子 | Original post link

Looking at their old design documents, they were intended for multi-tenant use and resource isolation. They haven’t updated the documents, so it’s unclear what their future plans are.

| username: ShawnYan | Original post link

still in future work …

| username: redgame | Original post link

Boss, how do I check the source IP address of client connections?

| username: djshow832-PingCAP | Original post link

You can check the tiproxy logs for entries like [new connection] [connID=0] [client_addr=127.0.0.1:63187], and use the client_addr to find the client address.
If the proxy-protocol is not enabled, you can also use the show processlist command to see the host. The host here is the tiproxy address, because for TiDB, tiproxy is the client.
Currently, there are no other methods. Do you have any suggestions?

| username: djshow832-PingCAP | Original post link

After enabling proxy-protocol, use select host from information_schema.processlist where id=connection_id();

| username: ShawnYan | Original post link

This log is basically sufficient, but why doesn’t connID start from 1? It would be even better if the backend connID could be printed.

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

Awesome, it looks like the author himself is answering. :joy:

| username: djshow832-PingCAP | Original post link

This PR starts it from 1: proxy: use a real proxy conn id by xhebox · Pull Request #348 · pingcap/tiproxy · GitHub
The backend conn id can only be actively queried from the backend using select connection_id(), because the conn id sent to the client by TiDB during the handshake is truncated. There is an issue: Attach backend connection ID in the log · Issue #310 · pingcap/tiproxy · GitHub

| username: ShawnYan | Original post link

O(∩_∩)O haha, right~
The expert has personally come to the community~ :pray:

| username: ShawnYan | Original post link

Forgive me, it seems that both of these questions have been answered at `Connection id` always `100` · Issue #345 · pingcap/tiproxy · GitHub :sweat_smile:

| username: ShawnYan | Original post link

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