Can the number and size of TiDB slow logs be configured?

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

Original topic: tidb慢日志 slow log 可以配置份数和大小吗

| username: Holland

【TiDB Usage Environment】Production Environment
【TiDB Version】6.5.1
【Reproduction Path】Operations performed that led to the issue
【Encountered Issue: Issue Phenomenon and Impact】
Can the number and size of TiDB slow logs be configured?
【Resource Configuration】

| username: xfworld | Original post link

Try limiting it with this configuration

| username: Holland | Original post link

This seems to only be effective for TiDB’s own logs, not for slow logs.

| username: xfworld | Original post link

Currently, it can only be handled through shell scripts… :upside_down_face:

| username: Holland | Original post link

Okay.

| username: Holland | Original post link

There are more logs for TiFlash. Do these also need to be cleaned manually?

| username: db_user | Original post link

max-days applies to both tidb.log and slow logs simultaneously.

| username: Holland | Original post link

Oh, I see. Thank you.

| username: Holland | Original post link

What about the tiflash logs?

| username: db_user | Original post link

Try this, it looks like you have configured it, but it doesn’t seem to be working?

| username: Holland | Original post link

Yes, I configured it but it didn’t work. There are still a bunch of tiflash_tikv logs.

| username: db_user | Original post link

This is the configuration for tiflash_learner. I didn’t see any configuration for the number of logs. You can make a suggestion, but the official recommendation is not to modify the content below this.

In earlier versions, it seems that these two parameters could be set.


diag/tiflash.json at 83bcac492f1426212f8b550ed019d0e7c068b5dc · pingcap/diag (github.com)

If you have a test environment, you can verify it. Do not touch the production environment.

| username: Holland | Original post link

Okay.

| username: system | Original post link

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