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
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

Spark On Hudi Performance Optimization

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

Optimizing Spark Shuffle Parameters to Improve Hudi Write Efficiency

  • If spark.shuffle.readHostLocalDisk is set to true, the local disk reads shuffle data, reducing network transmission overhead.
  • If spark.io.encryption.enabled is set to false, the shuffle process is disabled from writing encrypted disks, improving the shuffle efficiency.
  • Set spark.shuffle.service.enabled to true to enable the shuffle service and improve the stability of the shuffle task.

Configuration Item

Cluster Default Value

After adjustment

--conf spark.shuffle.readHostLocalDisk

false

true

--conf spark.io.encryption.enabled

true

false

--conf spark.shuffle.service.enabled

false

true

Adjusting Spark Scheduling Parameters to Optimize the Spark Scheduling Delay in OBS Scenarios

  • If OBS storage is enabled, Spark locality can be disabled to improve Spark scheduling efficiency.

Configuration Item

Cluster Default Value

After adjustment

--conf spark.locality.wait

3s

0s

--conf spark.locality.wait.process

3s

0s

--conf spark.locality.wait.node

3s

0s

--conf spark.locality.wait.rack

3s

0s

Optimizes the shuffle parallelism and improves the Spark processing efficiency.

The following figure shows the shuffle concurrency.

The default cluster size is 200. You can set the job size separately. If the bottleneck stage (long execution time) is found and the number of cores allocated to the current job is greater than the number of concurrent jobs, the concurrency is insufficient. Optimize the configuration as follows:

Scenario

Configuration Item

Cluster Default

After adjustment

Jar Job

spark.default.parallelism

200

Set this parameter to twice the number of available resources in the actual job.

SQL Job

spark.sql.shuffle.partitions

200

Set this parameter to twice the number of available resources in the actual job.

Hudi Warehousing Operation

hoodie.upsert.shuffle.parallelism

200

Used by non-bucket tables. Set this parameter to twice the number of available resources.

CAUTION:

When spark.dynamicAllocation.enabled is set to true, resources are evaluated based on spark.dynamicAllocation.maxExecutors.

Bucket table. Bucket tailoring can be enabled to improve primary key click query efficiency.

Example:

The service uses the primary key ID as the query condition to perform the point query. For example, select xxx where id = idx...

When creating a table, you can add the following attributes to improve the query efficiency. By default, the attribute value is primaryKey, that is, primary key.

hoodie.bucket.index.hash.field=id

When initializing a Hudi table, you can quickly write data in BulkInsert mode.

Example:

set hoodie.combine.before.insert=true; //: deduplicates the data before the database is imported. If the data is not duplicate, you do not need to set this parameter.
set hoodie.datasource.write.operation = bulk_insert; // specifies the bulk insert mode.
set hoodie.bulkinsert.shuffle.parallelism = 4; // specifies the degree of parallelism during bulk_insert data writing, which is equal to the number of partition parquet files saved after data writing.
insert into dsrTable select * from srcTabble

Enable log column tailoring to improve the query efficiency of the mor table.

When the mor table is read, logs and Parquet are combined, and the performance is not satisfactory. Log column tailoring can be enabled to reduce the I/O read overhead during combination.

Run the following command to query the SparkSQL database:

set hoodie.enable.log.column.prune=true;

Other parameters are optimized when Spark processes Hudi tables.

  • Set spark.sql.enableToString to false to reduce the memory usage when Spark parses complex SQL statements and improve the parsing efficiency.
  • If spark.speculation is set to false, speculative execution is disabled. Enabling this parameter consumes extra CPU resources. In addition, Hudi does not support this parameter. If this parameter is enabled, files may be damaged.

Configuration Item

Cluster Default

After adjustment

--conf spark.sql.enableToString

true

false

--conf spark.speculation

false

false

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