index.md 60.9 KB
Newer Older
D
dingbo 已提交
1
---
2 3 4
sidebar_label: Configuration
title: Configuration Parameters
description: "Configuration parameters for client and server in TDengine"
D
dingbo 已提交
5 6
---

7
In this chapter, all the configuration parameters on both server and client side are described thoroughly.
D
dingbo 已提交
8

9
## Configuration File on Server Side
D
dingbo 已提交
10

11 12 13
On the server side, the actual service of TDengine is provided by an executable `taosd` whose parameters can be configured in file `taos.cfg` to meet the requirements of different use cases. The default location of `taos.cfg` is `/etc/taos`, but can be changed by using `-c` parameter on the CLI of `taosd`. For example, the configuration file can be put under `/home/user` and used like below

```bash
D
dingbo 已提交
14 15 16
taosd -c /home/user
```

17
Parameter `-C` can be used on the CLI of `taosd` to show its configuration, like below:
D
dingbo 已提交
18 19 20 21 22

```
taosd -C
```

23
## Configuration File on Client Side
D
dingbo 已提交
24

25
TDengine CLI `taos` is the tool for users to interact with TDengine. It can share same configuration file as `taosd` or use a separate configuration file. When launching `taos`, parameter `-c` can be used to specify the location where its configuration file is. For example `taos -c /home/cfg` means `/home/cfg/taos.cfg` will be used. If `-c` is not used, the default location of the configuration file is `/etc/taos`. For more details please use `taos --help` to get.
D
dingbo 已提交
26

27
From version 2.0.10.0 below commands can be used to show the configuration parameters of the client side.
D
dingbo 已提交
28 29 30 31 32 33 34 35 36

```bash
taos -C
```

```bash
taos --dump-config
```

37
# Configuration Parameters
D
dingbo 已提交
38 39

:::note
40
`taosd` needs to be restarted for the parameters changed in the configuration file to take effect.
D
dingbo 已提交
41 42 43

:::

44
## Connection Parameters
D
dingbo 已提交
45 46 47

### firstEp

48 49 50 51 52
| Attribute     | Description                                                                                          |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| Applicable    | Server and Client                                                                                    |
| Meaning       | The end point of the first dnode in the cluster to be connected to when `taosd` or `taos` is started |
| Default Value | localhost:6030                                                                                       |
D
dingbo 已提交
53 54 55

### secondEp

56 57 58 59 60
| Attribute     | Description                                                                                                            |
| ------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server and Client                                                                                                      |
| Meaning       | The end point of the second dnode to be connected to if the firstEp is not available when `taosd` or `taos` is started |
| Default Value | None                                                                                                                   |
D
dingbo 已提交
61 62 63

### fqdn

64 65 66 67 68 69
| Attribute     | Description                                                              |
| ------------- | ------------------------------------------------------------------------ |
| Applicable    | Server Only                                                              |
| Meaning       | The FQDN of the host where `taosd` will be started. It can be IP address |
| Default Value | The first hostname configured for the hos                                |
| Note          | It should be within 96 bytes                                             |
D
dingbo 已提交
70 71 72

### serverPort

73 74 75 76 77 78
| Attribute     | Description                                                                                                                     |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                                                     |
| Meaning       | The port for external access after `taosd` is started 号                                                                        |
| Default Value | 6030                                                                                                                            |
| Note          | REST service is provided by `taosd` before 2.4.0.0 but by `taosAdapter` after 2.4.0.0, the default port of REST service is 6041 |
D
dingbo 已提交
79 80

:::note
81 82
TDengine uses continuous 13 ports, both TCP and TCP, from the port specified by `serverPort`. These ports need to be kept as open if firewall is enabled. Below table describes the ports used by TDengine in details.

D
dingbo 已提交
83
:::
84 85 86 87 88 89 90 91 92 93 94 95 96 97

| Protocol | Default Port | Description                                      | How to configure                                                                               |
| :------- | :----------- | :----------------------------------------------- | :--------------------------------------------------------------------------------------------- |
| TCP      | 6030         | Communication between client and server          | serverPort                                                                                     |
| TCP      | 6035         | Communication among server nodes in cluster      | serverPort+5                                                                                   |
| TCP      | 6040         | Data syncup among server nodes in cluster        | serverPort+10                                                                                  |
| TCP      | 6041         | REST connection between client and server        | Prior to 2.4.0.0: serverPort+11; After 2.4.0.0 refer to [taosAdapter](/reference/taosadapter/) |
| TCP      | 6042         | Service Port of Arbitrator                       | The parameter of Arbitrator                                                                    |
| TCP      | 6043         | Service Port of TaosKeeper                       | The parameter of TaosKeeper                                                                    |
| TCP      | 6044         | Data access port for StatsD                      | efer to [taosAdapter](/reference/taosadapter/)                                                 |
| UDP      | 6045         | Data access for statsd                           | efer to [taosAdapter](/reference/taosadapter/)                                                 |
| TCP      | 6060         | Port of Monitoring Service in Enterprise version |                                                                                                |
| UDP      | 6030-6034    | Communication between client and server          | serverPort                                                                                     |
| UDP      | 6035-6039    | Communication among server nodes in cluster      | serverPort                                                                                     |
D
dingbo 已提交
98 99 100

### maxShellConns

101 102 103 104 105 106
| Attribute     | Description                                          |
| ------------- | ---------------------------------------------------- |
| Applicable    | Server Only                                          |
| Meaning       | The maximum number of connections a dnode can accept |
| Value Range   | 10-50000000                                          |
| Default Value | 5000                                                 |
D
dingbo 已提交
107 108 109

### maxConnections

110 111 112 113 114 115 116
| Attribute     | Description                                                                   |
| ------------- | ----------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                   |
| Meaning       | The maximum number of connections allowed by a database                       |
| Value Range   | 1-100000                                                                      |
| Default Value | 5000                                                                          |
| Note          | The maximum number of worker threads on the client side is maxConnections/100 |
D
dingbo 已提交
117 118 119

### rpcForceTcp

120 121 122 123 124 125 126
| Attribute     | Description                                                         |
| ------------- | ------------------------------------------------------------------- |
| Applicable    | Server and Client                                                   |
| Meaning       | TCP is used forcely                                                 |
| Value Range   | 0: disabled 1: enabled                                              |
| Default Value | 0                                                                   |
| Note          | It's suggested to configure to enable if network is not good enough |
D
dingbo 已提交
127

128
## Monitoring Parameters
D
dingbo 已提交
129 130 131

### monitor

132 133 134 135 136 137
| Attribute     | Description                                                                                                                                                                         |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                                                                                                         |
| Meaning       | The switch for monitoring inside server. The workload of the hosts, including CPU, memory, disk, network, TTP requests, are collected and stored in a system builtin database `LOG` |
| Value Range   | 0: monitoring disabled, 1: monitoring enabled 务.                                                                                                                                   |
| Default Value | 0                                                                                                                                                                                   |
D
dingbo 已提交
138 139 140

### monitorInterval

141 142 143 144 145 146 147
| Attribute     | Description                                |
| ------------- | ------------------------------------------ |
| Applicable    | Server Only                                |
| Meaning       | The interval of collecting system workload |
| Unit          | second                                     |
| Value Range   | 1-600                                      |
| Default Value | 30                                         |
D
dingbo 已提交
148 149 150

### telemetryReporting

151 152 153 154 155 156
| Attribute     | Description                                                                  |
| ------------- | ---------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                  |
| Meaning       | Switch for allowing TDengine to collect and report service usage information |
| Value Range   | 0: Not allowed; 1: Allowed                                                   |
| Default Value | 1                                                                            |
D
dingbo 已提交
157

158
## Query Parameters
D
dingbo 已提交
159 160 161

### queryBufferSize

162 163 164 165 166 167 168
| Attribute     | Description                                                                             |
| ------------- | --------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                             |
| Meaning       | The total memory size reserved for all queries                                          |
| Unit          | MB                                                                                      |
| Default Value | 无                                                                                      |
| Note          | It can be estimated by "maximum number of concurrent quries" _ "number of tables" _ 170 |
D
dingbo 已提交
169 170 171

### ratioOfQueryCores

172 173 174 175 176 177
| Attribute     | Description                                                                                           |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                           |
| Meaning       | Maximum number of query threads                                                                       |
| Default Value | 1                                                                                                     |
| Note          | value range: float number between [0, 2] 0: only 1 query thread; >0: the times of the number of cores |
D
dingbo 已提交
178 179 180

### maxNumOfDistinctRes

181 182 183 184 185 186 187
| Attribute     | Description                                  |
| ------------- | -------------------------------------------- |
| Applicable    | Server Only                                  |
| Meaning       | The maximum number of distinct rows returned |
| Value Range   | [100,000 - 100, 000, 000]                    |
| Default Value | 100, 000                                     |
| Note          | After version 2.3.0.0                        |
D
dingbo 已提交
188

189
## Locale Parameters
D
dingbo 已提交
190 191 192

### timezone

193 194 195 196 197
| Attribute     | Description                     |
| ------------- | ------------------------------- |
| Applicable    | Server and Client               |
| Meaning       | TimeZone                        |
| Default Value | TimeZone configured in the host |
D
dingbo 已提交
198 199

:::info
200
To handle the data insertion and data query from multiple timezones, Unix Timestamp is used and stored TDengie. The timestamp generated from any timezones at same time is same in Unix timestamp. To make sure the time on client side can be converted to Unix timestamp correctly, the timezone must be set properly.
D
dingbo 已提交
201

202
On Linux system, TDengine clients automatically obtain timezone from the host. Alternatively, the timezone can be configured explicitly in configuration file `taos.cfg` like below.
D
dingbo 已提交
203

204 205 206 207 208
```
timezone UTC-8
timezone GMT-8
timezone Asia/Shanghai
```
D
dingbo 已提交
209

210
The above examples are all proper configuration for the timezone of UTC+8. On Windows system, however, `timezone Asia/Shanghai` is not supported, it must be set as `timezone UTC-8`.
D
dingbo 已提交
211

212
The setting for timezone impacts the strings not in Unix timestamp, keywords or functions related to date/time, for example
D
dingbo 已提交
213

214 215 216
```sql
SELECT count(*) FROM table_name WHERE TS<'2019-04-11 12:01:08';
```
D
dingbo 已提交
217

218
If the timezone is UTC+8, the above SQL statement is equal to:
D
dingbo 已提交
219

220 221 222
```sql
SELECT count(*) FROM table_name WHERE TS<1554955268000;
```
D
dingbo 已提交
223

224
If the timezone is UTC, it's equal to
D
dingbo 已提交
225

226 227 228
```sql
SELECT count(*) FROM table_name WHERE TS<1554984068000;
```
D
dingbo 已提交
229

230
To avoid the problems of using time strings, Unix timestamp can be used directly. Furthermore, time strings with timezone can be used in SQL statement, for example "2013-04-12T15:52:01.123+08:00" in RFC3339 format or "2013-04-12T15:52:01.123+0800" in ISO-8601 format, they are not influenced by timezone setting when converted to Unix timestamp.
D
dingbo 已提交
231 232 233 234 235

:::

### locale

236 237 238 239 240
| Attribute     | Description               |
| ------------- | ------------------------- |
| Applicable    | Server and Client         |
| Meaning       | Location code             |
| Default Value | Locale configured in host |
D
dingbo 已提交
241 242

:::info
243
A specific type "nchar" is provied in TDengine to store non-ASCII characters such as Chinese, Japanese, Korean. The characters to be stored in nchar type are firstly encoded in UCS4-LE before sending to server side. To store non-ASCII characters correctly, the encoding format of the client side needs to be set properly.
D
dingbo 已提交
244

245
The characters input on the client side are encoded using the default system encoding, which is UTF-8 on Linux, or GB18030 or GBK on some systems in Chinese, POSIX in docker, CP936 on Windows in Chinese. The encoding of the operating system in use must be set correctly so that the characters in nchar type can be converted to UCS4-LE.
D
dingbo 已提交
246

247
The locale definition standard on Linux is: <Language\>\_<Region\>.<charset\>, for example, in "zh_CN.UTF-8", "zh" means Chinese, "CN" means China mainland, "UTF-8" means charset. On Linux andMac OSX, the charset can be set by locale in the system. On Windows system another configuration parameter `charset` must be used to configure charset because the locale used on Windows is not POSIX standard. Of course, `charset` can also be used on Linux to specify the charset.
D
dingbo 已提交
248 249 250 251 252

:::

### charset

253 254 255 256 257
| Attribute     | Description                  |
| ------------- | ---------------------------- |
| Applicable    | Server and Client            |
| Meaning       | Character                    |
| Default Value | charset set in the system 系 |
D
dingbo 已提交
258 259

:::info
260
On Linux, if `charset` is not set in `taos.cfg`, when `taos` is started, the charset is obtained from system locale. If obtaining charset from system locale fails, `taos` would fail to start. So on Linux system, if system locale is set properly, it's not necessary to set `charset` in `taos.cfg`. For example:
D
dingbo 已提交
261

262 263 264
```
locale zh_CN.UTF-8
```
D
dingbo 已提交
265

266
Besides, on Linux system, if the charset contained in `locale` is not consistent with that set by `charset`, the one who comes later in the configuration file is used.
D
dingbo 已提交
267

268 269 270 271
```title="Effective charset is GBK"
locale zh_CN.UTF-8
charset GBK
```
D
dingbo 已提交
272

273 274 275 276
```title="Effective charset is UTF-8"
charset GBK
locale zh_CN.UTF-8
```
D
dingbo 已提交
277

278
On Windows system, it's not possible to obtain charset from system locale. If it's not set in configuration file `taos.cfg`, it would be default to CP936, same as set as below in `taos.cfg`. For example
D
dingbo 已提交
279

280 281 282
```
charset CP936
```
D
dingbo 已提交
283 284 285

:::

286
## Storage Parameters
D
dingbo 已提交
287 288 289

### dataDir

290 291 292 293 294
| Attribute     | Description                                 |
| ------------- | ------------------------------------------- |
| Applicable    | Server Only                                 |
| Meaning       | All data files are stored in this directory |
| Default Value | /var/lib/taos                               |
D
dingbo 已提交
295 296 297

### cache

298 299 300 301 302 303
| Attribute     | Description                   |
| ------------- | ----------------------------- |
| Applicable    | Server Only                   |
| Meaning       | The size of each memory block |
| Unit          | MB                            |
| Default Value | 16                            |
D
dingbo 已提交
304 305 306

### blocks

307 308 309 310 311
| Attribute     | Description                                                    |
| ------------- | -------------------------------------------------------------- |
| Applicable    | Server Only                                                    |
| Meaning       | The number of memory blocks of size `cache` used by each vnode |
| Default Value | 6                                                              |
D
dingbo 已提交
312 313 314

### days

315 316 317 318 319 320
| Attribute     | Description                                           |
| ------------- | ----------------------------------------------------- |
| Applicable    | Server Only                                           |
| Meaning       | The time range of the data stored in single data file |
| Unit          | day                                                   |
| Default Value | 10                                                    |
D
dingbo 已提交
321 322 323

### keep

324 325 326 327 328 329
| Attribute     | Description                            |
| ------------- | -------------------------------------- |
| Applicable    | Server Only                            |
| Meaning       | The number of days for data to be kept |
| Unit          | day                                    |
| Default Value | 3650                                   |
D
dingbo 已提交
330 331 332

### minRows

333 334 335 336 337
| Attribute     | Description                                |
| ------------- | ------------------------------------------ |
| Applicable    | Server Only                                |
| Meaning       | minimum number of rows in single data file |
| Default Value | 100                                        |
D
dingbo 已提交
338 339 340

### maxRows

341 342 343 344 345
| Attribute     | Description                                |
| ------------- | ------------------------------------------ |
| Applicable    | Server Only                                |
| Meaning       | maximum number of rows in single data file |
| Default Value | 4096                                       |
D
dingbo 已提交
346 347 348

### walLevel

349 350 351 352 353 354
| Attribute     | Description                                                  |
| ------------- | ------------------------------------------------------------ |
| Applicable    | Server Only                                                  |
| Meaning       | WAL level                                                    |
| Value Range   | 1: wal enabled without fsync <br/> 2: wal enabled with fsync |
| Default Value | 1                                                            |
D
dingbo 已提交
355 356 357

### fsync

358 359 360 361 362 363 364
| Attribute     | Description                                                                                                           |
| ------------- | --------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                                           |
| Meaning       | The waiting time for invoking fsync when walLevel is 2                                                                |
| Unit          | millisecond                                                                                                           |
| Value Range   | 0: no waiting time, fsync is performed immediately once WAL is written; <br/> maximum value is 180000, i.e. 3 minutes |
| Default Value | 3000                                                                                                                  |
D
dingbo 已提交
365 366 367

### update

368 369 370 371 372 373 374
| Attribute     | Description                                                                                            |
| ------------- | ------------------------------------------------------------------------------------------------------ |
| Applicable    | Server Only                                                                                            |
| Meaning       | If it's allowed to update existing data                                                                |
| Value Range   | 0: not allowed <br/> 1: a row can only be updated as a whole <br/> 2: a part of columns can be updated |
| Default Value | 0                                                                                                      |
| Note          | Not available from version 2.0.8.0                                                                     |
D
dingbo 已提交
375 376 377

### cacheLast

378 379 380 381 382 383
| Attribute     | Description                                                                                                                                                          |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                                                                                          |
| Meaning       | Whether to cache the latest rows of each sub table in memory                                                                                                         |
| Value Range   | 0: not cached <br/> 1: the last row of each sub table is cached <br/> 2: the last non-null value of each column is cached <br/> 3: identical to both 1 and 2 are set |
| Default Value | 0                                                                                                                                                                    |
D
dingbo 已提交
384 385 386

### minimalTmpDirGB

387 388 389 390 391 392
| Attribute     | Description                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------------- |
| Applicable    | Server and Client                                                                               |
| Meaning       | When the available disk space in tmpDir is below this threshold, writing to tmpDir is suspended |
| Unit          | GB                                                                                              |
| Default Value | 1.0                                                                                             |
D
dingbo 已提交
393 394 395

### minimalDataDirGB

396 397 398 399 400 401
| Attribute     | Description                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------ |
| Applicable    | Server Only                                                                                      |
| Meaning       | hen the available disk space in dataDir is below this threshold, writing to dataDir is suspended |
| Unit          | GB                                                                                               |
| Default Value | 2.0                                                                                              |
D
dingbo 已提交
402 403 404

### vnodeBak

405 406 407 408 409 410
| Attribute     | Description                                                                 |
| ------------- | --------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                 |
| Meaning       | Whether to backup the corresponding vnode directory when a vnode is deleted |
| Value Range   | 0: not backed up, 1: backup                                                 |
| Default Value | 1                                                                           |
D
dingbo 已提交
411

412
## Cluster Parameters
D
dingbo 已提交
413 414 415

### numOfMnodes

416 417 418 419 420
| Attribute     | Description                    |
| ------------- | ------------------------------ |
| Applicable    | Server Only                    |
| Meaning       | The number of management nodes |
| Default Value | 3                              |
D
dingbo 已提交
421 422 423

### replica

424 425 426 427 428 429
| Attribute     | Description                |
| ------------- | -------------------------- |
| Applicable    | Server Only                |
| Meaning       | The number of replications |
| Value Range   | 1-3                        |
| Default Value | 1                          |
D
dingbo 已提交
430 431 432

### quorum

433 434 435 436 437 438
| Attribute     | Description                                                                                   |
| ------------- | --------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                   |
| Meaning       | The number of required confirmations for data replication in case of multiple replications 多 |
| Value Range   | 1,2                                                                                           |
| Default Value | 1                                                                                             |
D
dingbo 已提交
439 440 441

### role

442 443 444 445 446 447 448
| Attribute     | Description                                                     |
| ------------- | --------------------------------------------------------------- |
| Applicable    | Server Only                                                     |
| Meaning       | The role of the dnode                                           |
| Value Range   | 0: both mnode and vnode <br/> 1: mnode only <br/> 2: dnode only |
| Default Value | 0                                                               |

D
dingbo 已提交
449 450
### balance

451 452 453 454 455 456
| Attribute     | Description              |
| ------------- | ------------------------ |
| Applicable    | Server Only              |
| Meaning       | Automatic load balancing |
| Value Range   | 0: disabled, 1: enabled  |
| Default Value | 1                        |
D
dingbo 已提交
457 458 459

### balanceInterval

460 461 462 463 464 465 466
| Attribute     | Description                                     |
| ------------- | ----------------------------------------------- |
| Applicable    | Server Only                                     |
| Meaning       | The interval for checking load balance by mnode |
| Unit          | second                                          |
| Value Range   | 1-30000                                         |
| Default Value | 300                                             |
D
dingbo 已提交
467 468 469

### arbitrator

470 471 472 473 474
| Attribute     | Description                                        |
| ------------- | -------------------------------------------------- |
| Applicable    | Server Only                                        |
| Meaning       | End point of arbitrator, format is same as firstEp |
| Default Value | None                                               |
D
dingbo 已提交
475

476
## Time Parameters
D
dingbo 已提交
477 478 479

### rpcTimer

480 481 482 483 484 485 486
| Attribute     | Description        |
| ------------- | ------------------ |
| Applicable    | Server and Client  |
| Meaning       | rpc retry interval |
| Unit          | milliseconds       |
| Value Range   | 100-3000           |
| Default Value | 300                |
D
dingbo 已提交
487 488 489

### rpcMaxTime

490 491 492 493 494 495 496
| Attribute     | Description                        |
| ------------- | ---------------------------------- |
| Applicable    | Server and Client                  |
| Meaning       | maximum wait time for rpc response |
| Unit          | second                             |
| Value Range   | 100-7200                           |
| Default Value | 600                                |
D
dingbo 已提交
497 498 499

### statusInterval

500 501 502 503 504 505 506
| Attribute     | Description                                     |
| ------------- | ----------------------------------------------- |
| Applicable    | Server Only                                     |
| Meaning       | the interval of dnode reporting status to mnode |
| Unit          | second                                          |
| Value Range   | 1-10                                            |
| Default Value | 1                                               |
D
dingbo 已提交
507 508 509

### shellActivityTimer

510 511 512 513 514 515 516
| Attribute     | Description                                            |
| ------------- | ------------------------------------------------------ |
| Applicable    | Server and Client                                      |
| Meaning       | The interval for taos shell to send heartbeat to mnode |
| Unit          | second                                                 |
| Value Range   | 1-120                                                  |
| Default Value | 3                                                      |
D
dingbo 已提交
517 518 519

### tableMetaKeepTimer

520 521 522 523 524 525 526
| Attribute     | Description                                                                                        |
| ------------- | -------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                        |
| Meaning       | The expiration time for metadata in cache, once it's reached the client would refresh the metadata |
| Unit          | second                                                                                             |
| Value Range   | 1-8640000                                                                                          |
| Default Value | 7200                                                                                               |
D
dingbo 已提交
527 528 529

### maxTmrCtrl

530 531 532 533 534 535 536
| Attribute     | Description              |
| ------------- | ------------------------ |
| Applicable    | Server and Client        |
| Meaning       | Maximum number of timers |
| Unit          | None                     |
| Value Range   | 8-2048                   |
| Default Value | 512                      |
D
dingbo 已提交
537 538 539

### offlineThreshold

540 541 542 543 544 545 546
| Attribute     | Description                                                                                                                   |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                                                   |
| Meaning       | The expiration time for dnode online status, once it's reached before receiving status from a node, the dnode becomes offline |
| Unit          | second                                                                                                                        |
| Value Range   | 5-7200000                                                                                                                     |
| Default Value | 86400\*10(10 天)                                                                                                            |
D
dingbo 已提交
547

548
## Performance Optimization Parameters
D
dingbo 已提交
549 550 551

### numOfThreadsPerCore

552 553 554 555 556
| Attribute     | Description                                 |
| ------------- | ------------------------------------------- |
| Applicable    | Server and Client                           |
| Meaning       | The number of consumer threads per CPU core |
| Default Value | 1.0                                         |
D
dingbo 已提交
557 558 559

### ratioOfQueryThreads

560 561 562 563 564 565 566
| Attribute     | Description                                                                                   |
| ------------- | --------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                   |
| Meaning       | Maximum number of query threads 量                                                            |
| Value Range   | 0: Only one query thread <br/> 1: Same as number of CPU cores <br/> 2: two times of CPU cores |
| Default Value | 1                                                                                             |
| Note          | This value can be a float number, 0.5 means half of the CPU cores                             |
D
dingbo 已提交
567 568 569

### maxVgroupsPerDb

570 571 572 573 574 575
| Attribute     | Description                          |
| ------------- | ------------------------------------ |
| Applicable    | Server Only                          |
| Meaning       | Maximum number of vnodes for each DB |
| Value Range   | 0-8192                               |
| Default Value |                                      |
D
dingbo 已提交
576 577 578

### maxTablesPerVnode

579 580 581 582 583
| Attribute     | Description                            |
| ------------- | -------------------------------------- |
| Applicable    | Server Only                            |
| Meaning       | Maximum number of tables in each vnode |
| Default Value | 1000000                                |
D
dingbo 已提交
584 585 586

### minTablesPerVnode

587 588 589 590 591
| Attribute     | Description                            |
| ------------- | -------------------------------------- |
| Applicable    | Server Only                            |
| Meaning       | Minimum number of tables in each vnode |
| Default Value | 1000                                   |
D
dingbo 已提交
592 593 594

### tableIncStepPerVnode

595 596 597 598 599
| Attribute     | Description                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                 |
| Meaning       | When minTablesPerVnode is reached, the number of tables are allocated for a vnode each time |
| Default Value | 1000                                                                                        |
D
dingbo 已提交
600 601 602

### maxNumOfOrderedRes

603 604 605 606 607
| Attribute     | Description                                 |
| ------------- | ------------------------------------------- |
| Applicable    | Server and Client                           |
| Meaning       | Maximum number of rows ordered for a STable |
| Default Value | 100,000                                     |
D
dingbo 已提交
608 609 610

### mnodeEqualVnodeNum

611 612 613 614 615
| Attribute     | Description                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                     |
| Meaning       | The number of vnodes whose system resources consumption are considered as equal to single mnode |
| Default Value | 4                                                                                               |
D
dingbo 已提交
616 617 618

### numOfCommitThreads

619 620 621 622 623
| Attribute     | Description                               |
| ------------- | ----------------------------------------- |
| Applicable    | Server Only                               |
| Meaning       | Maximum of threads for committing to disk |
| Default Value |                                           |
D
dingbo 已提交
624

625
## Compression Parameters
D
dingbo 已提交
626 627 628

### comp

629 630 631 632 633 634
| Attribute     | Description                                                         |
| ------------- | ------------------------------------------------------------------- |
| Applicable    | Server Only                                                         |
| Meaning       | Whether data is compressed                                          |
| Value Range   | 0: uncompressed, 1: One phase compression, 2: Two phase compression |
| Default Value | 2                                                                   |
D
dingbo 已提交
635 636 637

### tsdbMetaCompactRatio

638 639 640 641 642
| Attribute     | Description                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------- |
| Meaning       | The threshold for percentage of redundant in meta file to trigger compression for meta file |
| Value Range   | 0: no compression forever, [1-100]: The threshold percentage                                |
| Default Value | 0                                                                                           |
D
dingbo 已提交
643 644 645

### compressMsgSize

646 647 648 649 650 651 652
| Attribute     | Description                                                                      |
| ------------- | -------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                      |
| Meaning       | The threshold for message size to compress the message..                         |
| Unit          | bytes                                                                            |
| Value Range   | 0: already compress; >0: compress when message exceeds it; -1: always uncompress |
| Default Value | -1                                                                               |
D
dingbo 已提交
653 654 655

### compressColData

656 657 658 659 660 661 662 663
| Attribute     | Description                                                                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                                         |
| Meaning       | The threshold for size of column data to trigger compression for the query result                                   |
| Unit          | bytes                                                                                                               |
| Value Range   | 0: always compress; >0: only compress when the size of any column data exceeds the threshold; -1: always uncompress |
| Default Value | -1                                                                                                                  |
| Note          | available from version 2.3.0.0                                                                                      |
D
dingbo 已提交
664 665 666

### lossyColumns

667 668 669 670 671 672
| Attribute     | Description                                                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server Only                                                                                                                                 |
| Meaning       | The floating number types for lossy compression                                                                                             |
| Value Range   | "": lossy compression is disabled <br/> float: only for float <br/>double: only for double <br/> float \| double: for both float and double |
| Default Value | "" , i.e. disabled                                                                                                                          |
D
dingbo 已提交
673 674 675

### fPrecision

676 677 678 679 680 681 682
| Attribute     | Description                                                 |
| ------------- | ----------------------------------------------------------- |
| Applicable    | Server Only                                                 |
| Meaning       | Compression precision for float type                        |
| Value Range   | 0.1 ~ 0.00000001                                            |
| Default Value | 0.00000001                                                  |
| Note          | The fractional part lower than this value will be discarded |
D
dingbo 已提交
683 684 685

### dPrecision

686 687 688 689 690 691 692
| Attribute     | Description                                                 |
| ------------- | ----------------------------------------------------------- |
| Applicable    | Server Only                                                 |
| Meaning       | Compression precision for double type                       |
| Value Range   | 0.1 ~ 0.0000000000000001                                    |
| Default Value | 0.0000000000000001                                          |
| Note          | The fractional part lower than this value will be discarded |
D
dingbo 已提交
693

694
## Continuous Query Prameters
D
dingbo 已提交
695 696 697

### stream

698 699 700 701 702 703
| Attribute     | Description                        |
| ------------- | ---------------------------------- |
| Applicable    | Server Only                        |
| Meaning       | Whether to enable continuous query |
| Value Range   | 0: disabled <br/> 1: enabled       |
| Default Value | 1                                  |
D
dingbo 已提交
704 705 706

### minSlidingTime

707 708 709 710 711 712 713
| Attribute     | Description                                              |
| ------------- | -------------------------------------------------------- |
| Applicable    | Server Only                                              |
| Meaning       | Minimum sliding time of time window                      |
| Unit          | millisecond or microsecond , depending on time precision |
| Value Range   | 10-1000000                                               |
| Default Value | 10                                                       |
D
dingbo 已提交
714 715 716

### minIntervalTime

717 718 719 720 721 722 723
| Attribute     | Description                 |
| ------------- | --------------------------- |
| Applicable    | Server Only                 |
| Meaning       | Minimum size of time window |
| Unit          | millisecond                 |
| Value Range   | 1-1000000                   |
| Default Value | 10                          |
D
dingbo 已提交
724 725 726

### maxStreamCompDelay

727 728 729 730 731 732 733
| Attribute     | Description                                      |
| ------------- | ------------------------------------------------ |
| Applicable    | Server Only                                      |
| Meaning       | Maximum delay before starting a continuous query |
| Unit          | millisecond                                      |
| Value Range   | 10-1000000000                                    |
| Default Value | 20000                                            |
D
dingbo 已提交
734 735 736

### maxFirstStreamCompDelay

737 738 739 740 741 742 743
| Attribute     | Description                                                          |
| ------------- | -------------------------------------------------------------------- |
| Applicable    | Server Only                                                          |
| Meaning       | Maximum delay time before starting a continuous query the first time |
| Unit          | millisecond                                                          |
| Value Range   | 10-1000000000                                                        |
| Default Value | 10000                                                                |
D
dingbo 已提交
744 745 746

### retryStreamCompDelay

747 748 749 750 751 752 753
| Attribute     | Description                                   |
| ------------- | --------------------------------------------- |
| Applicable    | Server Only                                   |
| Meaning       | Delay time before retrying a continuous query |
| Unit          | millisecond                                   |
| Value Range   | 10-1000000000                                 |
| Default Value | 10                                            |
D
dingbo 已提交
754 755 756

### streamCompDelayRatio

757 758 759 760 761 762
| Attribute     | Description                                                              |
| ------------- | ------------------------------------------------------------------------ |
| Applicable    | Server Only                                                              |
| Meaning       | The delay ratio, with time window size as the base, for continuous query |
| Value Range   | 0.1-0.9                                                                  |
| Default Value | 0.1                                                                      |
D
dingbo 已提交
763 764

:::info
765
To prevent system resource from being exhausted by multiple concurrent streams, a random delay is applied on each stream automatically. `maxFirstStreamCompDelay` is the maximum delay time before a continuous query is started the first time. `streamCompDelayRatio` is the ratio for calculating delay time, with the size of the time window as base. `maxStreamCompDelay` is the maximum delay time. The actual delay time is a random time not bigger than `maxStreamCompDelay`. If a continuous query fails, `retryStreamComDelay` is the delay time before retrying it, also not bigger than `maxStreamCompDelay`.
D
dingbo 已提交
766 767 768

:::

769
## HTTP Parameters
D
dingbo 已提交
770 771

:::note
772 773
HTTP server had been provided by `taosd` prior to version 2.4.0.0, now is provided by `taosAdapter` after version 2.4.0.0.
The parameters described in this section are only application in versions prior to 2.4.0.0. If you are using any version from 2.4.0.0, please refer to [taosAdapter]](/reference/taosadapter/).
D
dingbo 已提交
774 775 776 777 778

:::

### http

779 780 781 782 783 784
| Attribute     | Description                    |
| ------------- | ------------------------------ |
| Applicable    | Server Only                    |
| Meaning       | Whether to enable http service |
| Value Range   | 0: disabled, 1: enabled        |
| Default Value | 1                              |
D
dingbo 已提交
785 786 787

### httpEnableRecordSql

788 789 790 791 792 793
| Attribute     | Description                                                               |
| ------------- | ------------------------------------------------------------------------- |
| Applicable    | Server Only                                                               |
| Meaning       | Whether to record the SQL invocation through REST interface               |
| Default Value | 0: false; 1: true                                                         |
| Note          | The resulting files, i.e. httpnote.0/httpnote.1, are located under logDir |
D
dingbo 已提交
794 795 796

### httpMaxThreads

797 798 799 800 801
| Attribute     | Description                                  |
| ------------- | -------------------------------------------- |
| Applicable    | Server Only                                  |
| Meaning       | The number of threads for RESTFul interface. |
| Default Value | 2                                            |
D
dingbo 已提交
802 803 804

### restfulRowLimit

805 806 807 808 809 810
| Attribute     | Description                                                  |
| ------------- | ------------------------------------------------------------ |
| Applicable    | Server Only                                                  |
| Meaning       | Maximum number of rows returned each time by REST interface. |
| Default Value | 10240                                                        |
| Note          | Maximum value is 10,000,000                                  |
D
dingbo 已提交
811 812 813

### httpDBNameMandatory

814 815 816 817 818 819 820
| Attribute     | Description                              |
| ------------- | ---------------------------------------- |
| Applicable    | Server Only                              |
| Meaning       | Whether database name is required in URL |
| Value Range   | 0:not required, 1: required              |
| Default Value | 0                                        |
| Note          | From version 2.3.0.0                     |
D
dingbo 已提交
821

822
## Log Parameters
D
dingbo 已提交
823 824 825

### logDir

826 827 828 829 830
| Attribute     | Description                         |
| ------------- | ----------------------------------- |
| Applicable    | Server and Client                   |
| Meaning       | The directory for writing log files |
| Default Value | /var/log/taos                       |
D
dingbo 已提交
831 832 833

### minimalLogDirGB

834 835 836 837 838 839
| Attribute     | Description                                                                                        |
| ------------- | -------------------------------------------------------------------------------------------------- |
| Applicable    | Server and Client                                                                                  |
| Meaning       | When the available disk space in logDir is below this threshold, writing to log files is suspended |
| Unit          | GB                                                                                                 |
| Default Value | 1.0                                                                                                |
D
dingbo 已提交
840 841 842

### numOfLogLines

843 844 845 846 847
| Attribute     | Description                                |
| ------------- | ------------------------------------------ |
| Applicable    | Server and Client                          |
| Meaning       | Maximum number of lines in single log file |
| Default Value | 10,000,000                                 |
D
dingbo 已提交
848 849 850

### asyncLog

851 852 853 854 855 856
| Attribute     | Description                  |
| ------------- | ---------------------------- |
| Applicable    | Server and Client            |
| Meaning       | The mode of writing log file |
| Value Range   | 0: sync way; 1: async way    |
| Default Value | 1                            |
D
dingbo 已提交
857 858 859

### logKeepDays

860 861 862 863 864 865 866
| Attribute     | Description                                                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server and Client                                                                                                                           |
| Meaning       | The number of days for log files to be kept                                                                                                 |
| Unit          | day                                                                                                                                         |
| Default Value | 0                                                                                                                                           |
| Note          | When it's bigger than 0, the log file would be renamed to "taosdlog.xxx" in which "xxx" is the timestamp when the file is changed last time |
D
dingbo 已提交
867 868 869

### debugFlag

870 871 872 873 874 875
| Attribute     | Description                                               |
| ------------- | --------------------------------------------------------- |
| Applicable    | Server and Client                                         |
| Meaning       | Log level                                                 |
| Value Range   | 131: INFO/WARNING/ERROR; 135: plus DEBUG; 143: plus TRACE |
| Default Value | 131 or 135, depending on the module                       |
D
dingbo 已提交
876 877 878

### mDebugFlag

879 880 881 882 883 884
| Attribute     | Description        |
| ------------- | ------------------ |
| Applicable    | Server Only        |
| Meaning       | Log level of mnode |
| Value Range   | same as debugFlag  |
| Default Value | 135                |
D
dingbo 已提交
885 886 887

### dDebugFlag

888 889 890 891 892 893
| Attribute     | Description        |
| ------------- | ------------------ |
| Applicable    | Server and Client  |
| Meaning       | Log level of dnode |
| Value Range   | same as debugFlag  |
| Default Value | 135                |
D
dingbo 已提交
894 895 896

### sDebugFlag

897 898 899 900 901 902
| Attribute     | Description              |
| ------------- | ------------------------ |
| Applicable    | Server and Client        |
| Meaning       | Log level of sync module |
| Value Range   | same as debugFlag        |
| Default Value | 135                      |
D
dingbo 已提交
903 904 905

### wDebugFlag

906 907 908 909 910 911
| Attribute     | Description             |
| ------------- | ----------------------- |
| Applicable    | Server and Client       |
| Meaning       | Log level of WAL module |
| Value Range   | same as debugFlag       |
| Default Value | 135                     |
D
dingbo 已提交
912 913 914

### sdbDebugFlag

915 916 917 918 919 920
| Attribute     | Description            |
| ------------- | ---------------------- |
| Applicable    | Server and Client      |
| Meaning       | logLevel of sdb module |
| Value Range   | same as debugFlag      |
| Default Value | 135                    |
D
dingbo 已提交
921 922 923

### rpcDebugFlag

924 925 926 927 928 929
| Attribute     | Description             |
| ------------- | ----------------------- |
| Applicable    | Server and Client       |
| Meaning       | Log level of rpc module |
| Value Range   | Same as debugFlag       |
| Default Value |                         |
D
dingbo 已提交
930 931 932

### tmrDebugFlag

933 934 935 936 937 938
| Attribute     | Description               |
| ------------- | ------------------------- |
| Applicable    | Server and Client         |
| Meaning       | Log level of timer module |
| Value Range   | Same as debugFlag         |
| Default Value |                           |
D
dingbo 已提交
939 940 941

### cDebugFlag

942 943 944 945 946 947
| Attribute     | Description         |
| ------------- | ------------------- |
| Applicable    | Client Only         |
| Meaning       | Log level of Client |
| Value Range   | Same as debugFlag   |
| Default Value |                     |
D
dingbo 已提交
948 949 950

### jniDebugFlag

951 952 953 954 955 956
| Attribute     | Description             |
| ------------- | ----------------------- |
| Applicable    | Client Only             |
| Meaning       | Log level of jni module |
| Value Range   | 同上                    |
| Default Value |                         |
D
dingbo 已提交
957 958 959

### odbcDebugFlag

960 961 962 963 964 965
| Attribute     | Description              |
| ------------- | ------------------------ |
| Applicable    | Client Only              |
| Meaning       | Log level of odbc module |
| Value Range   | Same as debugFlag        |
| Default Value |                          |
D
dingbo 已提交
966 967 968

### uDebugFlag

969 970 971 972 973 974
| Attribute     | Description                |
| ------------- | -------------------------- |
| Applicable    | Server and Client          |
| Meaning       | Log level of common module |
| Value Range   | Same as debugFlag          |
| Default Value |                            |
D
dingbo 已提交
975 976 977

### httpDebugFlag

978 979 980 981 982 983
| Attribute     | Description                                 |
| ------------- | ------------------------------------------- |
| Applicable    | Server Only                                 |
| Meaning       | Log level of http module (prior to 2.4.0.0) |
| Value Range   | Same as debugFlag                           |
| Default Value |                                             |
D
dingbo 已提交
984 985 986

### mqttDebugFlag

987 988 989 990 991 992
| Attribute     | Description              |
| ------------- | ------------------------ |
| Applicable    | Server Only              |
| Meaning       | Log level of mqtt module |
| Value Range   | Same as debugFlag        |
| Default Value |                          |
D
dingbo 已提交
993 994 995

### monitorDebugFlag

996 997 998 999 1000 1001
| Attribute     | Description                    |
| ------------- | ------------------------------ |
| Applicable    | Server Only                    |
| Meaning       | Log level of monitoring module |
| Value Range   | Same as debugFlag              |
| Default Value |                                |
D
dingbo 已提交
1002 1003 1004

### qDebugFlag

1005 1006 1007 1008 1009 1010
| Attribute     | Description               |
| ------------- | ------------------------- |
| Applicable    | Server and Client         |
| Meaning       | Log level of query module |
| Value Range   | Same as debugFlag         |
| Default Value |                           |
D
dingbo 已提交
1011 1012 1013

### vDebugFlag

1014 1015 1016 1017 1018 1019
| Attribute     | Description        |
| ------------- | ------------------ |
| Applicable    | Server and Client  |
| Meaning       | Log level of vnode |
| Value Range   | Same as debugFlag  |
| Default Value |                    |
D
dingbo 已提交
1020 1021 1022

### tsdbDebugFlag

1023 1024 1025 1026 1027 1028
| Attribute     | Description              |
| ------------- | ------------------------ |
| Applicable    | Server Only              |
| Meaning       | Log level of TSDB module |
| Value Range   | Same as debugFlag        |
| Default Value |                          |
D
dingbo 已提交
1029 1030 1031

### cqDebugFlag

1032 1033 1034 1035 1036 1037
| Attribute     | Description                          |
| ------------- | ------------------------------------ |
| Applicable    | Server and Client                    |
| Meaning       | Log level of continuous query module |
| Value Range   | Same as debugFlag                    |
| Default Value |                                      |
D
dingbo 已提交
1038

1039
## Client Only
D
dingbo 已提交
1040 1041 1042

### maxSQLLength

1043 1044 1045 1046 1047 1048 1049
| Attribute     | Description                            |
| ------------- | -------------------------------------- |
| Applicable    | Client Only                            |
| Meaning       | Maximum length of single SQL statement |
| Unit          | bytes                                  |
| Value Range   | 65480-1048576                          |
| Default Value | 1048576                                |
D
dingbo 已提交
1050 1051 1052

### tscEnableRecordSql

1053 1054 1055 1056 1057 1058
| Attribute     | Description                                                                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Meaning       | Whether to record SQL statements in file                                                                                                          |
| Value Range   | 0: false, 1: true                                                                                                                                 |
| Default Value | 0                                                                                                                                                 |
| Note          | The generated files are named as "tscnote-xxxx.0/tscnote-xxx.1" in which "xxxx" is the pid of the client, and located at same place as client log |
D
dingbo 已提交
1059 1060 1061

### maxBinaryDisplayWidth

1062 1063 1064 1065 1066
| Attribute     | Description                                                                                         |
| ------------- | --------------------------------------------------------------------------------------------------- |
| Meaning       | Maximum display width of binary and nchar in taos shell. Anything beyond this limit would be hidden |
| Value Range   | 5 -                                                                                                 |
| Default Value | 30                                                                                                  |
D
dingbo 已提交
1067 1068

:::info
1069
If the length of value exceeds `maxBinaryDisplayWidth`, then the actual display width is max(column name, maxBinaryDisplayLength); otherwise the actual display width is max(length of column name, length of column value). This parameter can also be changed dynamically using `set max_binary_display_width <nn\>` in TDengine CLI `taos`.
D
dingbo 已提交
1070 1071 1072 1073 1074

:::

### maxWildCardsLength

1075 1076 1077 1078 1079 1080 1081
| Attribute     | Description                                           |
| ------------- | ----------------------------------------------------- |
| Meaning       | The maximum length for wildcard string used with LIKE |
| Unit          | bytes                                                 |
| Value Range   | 0-16384                                               |
| Default Value | 100                                                   |
| Note          | From version 2.1.6.1                                  |
D
dingbo 已提交
1082 1083 1084

### clientMerge

1085 1086 1087 1088 1089 1090
| Attribute     | Description                                         |
| ------------- | --------------------------------------------------- |
| Meaning       | Whether to filter out duplicate data on client side |
| Value Range   | 0: false; 1: true                                   |
| Default Value | 0                                                   |
| Note          | From version 2.3.0.0                                |
D
dingbo 已提交
1091 1092 1093

### maxRegexStringLen

1094 1095 1096 1097 1098 1099
| Attribute     | Description                                                 |
| ------------- | ----------------------------------------------------------- |
| Meaning       | Maximum length of regular expression 正则表达式最大允许长度 |
| Value Range   | [128, 16384]                                                |
| Default Value | 128                                                         |
| Note          | From version 2.3.0.0                                        |
D
dingbo 已提交
1100

1101
## Other Parameters
D
dingbo 已提交
1102 1103 1104

### enableCoreFile

1105 1106 1107 1108 1109 1110 1111
| Attribute     | Description                                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Applicable    | Server and Client                                                                                                                                                       |
| Meaning       | Whether to generate core file when server crashes                                                                                                                       |
| Value Range   | 0: false, 1: true                                                                                                                                                       |
| Default Value | 1                                                                                                                                                                       |
| Note          | The core file is generated under root directory `systemctl start taosd` is used to start, or under the working directory if `taosd` is started directly on Linux Shell. |