Hi Team, i am using Airbyte open source(1.4.0v) in...
# replication-troubleshooting
m
Hi Team, i am using Airbyte open source(1.4.0v) in kubernetes cluster. where running one job with mssql db connector for a table with size of 600Million record. earlier it was scheduling on a pod with 13G of memory limit, but failing. Now we have increased the limit to 42G of memory with 4000CPU. main issue is like it is consuming all the memory and after loading some amount of data( like: 100 million) it is getting failed and starting again from 0 value (retry attempt). same table in another region which has 50 million record, was failing on 13G memory pod but with 42G pod it has got successfully loaded. I tried changing the values at source config and destination config, but still memory usage is reaching to maximum. source config: MSSQL DB and CDC enabled. size of queue = reduced the value from 10,000 --> 5000 --> 2000 --> 1000 --> 500 and now it is having only 100 value. Destination config: s3 bucket using parquet format. Block size = tried value 512, 256, 128, 65, 32, 16. compression code: snappy Dictionary page size(KB) = 1024 --> 512 --> 256 --> 128 page size = 1024 --> 512 --> 256 --> 128 max padding size(KB) = 16 --> 8 replication job pod configuration: CPU : request = 500m, limit = 4000m MEMORY : request = 1.5Gi, limit = 42Gi 1) Now the question is how can we load these 600Million records within given memory limit using open source airbyte(1.4.0v). 2) what could be the best values for these config so that data load wont get failed even though it uses maximum memory. 3) Is there any other config we have in airbyte to reduce the batch size at source end, if yes then how can we enable it. Please guide me to load this 600 million table data successfully in S3 bucket.
k
You are encountering Java heap space (out-of-memory) errors when syncing very large tables (hundreds of millions of records) from MSSQL (CDC enabled) to S3 (Parquet) using Airbyte OSS 1.4.0 on Kubernetes, even after increasing pod memory to 42Gi. Here’s what is known from the knowledge sources and what you can try: --- ### 1. How can you load 600 million records within the given memory limit? Key Points: - Airbyte’s source workers read up to 10,000 records into memory by default, which can cause OOM errors for large tables or wide rows. Lowering the batch size (queue size) can help, but there are limits to how much this helps, especially for very large tables or wide records. There is no user-exposed config to set a byte-based batch limit; batching is still record-count based in current versions [[Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale)]. - Even with high memory limits, Java connectors (which most database sources are) may not use all available memory due to JVM defaults. You must ensure that the JVM heap is allowed to use the memory you allocate (see below) [[Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale)]. What you can do: - Set JVM Heap Size Explicitly: Make sure your pod/container’s Java process is allowed to use the full memory limit. Use the
JAVA_OPTS
environment variable to set
-Xmx
(max heap size) or
-XX:MaxRAMPercentage
appropriately. For example:
Copy code
JAVA_OPTS: "-XX:MaxRAMPercentage=80.0"
This ensures the JVM can use up to 80% of the container’s memory [[Github Issue 51616](https://github.com/airbytehq/airbyte/issues/51616)]. - Reduce Source Batch Size: You have already reduced the queue size from 10,000 down to 100. This is the main lever available in current Airbyte versions. There is no documented way to batch by bytes instead of records as of now [[Github Issue 3439](https://github.com/airbytehq/airbyte/issues/3439)]. - Monitor Actual Heap Usage: Sometimes, even with high memory limits, the JVM may not use all available memory due to misconfiguration. Double-check your pod/container logs to confirm the heap size at runtime [[Github Issue 51616](https://github.com/airbytehq/airbyte/issues/51616)]. - Split the Sync: If possible, split the table into smaller logical partitions (e.g., by date or ID range) and sync them separately. This is a workaround, but sometimes necessary for very large tables [[Forum CockroachDB OOM](https://discuss.airbyte.io/t/1261)]. --- ### 2. What are the best values for these configs to avoid OOM? - Source batch size (queue size): As low as possible without severely impacting throughput. You have already set it to 100, which is the lowest practical value. - Destination Parquet block size: Lower values reduce memory usage but may impact performance. You have already tried values down to 16MB. The Parquet docs recommend 128–1024MB, but for memory-constrained jobs, lower is better [[S3 Parquet Docs](https://docs.airbyte.com/integrations/destinations/s3#parquet)]. - JVM Heap: Set
JAVA_OPTS
as above to ensure the JVM can use most of the pod’s memory. - Pod memory limit: You have set 42Gi, which is very high. If you still OOM, the issue is likely not just the limit, but how the JVM is configured or a connector memory leak. There is no “magic” config that guarantees success for all large tables. The main levers are batch size, JVM heap config, and (if possible) partitioning the data. --- ### 3. Is there any other config to reduce batch size at the source end? - No documented config exists to batch by bytes instead of records. The current batching is by record count, not by total byte size, which is a known limitation and open feature request [[Github Issue 3439](https://github.com/airbytehq/airbyte/issues/3439)]. - No user-exposed config for fetch size in all connectors. Some connectors may have internal logic to adjust fetch size, but this is not generally user-configurable [[Forum Post](https://discuss.airbyte.io/t/1168)]. --- ### Additional Recommendations - Monitor for Memory Leaks: There have been reports of connectors using more memory than expected, possibly due to memory leaks. If you consistently see memory usage far exceeding the expected size for your batch, consider opening a GitHub issue with logs [[Forum CockroachDB OOM](https://discuss.airbyte.io/t/1261)]. - Upgrade Airbyte: If possible, try a newer version of Airbyte, as there have been improvements in memory handling and batching logic in later releases. --- ### Summary - You are already using the main available levers: reducing batch size and lowering Parquet block size. - Ensure your JVM heap is configured to use the full pod memory. - There is no config to batch by bytes instead of records as of Airbyte 1.4.0. - For extremely large tables, consider partitioning the sync if possible. - If you continue to hit OOM, it may be a connector limitation or memory leak. For more details, see the official docs on [scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale) and [S3 Parquet configuration](https://docs.airbyte.com/integrations/destinations/s3#parquet). If you need further help, consider opening a GitHub issue with detailed logs and configuration [[Github Issue 51616](https://github.com/airbytehq/airbyte/issues/51616)]. --- If you need more specific guidance, please provide connector versions, Airbyte logs, and JVM heap settings at runtime.
m
@kapa.ai can i get some more information as per below queries. 1. i can see in the airbyte job logs, record fetching value in 10000. so means connector is fetching records in 10k batches. can we change this value.if yes then how? 2. I am not seeing any config related to java-jvm or heap related in values.yaml file. so how can i configure these.? and if it has a default value set then how can we get to know whether it is affecting/causing the failure or not.? which pod log/keyword can help? 3. if we set the queue size as in 100 then why still airbyte is fetching the records in 10k batches.? 4. Is there anything or enhanced feature in enterprise version, which can help in loading these many records table data without any failure with limited memory.
k
A message from kapa.ai
Certainly! Here are answers to your queries, strictly based on the provided knowledge sources: --- ### 1. Can we change the 10,000 record batch fetch size? If yes, how? Airbyte source connectors typically fetch records in batches of 10,000 by default. This batch size is not directly user-configurable in most connectors. There have been improvements to make the fetch size dynamic in some connectors, but there is no general user-facing configuration to set this value. The batch size is still record-based, not byte-based, and this is a known limitation and open feature request [[Github Issue 3439](https://github.com/airbytehq/airbyte/issues/3439); [Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale)]. > "Sources read data in batches. It’s not possible to know what the size of these batches are before reading them. For destination connectors: destinations read records until they hit a batch size, which is currently set at 10k records. This can cause out of memory errors for tables with large row sizes..." > [Forum: How memory request and limit works under the hood](https://discuss.airbyte.io/t/2214) --- ### 2. How can I configure Java JVM/heap settings? How to check if defaults are causing failures? You can set JVM options (like heap size) using the
JAVA_OPTS
environment variable. This is not set in
values.yaml
by default, but you can add it under the
env_vars
section. For example:
Copy code
yaml env_vars:   JAVA_OPTS: "-XX:MaxRAMPercentage=80.0"
By default, Java may only use a fraction (often 1/4) of the container's memory, which can cause OOM errors even if the pod has more memory available. To check if this is affecting you, look for
java.lang.OutOfMemoryError
or
heap space
in your job pod logs. The logs from the source or destination connector pods will show these errors [[Forum: Mysql to clickhouse fails with Memory exception](https://discuss.airbyte.io/t/3401); [Github Issue 51616](https://github.com/airbytehq/airbyte/issues/51616)]. --- ### 3. Why does Airbyte fetch 10k records per batch even if queue size is set to 100? The "queue size" you are referring to likely controls the internal buffer or queue between source and destination, not the actual fetch size from the source database. The fetch size from the source is still set to 10,000 records per batch in most connectors, and there is no user-exposed config to reduce this further. This is a known limitation [[Github Issue 3439](https://github.com/airbytehq/airbyte/issues/3439); [Forum: How memory request and limit works under the hood](https://discuss.airbyte.io/t/2214)]. --- ### 4. Does the enterprise version have enhanced features for large table syncs with limited memory? The knowledge sources do not mention any specific enhanced features in the Airbyte enterprise version that address this particular limitation (batching by bytes, more efficient memory usage for very large tables, etc.). The described limitations and configuration options apply to the open-source version, and there is no explicit mention of enterprise-only features that solve this problem [[Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale)]. --- Summary: - The 10,000 record batch size is not user-configurable in most connectors. - Set JVM heap via
JAVA_OPTS
in your deployment config; check logs for OOM errors. - Queue size does not control source fetch batch size. - No evidence in the sources of enterprise features that specifically address this memory/batching limitation. If you need more control over batching or memory, you may need to partition your data or monitor for connector updates that address these issues.
m
@kapa.ai suggest me how can i load this data without any failure with this 42G of maximum memory limit via airbyte with full refresh mode.
k
A message from kapa.ai
To load a very large table (600 million records) from MSSQL to S3 (Parquet) in full refresh mode using Airbyte OSS with a 42Gi memory limit, here are the best practices and limitations based on the knowledge sources: --- ### 1. Ensure JVM Heap Can Use the Full Memory Limit By default, Java may only use a fraction of the container’s memory. Set the
JAVA_OPTS
environment variable to allow the JVM to use most of the pod’s memory. For example:
Copy code
yaml env_vars:   JAVA_OPTS: "-XX:MaxRAMPercentage=80.0"
This ensures the Java process can use up to 80% of the container’s memory, which is critical for large syncs [[Scaling Airbyte](https://discuss.airbyte.io/t/3401)]. --- ### 2. Lower Parquet Block Size and Page Size You have already tried reducing the Parquet block size and page size. Continue using the lowest values that do not severely impact performance, as this reduces memory usage during writes [[S3 Parquet Docs](https://docs.airbyte.com/integrations/destinations/s3#parquet)]. --- ### 3. Reduce Internal Batch/Queue Size While the source fetch batch size is not user-configurable and defaults to 10,000 records, lowering the internal queue size (if available in your connector) can help reduce peak memory usage. However, this does not change the fetch size from the source, which is a known limitation [[Forum: How memory request and limit works under the hood](https://discuss.airbyte.io/t/2214)]. --- ### 4. Monitor for Out-of-Memory Errors Check your job logs for
java.lang.OutOfMemoryError
or
heap space
errors. If you see these errors even after setting the JVM heap correctly, it may indicate a connector memory leak or a fundamental limitation with the current batching approach [[Github Issue 51616](https://github.com/airbytehq/airbyte/issues/51616)]. --- ### 5. Partition the Sync (if possible) If you continue to hit memory limits, consider splitting the table into smaller logical partitions (e.g., by date or ID range) and syncing them separately. This is a common workaround for very large tables and is often necessary when batch size cannot be further reduced [[Forum CockroachDB OOM](https://discuss.airbyte.io/t/1261)]. --- ### 6. No Config to Batch by Bytes Currently, Airbyte does not support batching by bytes instead of records, which is a known limitation and open feature request [[Github Issue 3439](https://github.com/airbytehq/airbyte/issues/3439)]. --- ### 7. No Enterprise-Only Solution There is no mention in the knowledge sources of an enterprise-only feature that would solve this specific memory/batching limitation. --- In summary: - Set
JAVA_OPTS
to allow the JVM to use most of your 42Gi memory. - Use the lowest practical Parquet block and page sizes. - Lower internal queue size if possible, but know that source fetch size is not user-configurable. - Monitor logs for OOM errors. - If you still fail, partition the sync into smaller jobs. If you follow these steps and still encounter failures, it is likely due to a fundamental limitation in how Airbyte batches records in memory, and you may need to wait for future improvements or open a GitHub issue with detailed logs for further investigation.