- WAL_FSYNC_PERIOD: specifies the interval (in milliseconds) at which data is written from the WAL to disk. This parameter takes effect only when the WAL parameter is set to 2. The default value is 3000. Enter a value between 0 and 180000. The value 0 indicates that incoming data is immediately written to disk.
- MAXROWS: specifies the maximum number of rows recorded in a block. The default value is 4096.
- MINROWS: specifies the minimum number of rows recorded in a block. The default value is 100.
- KEEP: specifies the time for which data is retained. Enter a value between 1 and 365000. The default value is 3650. The value of the KEEP parameter must be greater than or equal to the value of the DURATION parameter. TDengine automatically deletes data that is older than the value of the KEEP parameter. You can use m (minutes), h (hours), and d (days) as the unit, for example KEEP 100h or KEEP 10d. If you do not include a unit, d is used by default. The official version supports multi-tier storage, corresponding to multiple KEEP values(comma separated and up to 3 values keep0,keep1,keep2, and meet keep0 <= keep1 <= keep2, e.g. KEEP 100h,100d,3650d); the community version does not support multi-tier storage(although multiple keep values are configured, they do not take effect, only the maximum keep value is used as KEEP).
- KEEP: specifies the time for which data is retained. Enter a value between 1 and 365000. The default value is 3650. The value of the KEEP parameter must be greater than or equal to the value of the DURATION parameter. TDengine automatically deletes data that is older than the value of the KEEP parameter. You can use m (minutes), h (hours), and d (days) as the unit, for example KEEP 100h or KEEP 10d. If you do not include a unit, d is used by default. The official version supports [multi-tier storage](https://docs.tdengine.com/reference/config/#datadir), corresponding to multiple KEEP values(comma separated and up to 3 values keep0,keep1,keep2 supported, and meet keep0 <= keep1 <= keep2, e.g. KEEP 100h,100d,3650d); the community version does not support multi-tier storage(although multiple keep values are configured, they do not take effect, only the maximum keep value is used as KEEP).
- PAGES: specifies the number of pages in the metadata storage engine cache on each vnode. Enter a value greater than or equal to 64. The default value is 256. The space occupied by metadata storage on each vnode is equal to the product of the values of the PAGESIZE and PAGES parameters. The space occupied by default is 1 MB.
- PAGESIZE: specifies the size (in KB) of each page in the metadata storage engine cache on each vnode. The default value is 4. Enter a value between 1 and 16384.
- PRECISION: specifies the precision at which a database records timestamps. Enter ms for milliseconds, us for microseconds, or ns for nanoseconds. The default value is ms.
@@ -314,6 +314,32 @@ The charset that takes effect is UTF-8.
| Applicable | Server Only |
| Meaning | All data files are stored in this directory |
| Default Value | /var/lib/taos |
```
The official version supports multi-tier storage (need to cooperate with [KEEP parameter](https://docs.tdengine.com/taos-sql/database/#create-a-database)). The configuration method is as follows.
The multi-tier storage directory is configured through dataDir, the format is: dataDir [path] <level> <primary>
dataDir: Configuration items in the configuration file (taos.cfg)
path: the directory to mount (cannot be omitted)
level: mount level, the value is 0, 1 or 2, if omitted, the default is 0. Up to 3 levels are supported, and each level supports up to 16 mount points, so a maximum of 48 mount points are supported.
primary: whether it is the primary mount point, 0 (no) or 1 (yes), the default is 1. The primary mount point is only allowed at level 0, and only one primary mount point is allowed (level=0, primary=1).
Here is a normal configuration (3 storage tiers, each with 3 mount points):
Data directory /mnt/data01 0 1
Data directory /mnt/data02 0 0
Data directory /mnt/data03 0 0
Data directory /mnt/data10 1 0
Data directory /mnt/data11 1 0
Data directory /mnt/data12 1 0
Data directory /mnt/data20 2 0
Data directory /mnt/data21 2 0
Data directory /mnt/data22 2 0
The community version does not support multi-tier storage, and the following three configurations are acceptable: