We’re facing a serious issue with Airbyte OSS. Ear...
# replication-troubleshooting
b
We’re facing a serious issue with Airbyte OSS. Earlier, all our connections (around 10 GB of data) from MySQL to Snowflake were syncing successfully without any problems. However, recently we’ve started encountering OOM (Out of Memory) errors, and the logs show the following line: [ASYNC QUEUE INFO] Global: max: 5.79 GB It seems like the global async queue buffer size has increased significantly. Is there any way to reduce or control this buffer size to prevent OOM issues?
k
The OOM (Out of Memory) errors you're experiencing are likely related to Airbyte's in-memory buffering during syncs. Airbyte's source worker reads up to 10,000 records into memory by default, and if your rows are large, this can quickly consume a significant amount of RAM. For example, if each row is 0.5 MB, the buffer would require about 5 GB of RAM just for the source worker. This buffer size is not dynamically reduced by default, and large tables or wide rows can exacerbate the issue, leading to OOM errors as you've observed with the
[ASYNC QUEUE INFO] Global: max: 5.79 GB
log line [Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale). How to control or reduce the buffer size: - Adjust Connector Resource Limits: You can increase the available memory for syncs by configuring connector resources. This is done by setting resource requirements for your connectors, which can help prevent OOM by allocating more memory, but it does not directly reduce the buffer size. See the [Configuring connector resources](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources) guide for details. - Reduce Batch/Chunk Size: For some connectors (like MySQL), you may be able to reduce the batch or chunk size, which limits how many records are read into memory at once. There are reports that adjusting parameters like
MAX_CHUNK_SIZE
on the source connector can help mitigate OOM issues. For example, setting a lower
MAX_CHUNK_SIZE
for the MySQL source has resolved OOM issues for some users [GitHub Issue #46932](https://github.com/airbytehq/airbyte/issues/46932). - Split Large Syncs: If possible, split your syncs into smaller jobs or sync fewer tables at a time. This reduces the memory footprint of each sync job [Forum Post: MySQL to Snowflake incremental loading fails](https://discuss.airbyte.io/t/2740). - Upgrade Airbyte and Connectors: Ensure you are using the latest versions of Airbyte and the connectors, as there have been improvements and bug fixes related to memory management and buffering [GitHub Issue #51014](https://github.com/airbytehq/airbyte/issues/51014). Summary: There is no direct configuration to set the global async queue buffer size in Airbyte OSS as of now. The best approaches are to reduce the batch size (if supported by your connector), split large syncs, and ensure your connector resource limits are appropriately set. If you continue to face issues, consider opening a GitHub issue for further investigation, as there may be memory leaks or inefficiencies in the connector implementation. If you need more specific guidance on setting
MAX_CHUNK_SIZE
or other parameters for your MySQL source, please let me know your connector version and deployment details.
b
Earlier it was working fine with Global max 750 MB as bufffer size. When tried upgrading RAM in EC2 instance - this buffer size setting got increased and causing OOM @kapa.ai
k
A message from kapa.ai
Based on the knowledge sources, Airbyte’s in-memory buffer size for sync jobs is not directly configurable by a user-facing setting. The buffer size is determined by the number of records read into memory (typically 10,000 records), and the actual memory used depends on the average row size. When you increase the available RAM on your EC2 instance, Java (used by Airbyte connectors) may automatically allocate a larger heap, which can result in larger buffers and, paradoxically, higher risk of OOM if the process tries to use more memory than the container or pod limit allows. This is especially true because Java’s default behavior is to use up to 1/4 of the host’s allocated memory, unless overridden by specific environment variables or JVM flags [Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale), [Forum: Memory request and limit](https://discuss.airbyte.io/t/2214). Why did the buffer size increase after upgrading RAM? - When you increased the RAM, Java detected more available memory and increased its heap size accordingly. - Airbyte’s connectors, especially Java-based ones, use the available heap to buffer records, so the buffer size (and thus the
[ASYNC QUEUE INFO] Global: max: ...
value) increased. - This can lead to OOM if the actual memory usage exceeds the container or pod limits, or if the JVM over-allocates based on the host’s total memory rather than the intended limit [Forum: Default 2GB memory limit not being observed](https://discuss.airbyte.io/t/3472), [GitHub Issue: OOM in replication jobs on newer redhat-based Linux kernels](https://github.com/airbytehq/airbyte/issues/61698). What can you do? - Set the environment variables
JOB_MAIN_CONTAINER_MEMORY_REQUEST
and
JOB_MAIN_CONTAINER_MEMORY_LIMIT
to explicitly control the memory available to Airbyte jobs. However, note that if the JVM does not respect cgroup/container limits (especially on newer Linux kernels), it may still allocate based on total host memory, leading to OOM [Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale), [GitHub Issue: OOM in replication jobs](https://github.com/airbytehq/airbyte/issues/61698). - If you are running on Kubernetes, ensure your pod resource limits are set correctly, and be aware of the kernel/JVM issue described above. - There is currently no direct setting in Airbyte OSS to cap the global async queue buffer size; it is indirectly controlled by the JVM heap and the connector’s batching logic [GitHub Issue: Reads should batch on bytes read](https://github.com/airbytehq/airbyte/issues/3439). Summary: The increase in buffer size after upgrading RAM is due to Java’s heap sizing behavior. To mitigate OOM, set explicit memory limits for your Airbyte jobs and monitor JVM/container compatibility, especially if you are on newer Linux kernels. There is no direct Airbyte setting to cap the async queue buffer size; it is a side effect of JVM memory management and connector batching logic. If you need to further restrict memory usage, consider lowering the batch size in your source connector if supported, or revert to a lower RAM allocation if that previously worked reliably. If you are affected by the JVM/cgroup issue on newer kernels, you may need to downgrade your kernel or monitor for upstream fixes in OpenJDK or Airbyte [GitHub Issue: OOM in replication jobs](https://github.com/airbytehq/airbyte/issues/61698).