Is memory shared when deploying TiDB in cluster mode and accessing it with a client?

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

Original topic: TiDB集群模式部署,客户端访问的时候内存是共享的吗

| username: TiDBer_kYCVcT6K

When deploying TiDB in cluster mode with 5 TiDB Servers, and using the MySQL client to execute SQL, due to the large amount of data, memory resource shortages often occur. Upon inspection, it was found that in client mode, only the memory of a single TiDB Server is used, not the entire cluster’s memory. How can this be resolved?

| username: 啦啦啦啦啦 | Original post link

Is it a single SQL statement that is consuming a lot of memory?

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

Memory between TiDB instances is not shared.

To achieve this, you need to handle sharding on the client side, send multiple SQL queries, and then aggregate the results.

If you don’t want to modify the SQL, then you can only increase the memory used by TiDB. If you’re lucky and the operators used support spilling intermediate results to disk, then enable this feature. This way, the computation will be slower, but it should eventually produce results.

| username: zhanggame1 | Original post link

The client uses the memory of the TiDB node it is connected to and does not use the memory of other nodes.

| username: Hacker007 | Original post link

Do not share; whichever node is assigned will be responsible for processing.

| username: linnana | Original post link

You can paginate the query results.

| username: redgame | Original post link

Indeed, only one can be used.

| username: Anna | Original post link

Memory between TiDB instances is not shared. It can be sharded.

| username: TiDBer_kYCVcT6K | Original post link

Thank you, everyone.

| username: system | Original post link

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