How to Calculate the Space Size of the /tmp/tidb Directory

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

Original topic: /tmp/tidb目录空间大小如何计算

| username: xingzhenxiang

[TiDB Usage Environment] Production Environment
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: How to calculate the space size of the /tmp/tidb directory]
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]

| username: Billmay表妹 | Original post link

To calculate the space size of the /tmp/tidb directory, you can use the following command:

du -sh /tmp/tidb

This command will display the total size of the /tmp/tidb directory in a human-readable format (e.g., GB, MB).

Additionally, if you want to see the size of each file or subdirectory under the /tmp/tidb directory, you can use the following command:

du -h /tmp/tidb

This command will recursively display the size of each file or subdirectory under the /tmp/tidb directory in a human-readable format.

| username: zhanggame1 | Original post link

I didn’t understand the requirements, please explain in more detail.

| username: forever | Original post link

Multiple machines can: tiup cluster exec mytidb --sudo --command “du -h /tmp/tidb”

| username: xingzhenxiang | Original post link

I saw on the official website that this directory affects fast indexing. Does this directory store temporary KV data, and if so, what percentage does it store?

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

Where did you see it? Is there a link?

| username: xingzhenxiang | Original post link

The image is not visible. Please provide the text you need translated.

| username: xingzhenxiang | Original post link

Artificial intelligence is so intelligent.

| username: Kongdom | Original post link

:rofl: Where did you see this command? I didn’t see it in the command list of tiup cluster.

It is actually hidden here:

| username: xingzhenxiang | Original post link

Don’t look at this directory information, how many GB do I need to configure?

| username: forever | Original post link

My notes were taken while watching the video.

| username: Kongdom | Original post link

I haven’t really paid attention to this, it’s all default settings.

I suggest changing the title, the current one can easily go off-topic. :rofl:

| username: xingzhenxiang | Original post link

Main issue, please focus on the main issue.

| username: Kongdom | Original post link

This should be referring to this directory, right?

| username: xingzhenxiang | Original post link

This, I feel like having a ratio would be better. Thank you.

| username: forever | Original post link

There is no standard for this either; it still depends on the business. Temporary storage for sorting and other tasks is also in this directory.

| username: xingzhenxiang | Original post link

So the official should explain it in more detail, or provide the percentage of the largest table.

| username: Kongdom | Original post link

:joy: I’ve never paid attention to this place, maybe my matters here aren’t significant enough.

| username: Kongdom | Original post link

:yum: You can make a request suggestion. I just submitted the one about the exec command, and it has already been reported.

| username: zhanggame1 | Original post link

The official documentation does not specify how large /tmp needs to be configured on TiDB.