mithlesh kumar sahu
09/19/2025, 12:12 PMkapa.ai
09/19/2025, 12:12 PMJAVA_OPTS environment variable to set -Xmx (max heap size) or -XX:MaxRAMPercentage appropriately. For example: 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.mithlesh kumar sahu
09/19/2025, 1:04 PMkapa.ai
09/19/2025, 1:04 PMkapa.ai
09/19/2025, 1:05 PMJAVA_OPTS environment variable. This is not set in values.yaml by default, but you can add it under the env_vars section. For example: 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.mithlesh kumar sahu
09/20/2025, 7:53 AMkapa.ai
09/20/2025, 7:53 AMkapa.ai
09/20/2025, 7:54 AMJAVA_OPTS environment variable to allow the JVM to use most of the pod’s memory. For example: 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.