Slow Logical Import Speed in Lightning

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

Original topic: Lightning 逻辑导入速度慢

| username: sgjr

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 6.1.6
[Reproduction Path] Operations performed that led to the issue
[Encountered Issue: Issue Phenomenon and Impact]
Using Lightning to import a logical backup of a large table, the logical backup file size is 1.5T, and the import speed is very slow, approximately 13MB~17MB/s. Adjusting the following parameters did not significantly change the speed:


The CPU load on the TiKV nodes is around 50%, and the CPU load on the Lightning machine is around 20%. Is there any way to speed up the import?

[Resource Configuration]
Lightning machine: 8C/16G
TiDB-server: 6C / 36G * 3
TiKV-server: 9C / 90G * 5

[Attachments: Screenshots/Logs/Monitoring]

| username: 胡杨树旁 | Original post link

How about trying parallelism in physical import mode?

| username: Anna | Original post link

| username: Anna | Original post link

| username: sgjr | Original post link

Using a logical backup exported by Dumpling, physical import is not possible.

| username: redgame | Original post link

For non-production, you can try:
tidb-lightning-ctl --config tidb-lightning.toml --fetch-mode

| username: sgjr | Original post link

  • Setting region-concurrency to 75% of the CPU results in slower performance. Currently, an 8-core Lightning machine set to 32 performs faster, with a low machine load and 20% CPU usage.
  • The recommended file size in the documentation is 256M, but ours is 55M, so there shouldn’t be an issue with file size.
  • The other two cannot be verified at the moment.
| username: sgjr | Original post link

Production environment

| username: 我是咖啡哥 | Original post link

Logical import, that is, executing SQL, especially when there are few tables, just one large table, doesn’t seem to have a good solution.

| username: system | Original post link

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