# `Dumpling` Performance Optimization

__*Dumpling performance optimization*__
__*Dumpling -t*__
__*dumpling -r*__

+ Option **`-t`** is used to specify the number of threads to export. 
  + It increases `Dumpling` concurrency, but it also increases database memory consumption
+ Option **`-r`** specifies the maximum number of records in a single file, or rows
  + When enabled, `Dumpling` will enable intra-table concurrency, thus improve the speed of exporting large tables

-------------------------------------------------------------
By default, exported files are stored in `./export-{current_local_time}` directory. The commonly used options are as follows:
- `-t` is used to specify the number of threads to export. Increasing the number of threads increases dumpling concurrency and increases export speed, but it also increases database memory consumption, so it is not advisable to set it too large. Usually, it's less than 64.

- `-r` option specifies the maximum number of records in a single file. When enabled, `dumpling` will enable intra-table concurrency, improving the speed of exporting large tables. When the upstream is `TiDB` and the version is `v3.0` or later, the parameter greater than 0 indicates that the `TiDB` region information is used to divide the concurrency in the table, and the specific value will no longer be valid.

The `—-compress gzip` option can be used to compress the exported data. Compression can significantly reduce the size of the exported data, and can be used to speed up the export if the storage does not have enough write `I/O` bandwidth. However, this option has the side effect of increasing `CPU` consumption because it compresses each file separately.

The above options can be used to speed up the export of `Dumpling`.
