Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Enhancing the Data Import Performance of OpenSearch Clusters

Updated on 2025-01-23 GMT+08:00

Overview

This unique CSS feature significantly improves data import performance and reduces write rejections through bulk route optimization, text index acceleration, and word segmentation acceleration. You are advised to use this feature for clusters that contain a large number of index shards and text indexes, or have a high inbound data throughput.

Table 1 Ways to improve data import performance

Method

Description

Details

Bulk route optimization

According to the default routing rule of Elasticsearch, each piece of data in a bulk request is routed to a different shard. When a large amount of data is written in and a large number of index shards exist, excessive internal request forwarding may trigger bulk rejection. Additionally, in a large-scale cluster, the long tail effect causes a high latency for bulk requests.

You can specify the index.bulk_routing configuration item to enable bulk route optimization. You can use it to reduce the number of requests that need to be internally forwarded. For a cluster that has a large number of shards, this setting can improve write performance and reduce bulk rejection.
NOTE:

After bulk route optimization is enabled (that is, index.bulk_routing is set to pack or local_pack), data writes are no longer routed based on _id, and routing-related functionality may be affected. For example, ID-based GET requests may fail.

Bulk Route Optimization

Bulk aggregation optimization

You can specify the index.aggr_perf_batch_size configuration item to enable or disable bulk aggregation optimization. When bulk aggregation optimization is enabled, documents in a bulk request are written in batches, rather than individually. This helps to reduce the overheads of memory requests, lock requests, and other calls, improving data import performance.

Bulk Aggregation Optimization

Text index acceleration

You can configure index.native_speed_up to enable or disable text index acceleration. This setting optimizes the indexing process and memory access to accelerate index building for text fields (text and keyword). When text index acceleration is enabled, you can configure index.native_analyzer to enable word segmentation acceleration as well. For texts that need common word segmentation, you can use the analyzer to accelerate word segmentation.
NOTE:
  • Word segmentation acceleration can be enabled (set index.native_analyzer to true) only when text index acceleration is enabled (set index.native_speed_up to true). Otherwise, word segmentation acceleration will not take effect.
  • Text index acceleration cannot be enabled for indexes that contain nested fields.

Text Index Acceleration

Index merge task optimization

Enabling the three optimization options above will increase the number of index merge tasks in the cluster. You can configure index.merge.scheduler.max_thread_count to reduce the impact of index merge tasks on data import performance. The optimization is about increasing the number of shard merging threads and thereby alleviate the throttling of data import.

Index Merge Task Optimization

Constraints

Only Elasticsearch 7.10.2 and OpenSearch 1.3.6 clusters support data import performance enhancement.

Prerequisites

The cluster whose data import performance you want to enhance is in the Available state.

Bulk Route Optimization

You can specify the index.bulk_routing configuration item to enable bulk route optimization. You can use it to reduce the number of requests that need to be internally forwarded. For a cluster that has a large number of shards, this setting can improve write performance and reduce bulk rejection.
NOTE:

After bulk route optimization is enabled (that is, index.bulk_routing is set to pack or local_pack), data writes are no longer routed based on _id, and routing-related functionality may be affected. For example, ID-based GET requests may fail.

  1. Choose Clusters in the navigation pane. On the Clusters page, select an available cluster, and click Access Kibana in the Operation column.
  2. In the navigation tree on the left on the Kibana console, choose Dev Tools.
  3. On the Dev Tools page, run the following command to enable bulk route optimization:
    PUT my_index 
    {
      "settings": { 
        "index.bulk_routing": "local_pack"
      } 
    }
    The options for the index.bulk_routing configuration item are as follows:
    • default: Use the default routing mechanism. Records in a bulk request are split and then routed separately.
    • pack: All data of a single bulk request is randomly routed to the same shard.
    • local_pack: The data of a single bulk request is routed to a local shard of the data node that has received the bulk request. If the node does not contain the corresponding index shard, the data is randomly routed to another node that contains the index shard. This solution depends on the random distribution of client bulk requests and the balanced distribution of primary shards.

Bulk Aggregation Optimization

You can specify the index.aggr_perf_batch_size configuration item to enable or disable bulk aggregation optimization. When bulk aggregation optimization is enabled, documents in a bulk request are written in batches, rather than individually. This helps to reduce the overheads of memory requests, lock requests, and other calls, improving data import performance.

  1. Choose Clusters in the navigation pane. On the Clusters page, select an available cluster, and click Access Kibana in the Operation column.
  2. In the navigation tree on the left on the Kibana console, choose Dev Tools.
  3. On the Dev Tools page, run the following command to enable bulk aggregation optimization:
    PUT my_index 
    {
      "settings": { 
        "index.aggr_perf_batch_size": "128"
      } 
    }

    The value range of the index.aggr_perf_batch_size configuration item is [1, Integer.MAX_VALUE]. The default value is 1, indicating that bulk aggregation optimization is disabled. If the value is greater than 1, bulk aggregation optimization is enabled, the value of MIN(bulk_doc_size, aggr_perf_batch_size) indicates the bulk size.

Text Index Acceleration

You can configure index.native_speed_up to enable or disable text index acceleration. This setting optimizes the indexing process and memory access to accelerate index building for text fields (text and keyword). When text index acceleration is enabled, you can configure index.native_analyzer to enable word segmentation acceleration as well. For texts that need common word segmentation, you can use the analyzer to accelerate word segmentation.
NOTE:
  • Word segmentation acceleration can be enabled (set index.native_analyzer to true) only when text index acceleration is enabled (set index.native_speed_up to true). Otherwise, word segmentation acceleration will not take effect.
  • Text index acceleration cannot be enabled for indexes that contain nested fields.
  1. Choose Clusters in the navigation pane. On the Clusters page, select an available cluster, and click Access Kibana in the Operation column.
  2. In the navigation tree on the left on the Kibana console, choose Dev Tools.
  3. On the Dev Tools page, run the following command to enable text index acceleration:
    PUT my_index 
    {
      "settings": {
        "index.native_speed_up": true,
        "index.native_analyzer": true
      }
    }

    The values of index.native_speed_up and index.native_analyzer are true or false. The default value is false.

Index Merge Task Optimization

Enabling the three optimization options above will increase the number of index merge tasks in the cluster. You can configure index.merge.scheduler.max_thread_count to reduce the impact of index merge tasks on data import performance. The optimization is about increasing the number of shard merging threads and thereby alleviate the throttling of data import.

  1. Choose Clusters in the navigation pane. On the Clusters page, select an available cluster, and click Access Kibana in the Operation column.
  2. In the navigation tree on the left on the Kibana console, choose Dev Tools.
  3. On the Dev Tools page, run the following command to start index merge task optimization:
    PUT my_index 
    {
      "settings": {
        "index.merge.scheduler.max_thread_count": 8
      }
    }

    The value range of index.merge.scheduler.max_thread_count is [1, node.processors/2]. The default value is 4, and the recommended value is 8.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback