Updated on 2024-10-25 GMT+08:00

IoTDB Performance Tuning

Scenario

You can increase IoTDB memory to improve IoTDB performance because read and write operations are performed in HBase memory.

Configuration

Log in to Manager, choose Cluster > Services > IoTDB, and click the Configurations tab and then All Configurations. Search the parameters and modify their values.

For details, see Table 1.

Table 1 IoTDB performance optimization parameters

Parameter

Description

Default Value

Optimization Suggestion

SSL_ENABLE

Whether to encrypt the channel between the client and server using SSL

true

true indicates that SSL encryption is enabled, and false indicates that SSL encryption is disabled. Data encryption and decryption during transmission have a great impact on performance. The test result shows that the performance gap is 200%. Therefore, you are advised to disable SSL encryption during the performance test. The parameter for the ConfigNode and IoTDBServer roles must be both modified.

iotdb_server_kerberos_qop

Encrypted data transmission of each IoTDBServer instance in the cluster. This parameter is supported only by clusters with Kerberos authentication enabled.

auth-int

auth-int indicates that data transmission is encrypted, and auth indicates that data is authenticated only without being encrypted. Therefore, you are advised to set this parameter to auth. The parameter for the ConfigNode and IoTDBServer roles must be both modified.

GC_OPTS

Memory and garbage collection (GC) configuration parameters used by IoTDBServer. You need to set this parameter as required.

-Xms2G -Xmx2G -XX:MaxDirectMemorySize=512M -XX:+UseG1GC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=1M -Djdk.tls.ephemeralDHKeySize=3072

  • -Xms2G -Xmx2G indicates the IoTDB JVM heap memory. Set this parameter to a large value in the scenarios with a large number of time series and concurrent writes. You can adjust the parameter value based on the GC duration threshold alarm or heap memory threshold alarm. If an alarm is generated, increase the parameter value by 0.5 times. If this alarm is frequently generated, double the value. When you adjust HeapSize, set Xms and Xmx to the same value to avoid performance deterioration during dynamic heap size adjustment by JVM.
  • -XX:MaxDirectMemorySize indicates the IoTDB JVM direct memory. The recommended value is 1/4 of the heap memory. This parameter mainly affects the write performance. If the write performance deteriorates significantly, you can increase the parameter value by 0.5 times. Note that the sum of the heap memory and direct memory must be less than or equal to 80% of the available system memory. Otherwise, IoTDB fails to be started.
  • Query scenario optimization example: If the query range is large, for example, a single time series contains more than 10,000 data points, the quotient of 20% of the JVM memory allocated divided by the number of time series is recommended to be bigger than 160 KB for better performance of the storage engine in the default configuration.
  • For example, if there are 5 million sequences, the memory configuration is -Xms128G -Xmx128G.

write_read_schema_free_memory_proportion (MRS 3.3.0 and later versions: storage_query_schema_consensus_free_memory_proportion)

Memory allocation ratio: write, read, schema, and free

  • MRS 3.2.0: 4:3:1:2
  • MRS 3.3.0 and later versions: 3:3:1:1:2

You can adjust the memory based on the load.

  • A larger write memory means the better write throughput and single query performance.
  • A larger read memory means more supported concurrent queries.
  • A larger metadata memory means a lower probability of error message "IoTDB system load is too large".
  • A larger free memory means a lower probability of memory exhaustion.

iot_consensus_throttle_threshold_in_byte

Maximum size of the WAL directory, in bytes. The default maximum size is 50 GB. If the directory size exceeds the value you set, write operations are slowed down or rejected.

Only MRS 3.3.0 and later versions support this function.

‭53687091200‬

You can adjust the value based on the number of writes.

  • For a small number of concurrent writes, do not change the value.
  • If there are a large number of concurrent writes, increase the value.

data_region_iot_max_pending_batches_num

Maximum number of concurrent requests for synchronizing leader data copies to followers.

Only MRS 3.3.0 and later versions support this function.

12

You can adjust the value based on the CPU usage and pending WAL files. To use this parameter, select IoTDBServer(Role) > Customization and add this parameter and its value to engine.customized.configs.

  • For a small number of concurrent writes, do not change the value.
  • If there are a large number of concurrent writes, increase the value.
  • If there are a large number of pending WAL files, decrease the value.
  • If the CPU usage is greater than 80% for a long time, decrease the value.

avg_series_point_number_threshold

Maximum average number of memory data points. When this threshold is reached, data is flushed to Tsfile.

Only MRS 3.3.0 and later versions support this function.

10000

You can adjust the value based on the heap memory usage and GC duration.

  • If the GC duration is long, decrease the value.
  • If the memory usage is high, decrease the value.

flush_proportion

Write memory ratio for invoking disk flushing. If the write load is too high (for example, batch processing = 1000), you can decrease the value.

Only MRS 3.3.0 and later versions support this function.

0.4

You can adjust the value based on the heap memory usage. If the memory usage is high, decrease the value.