Performance Tuning
Setting Synchronization Task Parameters
- max_full_sync_task_threads_num: number of full synchronization threads. By default, it is set to half of the vCPUs on FE nodes. Increasing this value will make full synchronization faster, but more vCPUs and memory of OLTP and OLAP will be consumed. Set an appropriate value for this parameter based on the system load when executing a full synchronization task. If multiple full synchronization tasks are executed at the same time, decrease this parameter value.
- max_incremental_sync_task_threads_num: number of incremental synchronization threads. By default, it is set to half of the vCPUs on FE nodes. A larger value indicates that more threads are used for incremental synchronization, more resources are consumed, and the synchronization latency is shorter. If there are more than five synchronization tasks on an instance, reduce the number of synchronization threads for each task.
- expect_tablet_size: expected size of source data stored in each bucket, in GB. The default value is 3. If most tables in a database have less than 3 GB of data, but there are a few tables with a significant amount of data, decrease this value.
- expect_tablet_num_for_one_partition: expected default number of buckets in each partition. If this parameter is set to 0, the number of buckets is calculated based on the data size. The default value is 2. If there is no data in a table, this default value will be used. If there is data in a table, the number of buckets is calculated as follows: Data size/Value of expect_tablet_size. If a partition key is specified for table synchronization, you need to evaluate the number of buckets required for data in each partition. The number of buckets for a table is calculated as follows: Number of partitions x Number of buckets in each partition.
- Query cache
The query cache is suitable for scenarios where data can be categorized as hot data and cold data and aggregate queries are frequently executed. To enable the query cache, use DAS to connect to the OLAP database and execute SET GLOBAL enable_query_cache=true;
- Sorting keys
Add commonly used filter criteria to sorting keys. The order of the sorting keys should be determined based on their usage frequency and data cardinality, with priority given to high cardinality. You are advised to set no more than five sorting keys. Sorting keys are widely used for tuning OLAP performance. When creating a synchronization task, you can use table synchronization to set sorting keys.
- Partitions
A time column whose value does not change is often used for the WHERE filtering. Use the column to create partitions. When creating a synchronization task, you can use table synchronization to set partitions.
- Indexes
Add indexes to the columns used for filtering. Bitmap indexes are suitable for columns with a cardinality of around 10,000 to 100,000. Bloom filter indexes are suitable for columns with a cardinality of more than 100,000. After data is synchronized, you can connect to the OLAP database through DAS and run SQL commands to create indexes.
- Materialized views
If there are multiple frequently used queries with different filter criteria and sorting keys can only adapt to one query, create a materialized view to adapt to other queries. After data is synchronized, you can connect to the OLAP database through DAS and run SQL commands to create materialized views.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot