All Products
Search
Document Center

DataWorks:Pengendalian aliran sinkronisasi batch

Last Updated:Mar 04, 2026

Topik ini menjelaskan faktor-faktor yang memengaruhi kecepatan sinkronisasi data, cara memaksimalkan kecepatan dengan menyesuaikan konkurensi tugas, opsi pembatasan laju, serta skenario ketika sinkronisasi berjalan lambat.

Ikhtisar

  • Kecepatan sinkronisasi dipengaruhi oleh berbagai faktor, seperti konfigurasi tugas, kinerja database, dan kondisi jaringan. Untuk informasi selengkapnya, lihat Faktor yang memengaruhi kecepatan sinkronisasi data.

  • Sinkronisasi lambat dapat terjadi pada tahap mana pun dalam proses. Topik ini menyediakan solusi untuk kinerja lambat di setiap tahap. Untuk informasi selengkapnya, lihat Skenario dan solusi untuk sinkronisasi data lambat.

  • Ketika kinerja database menjadi kendala, lebih cepat tidak selalu lebih baik. Kecepatan sinkronisasi tinggi dapat memberikan tekanan berlebihan pada database produksi Anda. Data Integration menyediakan opsi pembatasan laju yang dapat Anda konfigurasi sesuai kebutuhan bisnis. Untuk informasi selengkapnya, lihat Batasi kecepatan sinkronisasi.

Faktor yang memengaruhi kecepatan sinkronisasi data

Kecepatan sinkronisasi data dipengaruhi oleh faktor-faktor seperti lingkungan database sumber dan tujuan serta konfigurasi tugas sinkronisasi. Anda bertanggung jawab utama untuk memantau dan mengoptimalkan kinerja, beban, serta kondisi jaringan database sumber dan tujuan Anda.

Faktor-faktor berikut memengaruhi kecepatan sinkronisasi data:

Factor

Description

Source data source

  • Database performance: CPU, memory, SSD, network, and disk.

  • Concurrency: The higher the concurrency of the data source, the higher the database load. Typically, better database performance allows for higher concurrency. This lets you configure more concurrent data extraction for your data synchronization job.

  • Network: Network bandwidth (throughput) and speed.

Scheduling resource group used by the offline sync task

Offline sync tasks are submitted by a scheduling resource group to a data integration resource group for execution. The usage of scheduling resources also affects the overall efficiency of data integration.

Offline sync task configuration

  • Transfer speed: Whether a maximum speed limit is set for the task.

  • Concurrency: The maximum number of threads for reading data from the source or writing data to the destination in parallel.

  • WAIT resources.

  • Bytes setting: The default value of Bytes for a single thread is 1048576. If the network speed is sensitive, timeouts may occur. In this case, set Bytes to a smaller value.

  • Whether query statements are indexed.

Destination data source

  • Performance: CPU, memory, SSD, network, and disk.

  • Load: A high load on the destination database can reduce the efficiency of data writing for the sync task.

  • Network: Network bandwidth (throughput) and speed.

Skenario dan solusi untuk sinkronisasi data lambat

Catatan

Untuk informasi selengkapnya tentang log tugas sinkronisasi offline, lihat Analisis log sinkronisasi offline.

Slow data synchronization scenarios

Symptom

Possible cause

Solution

Waiting for scheduling resources

  • Symptom 1: The task log shows that the task is waiting for the gateway.

  • Symptom 2: The instance properties page shows a long resource wait time.

Offline tasks are submitted by a scheduling resource group to the DPI engine for execution. If the scheduling resource group reaches its maximum task limit, new tasks must wait for running tasks to complete and release resources.

Go to the Operation Analysis page to see which tasks are using resources while the current task is waiting.

Catatan

If you use shared resource groups for scheduling, migrate your tasks to an exclusive resource group or a Serverless resource group.

Waiting for execution resources

The task log shows "wait".wait

The remaining resources in the data integration resource group are insufficient for the current task.

For example, a resource group supports a maximum of 8 concurrent tasks. Assume three tasks are submitted, each with a concurrency of 3. If two tasks start running simultaneously, they use a total of 6 concurrent slots, leaving 2 available. The third task, which requires 3 concurrent slots, must wait because the remaining resources are insufficient. The log for this task shows "wait".

Check if other tasks are running in the resource group and consuming a large amount of resources. You can resolve this issue in the following ways:

Catatan
  • Go to the Operation Analysis page to see which tasks are using resources and view resource usage while the current task is waiting.等待资源

  • The maximum number of concurrent tasks varies by resource group specification. For more information, see Performance metrics and billing.

  1. Check if the tasks that are using resources are stuck or running very slowly. If so, resolve these issues first or stop some of the tasks.

  2. If the tasks are not stuck, wait for the tasks using the data integration resources to complete. The resources will be released, and your task can start.

  3. You can also find the list of tasks using the resources and their owners. Coordinate with them to reduce the task concurrency.

  4. You can also reduce the concurrency of the current sync task and resubmit it.

  5. You can also scale out the resource group for the task. For more information, see Scaling operations.

Slow task execution speed

The task log shows run, but the speed is 0. This does not mean the task is not running. If the task remains in this state for a long time, you can click Detail log to view detailed execution information.运行慢If the Detail log shows a large value for the WaitReaderTime parameter, it indicates that the task is waiting a long time for data from the source.查看日志

  • The split key for the source is not configured properly.

    The data retrieval SQL generated from data splitting based on the split key runs slowly in the database.

  • The SQL statements for reading source data take too long to execute (such as the where or querySql parameters in some plug-ins).

    Example scenario: The where condition for a data synchronization task is not indexed, causing a full table scan that slows down synchronization.

  • The database load is high at the time of synchronization.

  • Network issues: Network bandwidth (throughput) and speed.

Catatan

Data synchronization speed over the public network cannot be guaranteed.

  • Slow statement execution:

    • When configuring pre-SQL or post-SQL statements:

      • Ensure that the fields used for data filtering are indexed to avoid full table scans.

      • Avoid or reduce complex processing such as functions. If necessary, perform these operations in the database before synchronization.

    • Check if the source data table is too large. If so, split the task into multiple smaller tasks.

    • Query the logs to find the SQL statement that is blocking execution and consult a database administrator to resolve the issue.

  • Check the database load at the corresponding time.

The task log shows run, but the speed is 0. This does not mean the task is not running. If the task remains in this state for a long time, you can click Detail log to view detailed execution information.运行慢If the Detail log shows a large value for the WaitWriterTime parameter, it indicates that writing to the destination is taking a long time.

  • The pre-SQL or post-SQL statements configured in the writer plug-in are running slowly (such as the SQL configured in the preSql or postSql parameters).

  • The database load is high at the time of synchronization.

  • Network issues: Network bandwidth (throughput) and speed.

Catatan

Data synchronization speed over the public network cannot be guaranteed.

The log shows run and a non-zero speed, but the synchronization process is slow.日志

  • The split key for a relational database task is not configured properly. This makes the concurrency setting ineffective and causes the task to run with a single concurrent thread.

  • The concurrency setting is too low.

  • A large amount of dirty data is generated during synchronization, which affects the speed.

  • Database performance issues.

    Catatan

    Better database performance supports higher concurrency, which lets you increase the concurrency setting for the data synchronization job.

  • Network issues: Network bandwidth (throughput) and speed.

Catatan

Data synchronization speed over the public network cannot be guaranteed.

  1. Set the split key properly. For more information about configuring a split key, see Configure a task in the codeless UI.

  2. Within the maximum concurrency supported by the resource group, plan the concurrency for each task and increase the concurrency for the current task as needed.

    You can configure the concurrency of a task in the codeless UI to specify its degree of parallelism. The following example shows how to configure concurrency in the code editor.Log

    Catatan

    The maximum number of concurrent tasks varies by resource group specification. For more information, see Performance metrics and billing.

  3. Handle dirty data. For more information about dirty data, see Data Integration.

  4. For distributed tasks, the task concurrency must meet the following requirement: The task concurrency divided by the number of machines in the resource group must be less than or equal to the maximum concurrency supported by a single machine in the resource group.

  5. When synchronizing data across clouds or regions, establish a network connection and use the private network for synchronization. For more information about network connectivity solutions, see Network connectivity solutions.

  6. Check the database load.

Batasi kecepatan sinkronisasi

Secara default, tugas Data Integration tidak dibatasi lajunya. Tugas berjalan dengan kecepatan tertinggi yang mungkin dalam batas konkurensi yang dikonfigurasi. Namun, kecepatan tinggi dapat memberikan tekanan berlebihan pada database produksi Anda. Data Integration menyediakan opsi pembatasan laju yang dapat Anda konfigurasi sesuai kebutuhan. Kami menyarankan agar Anda tidak mengatur batas kecepatan maksimum melebihi 30 MB/s. Contoh berikut menunjukkan cara mengonfigurasi pembatasan laju sebesar 1 MB/s di code editor.

"setting": {
      "speed": {
         "throttle": true, // Specifies whether to enable rate limiting.
        "mbps": 1, // The specific rate in MB/s.
      }
    }
  • throttle dapat diatur ke true atau false:

    • Jika Anda mengatur throttle ke true, pembatasan laju diaktifkan. Anda harus menetapkan nilai spesifik untuk mbps. Jika Anda tidak menetapkan mbps, program akan gagal atau laju akan abnormal.

    • Jika Anda mengatur throttle ke false, pembatasan laju dinonaktifkan, dan pengaturan mbps diabaikan.

  • Ukuran traffic adalah nilai yang diukur oleh Data Integration sendiri dan tidak merepresentasikan traffic NIC (network interface controller) aktual. Biasanya, traffic NIC adalah 1 hingga 2 kali lipat traffic channel. Inflasi traffic aktual bergantung pada serialisasi data dari sistem penyimpanan data tertentu.

  • File tunggal semi-terstruktur tidak memiliki split key. Untuk beberapa file, Anda dapat mengatur batas laju pekerjaan untuk meningkatkan kecepatan sinkronisasi. Batas laju pekerjaan berkaitan dengan jumlah file.

    Misalnya, jika terdapat n file, batas laju pekerjaan maksimum yang dapat Anda tetapkan adalah n MB/s:

    • Jika Anda menetapkan batas ke n+1 MB/s, kecepatan sinkronisasi tetap n MB/s.

    • Jika Anda menetapkan batas ke n-1 MB/s, kecepatan sinkronisasi menjadi n-1 MB/s.

  • Untuk database relasional, Anda harus menetapkan batas laju pekerjaan dan split key untuk membagi tabel berdasarkan batas laju tersebut. Database relasional biasanya hanya mendukung split key numerik. Namun, database Oracle mendukung split key numerik maupun string.

FAQ

  • FAQ tentang sinkronisasi offline.

  • Parameter BatchSize atau maxfilesize mengontrol jumlah record dalam satu commit batch. Nilai yang lebih besar dapat mengurangi interaksi jaringan dengan database dan meningkatkan throughput. Namun, jika nilai ini terlalu besar, dapat menyebabkan error out-of-memory (OOM) dalam proses sinkronisasi data. Jika error ini terjadi, lihat FAQ tentang sinkronisasi offline.

Lampiran: Lihat konkurensi aktual

Pada halaman detail log tugas sinkronisasi data, Anda dapat menemukan entri log yang mirip dengan JobContainer - Job set Channel-Number to 2 channels. Nilai channels adalah konkurensi aktual tugas tersebut.查看实际并发

Lampiran: Hubungan antara konkurensi dan penggunaan resource

Dalam kelompok sumber daya eksklusif, penggunaan resource melibatkan hubungan antara konkurensi dengan CPU dan memori:

  • Hubungan antara konkurensi dan penggunaan CPU

    Dalam kelompok sumber daya eksklusif, rasio konkurensi terhadap CPU adalah 1:0,5. Artinya, instance ECS dengan 4 vCPU dan memori 8 GiB menyediakan kuota konkurensi sebesar 8 untuk kelompok sumber daya eksklusifnya. Kelompok tersebut dapat menjalankan maksimal 8 tugas sinkronisasi offline dengan konkurensi 1, atau 4 tugas sinkronisasi offline dengan konkurensi 2.

    Jika konkurensi yang dibutuhkan oleh tugas baru yang dikirimkan ke kelompok sumber daya eksklusif lebih besar daripada kuota konkurensi tersisa kelompok tersebut, tugas baru harus menunggu. Tugas tersebut akan mulai berjalan setelah tugas-tugas yang sedang berjalan selesai dan kuota konkurensi tersisa mencukupi untuk tugas baru tersebut.

    Catatan

    Jika konkurensi yang ditetapkan untuk tugas baru melebihi kuota konkurensi maksimum kelompok sumber daya eksklusif, tugas tersebut akan menunggu resource tanpa batas. Misalnya, jika Anda mengirimkan tugas dengan konkurensi 10 ke kelompok sumber daya eksklusif pada instance ECS dengan 4 vCPU dan memori 8 GiB, tugas tersebut tidak akan pernah berjalan. Karena kelompok sumber daya mengalokasikan resource berdasarkan urutan pengiriman, tugas-tugas berikutnya juga akan terblokir.

  • Hubungan antara konkurensi dan penggunaan memori

    Dalam kelompok sumber daya eksklusif, penggunaan memori untuk satu tugas dihitung sebagai Min{768 + (concurrency - 1) × 256, 8029} MB. Namun, Anda dapat mengganti hubungan ini dalam pengaturan tugas. Di code editor, atur path JSON $.setting.jvmOption dalam teks konfigurasi JSON.jvm

    Untuk memastikan eksekusi tugas yang stabil, total memori yang digunakan oleh semua tugas yang sedang berjalan harus setidaknya 1 GB lebih kecil dari total memori semua mesin dalam kelompok sumber daya eksklusif. Jika kondisi ini tidak terpenuhi, mekanisme Linux OOM Killer dapat secara paksa menghentikan tugas-tugas tersebut.

    Catatan

    Jika Anda tidak menggunakan code editor untuk menambah memori tugas, Anda hanya perlu mempertimbangkan batas kuota konkurensi kelompok sumber daya eksklusif saat mengirimkan tugas.

Lampiran: Kecepatan sinkronisasi

Kecepatan baca dan tulis konkuren sangat bervariasi di antara sumber data yang berbeda. Tabel berikut mencantumkan kecepatan sinkronisasi rata-rata per konkurensi tunggal untuk sumber data khas dalam kelompok sumber daya eksklusif:

  • Kecepatan rata-rata per konkurensi tunggal untuk berbagai Writer plug-in

    Writer

    Average single-concurrency speed (KB/s)

    AnalyticDB for PostgreSQL

    147,8

    AnalyticDB for MySQL

    181,3

    ClickHouse

    5259,3

    DataHub

    45,8

    DRDS

    93,1

    Elasticsearch

    74,0

    FTP

    565,6

    GDB

    17,1

    HBase

    2395,0

    hbase20xsql

    37,8

    HDFS

    1301,3

    Hive

    1960,4

    HybridDB for MySQL

    323,0

    HybridDB for PostgreSQL

    116,0

    Kafka

    0,9

    LogHub

    788,5

    MongoDB

    51,6

    MySQL

    54,9

    ODPS

    660,6

    Oracle

    66,7

    OSS

    3718,4

    OTS

    138,5

    PolarDB

    45,6

    PostgreSQL

    168,4

    Redis

    7846,7

    SQLServer

    8,3

    Stream

    116,1

    TSDB

    2,3

    Vertica

    272,0

  • Kecepatan rata-rata per konkurensi tunggal untuk berbagai Reader plug-in

    Reader

    Average single-concurrency speed (KB/s)

    AnalyticDB for PostgreSQL

    220,3

    AnalyticDB for MySQL

    248,6

    DRDS

    146,4

    Elasticsearch

    215,8

    FTP

    279,4

    HBase

    1605,6

    hbase20xsql

    465,3

    HDFS

    2202,9

    Hologres

    741,0

    HybridDB for MySQL

    111,3

    HybridDB for PostgreSQL

    496,9

    Kafka

    3117,2

    LogHub

    1014,1

    MongoDB

    361,3

    MySQL

    459,5

    ODPS

    207,2

    Oracle

    133,5

    OSS

    665,3

    OTS

    229,3

    OTSStream

    661,7

    PolarDB

    238,2

    PostgreSQL

    165,6

    RDBMS

    845,6

    SQLServer

    143,7

    Stream

    85,0

    Vertica

    454,3