Skip to main content

Configuration Parameters

Configuration File on Server Side

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

taosd -c /home/user

Parameter -C can be used on the CLI of taosd to show its configuration, like below:

taosd -C

Configuration File on Client Side

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.

taos -C
taos --dump-config

Configuration Parameters

note

The parameters described in this document by the effect that they have on the system.

note

taosd needs to be restarted for the parameters changed in the configuration file to take effect.

Connection Parameters

firstEp

AttributeDescription
ApplicableServer and Client
MeaningThe end point of the first dnode in the cluster to be connected to when taosd or taos is started
Defaultlocalhost:6030

secondEp

AttributeDescription
ApplicableServer and Client
MeaningThe end point of the second dnode to be connected to if the firstEp is not available when taosd or taos is started
DefaultNone

fqdn

AttributeDescription
ApplicableServer Only
MeaningThe FQDN of the host where taosd will be started. It can be IP address
Default ValueThe first hostname configured for the host
NoteIt should be within 96 bytes

serverPort

AttributeDescription
ApplicableServer Only
MeaningThe port for external access after taosd is started
Default Value6030
note
  • Ensure that your firewall rules do not block TCP port 6042 on any host in the cluster. Below table describes the ports used by TDengine in details.
ProtocolDefault PortDescriptionHow to configure
TCP6030Communication between client and server. In a multi-node cluster, communication between nodes. serverPort
TCP6041REST connection between client and serverPrior to 2.4.0.0: serverPort+11; After 2.4.0.0 refer to taosAdapter
TCP6043Service Port of TaosKeeperThe parameter of TaosKeeper
TCP6044Data access port for StatsDConfigurable through taosAdapter parameters.
UDP6045Data access for statsdConfigurable through taosAdapter parameters.
TCP6060Port of Monitoring Service in Enterprise version

maxShellConns

AttributeDescription
ApplicableServer Only
MeaningThe maximum number of connections a dnode can accept
Value Range10-50000000
Default Value5000

Monitoring Parameters

monitor

AttributeDescription
ApplicableServer only
MeaningThe switch for monitoring inside server. The main object of monitoring is to collect information about load on physical nodes, including CPU usage, memory usage, disk usage, and network bandwidth. Monitoring information is sent over HTTP to the taosKeeper service specified by monitorFqdn and monitorProt.
Value Range0: monitoring disabled, 1: monitoring enabled
Default1

monitorFqdn

AttributeDescription
ApplicableServer Only
MeaningFQDN of taosKeeper monitoring service
DefaultNone

monitorPort

AttributeDescription
ApplicableServer Only
MeaningPort of taosKeeper monitoring service
Default Value6043

monitorInterval

AttributeDescription
ApplicableServer Only
MeaningThe interval of collecting system workload
Unitsecond
Value Range1-200000
Default Value30

telemetryReporting

AttributeDescription
ApplicableServer Only
MeaningSwitch for allowing TDengine to collect and report service usage information
Value Range0: Not allowed; 1: Allowed
Default Value1

Query Parameters

queryPolicy

AttributeDescription
ApplicableClient only
MeaningExecution policy for query statements
UnitNone
Default1
Notes1: Run queries on vnodes and not on qnodes

2: Run subtasks without scan operators on qnodes and subtasks with scan operators on vnodes.

3: Only run scan operators on vnodes; run all other operators on qnodes.

querySmaOptimize

AttributeDescription
ApplicableClient only
MeaningSMA index optimization policy
UnitNone
Default Value0
Notes

0: Disable SMA indexing and perform all queries on non-indexed data.

1: Enable SMA indexing and perform queries from suitable statements on precomputation results.|

maxNumOfDistinctRes

AttributeDescription
ApplicableServer Only
MeaningThe maximum number of distinct rows returned
Value Range[100,000 - 100,000,000]
Default Value100,000

keepColumnName

AttributeDescription
ApplicableClient only
MeaningWhen the Last, First, LastRow function is queried, whether the returned column name contains the function name.
Value Range0 means including the function name, 1 means not including the function name.
Default Value0

Locale Parameters

timezone

AttributeDescription
ApplicableServer and Client
MeaningTimeZone
Default ValueTimeZone configured in the host
info

To handle the data insertion and data query from multiple timezones, Unix Timestamp is used and stored in TDengine. The timestamp generated from any timezones at same time is same in Unix timestamp. Note that Unix timestamps are converted and recorded on the client side. To make sure the time on client side can be converted to Unix timestamp correctly, the timezone must be set properly.

On Linux/macOS, TDengine clients automatically obtain timezone from the host. Alternatively, the timezone can be configured explicitly in configuration file taos.cfg like below. For example:

timezone UTC-8
timezone GMT-8
timezone Asia/Shanghai

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.

The setting for timezone impacts strings that are not in Unix timestamp format and keywords or functions related to date/time. For example:

SELECT count(*) FROM table_name WHERE TS<'2019-04-11 12:01:08';

If the timezone is UTC+8, the above SQL statement is equal to:

SELECT count(*) FROM table_name WHERE TS<1554955268000;

If the timezone is UTC, it's equal to

SELECT count(*) FROM table_name WHERE TS<1554984068000;

To avoid the problems of using time strings, Unix timestamp can be used directly. Furthermore, time strings with timezone can be used in SQL statements. 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 are not influenced by timezone setting when converted to Unix timestamp.

locale

AttributeDescription
ApplicableServer and Client
MeaningLocation code
Default ValueLocale configured in host
info

A specific type "nchar" is provided in TDengine to store non-ASCII characters such as Chinese, Japanese, and Korean. The characters to be stored in nchar type are firstly encoded in UCS4-LE before sending to server side. Note that the correct encoding is determined by the user. To store non-ASCII characters correctly, the encoding format of the client side needs to be set properly.

The characters input on the client side are encoded using the default system encoding, which is UTF-8 on Linux/macOS, 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.

The locale definition standard on Linux/macOS is: <Language>_<Region>.<charset>, for example, in "zh_CN.UTF-8", "zh" means Chinese, "CN" means China mainland, "UTF-8" means charset. The charset indicates how to display the characters. On Linux/macOS, 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/macOS to specify the charset.

charset

AttributeDescription
ApplicableServer and Client
MeaningCharacter
Default Valuecharset set in the system
info

On Linux/macOS, 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/macOS, if system locale is set properly, it's not necessary to set charset in taos.cfg. For example:

locale zh_CN.UTF-8

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

charset CP936

Refer to the documentation for your operating system before changing the charset.

On a Linux/macOS, if the charset contained in locale is not consistent with that set by charset, the later setting in the configuration file takes precedence.

locale zh_CN.UTF-8
charset GBK

The charset that takes effect is GBK.

charset GBK
locale zh_CN.UTF-8

The charset that takes effect is UTF-8.

Storage Parameters

dataDir

AttributeDescription
ApplicableServer Only
MeaningAll data files are stored in this directory
Default Value/var/lib/taos

minimalTmpDirGB

AttributeDescription
ApplicableServer and Client
MeaningWhen the available disk space in tmpDir is below this threshold, writing to tmpDir is suspended
UnitGB
Default Value1.0

minimalDataDirGB

AttributeDescription
ApplicableServer Only
MeaningWhen the available disk space in dataDir is below this threshold, writing to dataDir is suspended
UnitGB
Default Value2.0

Cluster Parameters

supportVnodes

AttributeDescription
ApplicableServer Only
MeaningMaximum number of vnodes per dnode
Value Range0-4096
Default Value2x the CPU cores

Time Parameters

statusInterval

AttributeDescription
ApplicableServer Only
Meaningthe interval of dnode reporting status to mnode
Unitsecond
Value Range1-10
Default Value1

shellActivityTimer

AttributeDescription
ApplicableServer and Client
MeaningThe interval for TDengine CLI to send heartbeat to mnode
Unitsecond
Value Range1-120
Default Value3

Performance Optimization Parameters

numOfCommitThreads

AttributeDescription
ApplicableServer Only
MeaningMaximum of threads for committing to disk
Default Value

Compression Parameters

compressMsgSize

AttributeDescription
ApplicableServer Only
MeaningThe threshold for message size to compress the message.
Unitbytes
Value Range0: already compress; >0: compress when message exceeds it; -1: always uncompress
Default Value-1

compressColData

AttributeDescription
ApplicableServer Only
MeaningThe threshold for size of column data to trigger compression for the query result
Unitbytes
Value Range0: always compress; >0: only compress when the size of any column data exceeds the threshold; -1: always uncompress
Default Value-1
Default Value-1
Noteavailable from version 2.3.0.0

Continuous Query Parameters |

minSlidingTime

AttributeDescription
ApplicableServer Only
MeaningMinimum sliding time of time window
Unitmillisecond or microsecond , depending on time precision
Value Range10-1000000
Default Value10

minIntervalTime

AttributeDescription
ApplicableServer Only
MeaningMinimum size of time window
Unitmillisecond
Value Range1-1000000
Default Value10
info

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.

Log Parameters

logDir

AttributeDescription
ApplicableServer and Client
MeaningThe directory for writing log files
Default Value/var/log/taos

minimalLogDirGB

AttributeDescription
ApplicableServer and Client
MeaningWhen the available disk space in logDir is below this threshold, writing to log files is suspended
UnitGB
Default Value1.0

numOfLogLines

AttributeDescription
ApplicableServer and Client
MeaningMaximum number of lines in single log file
Default Value10000000

asyncLog

AttributeDescription
ApplicableServer and Client
MeaningThe mode of writing log file
Value Range0: sync way; 1: async way
Default Value1

logKeepDays

AttributeDescription
ApplicableServer and Client
MeaningThe number of days for log files to be kept
Unitday
Default Value0
NoteWhen 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

debugFlag

AttributeDescription
ApplicableServer and Client
MeaningLog level
Value Range131: INFO/WARNING/ERROR; 135: plus DEBUG; 143: plus TRACE
Default Value131 or 135, depending on the module

tmrDebugFlag

AttributeDescription
ApplicableServer and Client
MeaningLog level of timer module
Value Rangesame as debugFlag
Default Value

uDebugFlag

AttributeDescription
ApplicableServer and Client
MeaningLog level of common module
Value Rangesame as debugFlag
Default Value

rpcDebugFlag

AttributeDescription
ApplicableServer and Client
MeaningLog level of rpc module
Value Rangesame as debugFlag
Default Value

jniDebugFlag

AttributeDescription
ApplicableClient Only
MeaningLog level of jni module
Value Rangesame as debugFlag
Default Value

qDebugFlag

AttributeDescription
ApplicableServer and Client
MeaningLog level of query module
Value Rangesame as debugFlag
Default Value

cDebugFlag

AttributeDescription
ApplicableClient Only
MeaningLog level of Client
Value Rangesame as debugFlag
Default Value

dDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of dnode
Value Rangesame as debugFlag
Default Value135

vDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of vnode
Value Rangesame as debugFlag
Default Value

mDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of mnode module
Value Rangesame as debugFlag
Default Value135

wDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of WAL module
Value Rangesame as debugFlag
Default Value135

sDebugFlag

AttributeDescription
ApplicableServer and Client
MeaningLog level of sync module
Value Rangesame as debugFlag
Default Value135

tsdbDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of TSDB module
Value Rangesame as debugFlag
Default Value

tqDebugFlag

AttributeDescription
ApplicableServer only
MeaningLog level of TQ module
Value Rangesame as debugFlag
Default Value

fsDebugFlag

AttributeDescription
ApplicableServer only
MeaningLog level of FS module
Value Rangesame as debugFlag
Default Value

udfDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of UDF module
Value Rangesame as debugFlag
Default Value

smaDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of SMA module
Value Rangesame as debugFlag
Default Value

idxDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of index module
Value Rangesame as debugFlag
Default Value

tdbDebugFlag

AttributeDescription
ApplicableServer Only
MeaningLog level of TDB module
Value Rangesame as debugFlag
Default Value

Schemaless Parameters

smlChildTableName

AttributeDescription
ApplicableClient only
MeaningCustom subtable name for schemaless writes
TypeString
Default ValueNone

smlTagName

AttributeDescription
ApplicableClient only
MeaningDefault tag for schemaless writes without tag value specified
TypeString
Default Value_tag_null

smlDataFormat

AttributeDescription
ApplicableClient only
MeaningWhether schemaless columns are consistently ordered
Value Range0: not consistent; 1: consistent.
Default1

Other Parameters

enableCoreFile

AttributeDescription
ApplicableServer and Client
MeaningWhether to generate core file when server crashes
Value Range0: false, 1: true
Default Value1
NoteThe core file is generated under root directory systemctl start taosd/launchctl start com.tdengine.taosd is used to start, or under the working directory if taosd is started directly on Linux/macOS Shell.

udf

AttributeDescription
ApplicableServer Only
MeaningWhether the UDF service is enabled
Value Range0: disable UDF; 1: enabled UDF
Default Value1

Parameter Comparison of TDengine 2.x and 3.0

#ParameterIn 2.xIn 3.0
1firstEpYesYes
2secondEpYesYes
3fqdnYesYes
4serverPortYesYes
5maxShellConnsYesYes
6monitorYesYes
7monitorFqdnNoYes
8monitorPortNoYes
9monitorIntervalYesYes
10monitorMaxLogsNoYes
11monitorCompNoYes
12telemetryReportingYesYes
13telemetryIntervalNoYes
14telemetryServerNoYes
15telemetryPortNoYes
16queryPolicyNoYes
17querySmaOptimizeNoYes
18queryRsmaToleranceNoYes
19queryBufferSizeYesYes
20maxNumOfDistinctResYesYes
21minSlidingTimeYesYes
22minIntervalTimeYesYes
23countAlwaysReturnValueYesYes
24dataDirYesYes
25minimalDataDirGBYesYes
26supportVnodesNoYes
27tempDirYesYes
28minimalTmpDirGBYesYes
29compressMsgSizeYesYes
30compressColDataYesYes
31smlChildTableNameYesYes
32smlTagNameYesYes
33smlDataFormatNoYes
34statusIntervalYesYes
35shellActivityTimerYesYes
36transPullupIntervalNoYes
37mqRebalanceIntervalNoYes
38ttlUnitNoYes
39ttlPushIntervalNoYes
40numOfTaskQueueThreadsNoYes
41numOfRpcThreadsNoYes
42numOfCommitThreadsYesYes
43numOfMnodeReadThreadsNoYes
44numOfVnodeQueryThreadsNoYes
45numOfVnodeStreamThreadsNoYes
46numOfVnodeFetchThreadsNoYes
47numOfVnodeRsmaThreadsNoYes
48numOfQnodeQueryThreadsNoYes
49numOfQnodeFetchThreadsNoYes
50numOfSnodeSharedThreadsNoYes
51numOfSnodeUniqueThreadsNoYes
52rpcQueueMemoryAllowedNoYes
53logDirYesYes
54minimalLogDirGBYesYes
55numOfLogLinesYesYes
56asyncLogYesYes
57logKeepDaysYesYes
60debugFlagYesYes
61tmrDebugFlagYesYes
62uDebugFlagYesYes
63rpcDebugFlagYesYes
64jniDebugFlagYesYes
65qDebugFlagYesYes
66cDebugFlagYesYes
67dDebugFlagYesYes
68vDebugFlagYesYes
69mDebugFlagYesYes
70wDebugFlagYesYes
71sDebugFlagYesYes
72tsdbDebugFlagYesYes
73tqDebugFlagNoYes
74fsDebugFlagYesYes
75udfDebugFlagNoYes
76smaDebugFlagNoYes
77idxDebugFlagNoYes
78tdbDebugFlagNoYes
79metaDebugFlagNoYes
80timezoneYesYes
81localeYesYes
82charsetYesYes
83udfYesYes
84enableCoreFileYesYes
85arbitratorYesNo
86numOfThreadsPerCoreYesNo
87numOfMnodesYesNo
88vnodeBakYesNo
89balanceYesNo
90balanceIntervalYesNo
91offlineThresholdYesNo
92roleYesNo
93dnodeNopLoopYesNo
94keepTimeOffsetYesNo
95rpcTimerYesNo
96rpcMaxTimeYesNo
97rpcForceTcpYesNo
98tcpConnTimeoutYesNo
99syncCheckIntervalYesNo
100maxTmrCtrlYesNo
101monitorReplicaYesNo
102smlTagNullNameYesNo
103keepColumnNameYesNo
104ratioOfQueryCoresYesNo
105maxStreamCompDelayYesNo
106maxFirstStreamCompDelayYesNo
107retryStreamCompDelayYesNo
108streamCompDelayRatioYesNo
109maxVgroupsPerDbYesNo
110maxTablesPerVnodeYesNo
111minTablesPerVnodeYesNo
112tableIncStepPerVnodeYesNo
113cacheYesNo
114blocksYesNo
115daysYesNo
116keepYesNo
117minRowsYesNo
118maxRowsYesNo
119quorumYesNo
120compYesNo
121walLevelYesNo
122fsyncYesNo
123replicaYesNo
124partitionsYesNo
125quorumYesNo
126updateYesNo
127cachelastYesNo
128maxSQLLengthYesNo
129maxWildCardsLengthYesNo
130maxRegexStringLenYesNo
131maxNumOfOrderedResYesNo
132maxConnectionsYesNo
133mnodeEqualVnodeNumYesNo
134httpYesNo
135httpEnableRecordSqlYesNo
136httpMaxThreadsYesNo
137restfulRowLimitYesNo
138httpDbNameMandatoryYesNo
139httpKeepAliveYesNo
140enableRecordSqlYesNo
141maxBinaryDisplayWidthYesNo
142streamYesNo
143retrieveBlockingModelYesNo
144tsdbMetaCompactRatioYesNo
145defaultJSONStrTypeYesNo
146walFlushSizeYesNo
147keepTimeOffsetYesNo
148flowctrlYesNo
149slaveQueryYesNo
150adjustMasterYesNo
151topicBinaryLenYesNo
152telegrafUseFieldNumYesNo
153deadLockKillQueryYesNo
154clientMergeYesNo
155sdbDebugFlagYesNo
156odbcDebugFlagYesNo
157httpDebugFlagYesNo
158monDebugFlagYesNo
159cqDebugFlagYesNo
160shortcutFlagYesNo
161probeSecondsYesNo
162probeKillSecondsYesNo
163probeIntervalYesNo
164lossyColumnsYesNo
165fPrecisionYesNo
166dPrecisionYesNo
167maxRangeYesNo
168rangeYesNo