<@U04S8PLJWMT> Airbyte on-prem upgrade issue: Afte...
# ask-ai
g
@kapa.ai Airbyte on-prem upgrade issue: After upgrading the ClickHouse destination from v1 to v2.1.4 , syncs have become much heavier. Before the upgrade, a full DB sync finished in <30 min; now only small tables complete after 5 hours, while most large tables either queue or fail,. Logs show the source occasionally dying mid-snapshot with
org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend (EOF)
from the CTID/Xmin iterator. What’s already tried: Verified CH side (Atomic DB, correct namespace, no cluster, JSON disabled), limited concurrency to 1, ran Full refresh | Overwrite for big tables, and adjusted the Postgres source (JDBC `socketTimeout=0&tcpKeepAlive=true&defaultRowFetchSize=1000`; role GUCs removing statement/idle timeouts). Inserts into CH occur in 2k batches, but overall throughput is far slower than v1 and several large streams still don’t finish. Looking for any known v2.1.x performance regressions or tuning tips for PG→CH initial loads (batch/window sizes, fetch size, CTID vs Xmin, CDC for big tables, etc.).
k
Based on the provided knowledge sources, there are a few relevant points and some limitations in the available information regarding performance regressions and tuning for the ClickHouse v2.1.x destination in Airbyte: ### Known Performance Changes and Issues - Performance Regression Reports: There are user reports of significant performance regressions after upgrading to ClickHouse destination v2.x, with syncs taking much longer than in v1. For example, one user noted sync times increasing from 10 minutes to 40–60 minutes after upgrading to v3.0.6 (not ClickHouse, but similar pattern in destination v2+), and issues with full refresh streams duplicating records when incremental streams are present. This suggests that performance regressions and behavioral changes are possible after major destination upgrades, though the cited example is for BigQuery, not ClickHouse specifically. Still, it highlights that such regressions are not unprecedented in Airbyte destination upgrades and may be relevant to your experience [BigQuery Destination > 3.0.0 taking nearly 4 times as long to sync for high record syncs](https://github.com/airbytehq/airbyte/issues/64902). - ClickHouse v2.x Changelog: The changelog for ClickHouse v2.1.4 mentions "Activate speed mode" and several recent fixes related to batching, schema propagation, and interleaved stream state handling. Notably, version 2.0.10 added options to configure batch size (both bytes and number of records), which could be relevant for tuning performance [ClickHouse Changelog](https://docs.airbyte.com/integrations/destinations/clickhouse#changelog). - Batch Size Configuration: As of v2.0.10, you can configure the batch size for inserts into ClickHouse. If you haven't already, try adjusting the batch size (both in bytes and number of records) to see if it improves throughput for large tables. - Object/JSON Handling: In v2, object types are serialized as strings unless JSON is explicitly enabled. If your data includes large object columns, this could impact performance, but you mentioned JSON is disabled, which aligns with current recommendations [Destination ClickHouse V2- Ready for Beta Testers!](https://github.com/airbytehq/airbyte/discussions/62035). ### Tuning and Troubleshooting Tips - Concurrency: You already limited concurrency to 1, which is a common troubleshooting step for resource contention, but it may also reduce throughput if your system can handle more parallelism. - Batch/Window Size: Since v2.0.10, batch size is configurable. Increasing the batch size may help with throughput, but be mindful of memory constraints on both Airbyte and ClickHouse. - Source Fetch Size: You set
defaultRowFetchSize=1000
for the Postgres JDBC source, which is reasonable. You might experiment with higher values if your source and network can handle it. - CTID vs Xmin vs CDC: For very large tables, Airbyte recommends using CDC for lowest latency and reliability, especially if you encounter issues with CTID or Xmin (e.g., wraparound, snapshot failures) [Low-Latency Data Availability Stack](https://airbyte.com/tutorials/low-latency-data-availability-stack). If your tables are >500GB or you see snapshot iterator errors, switching to CDC may help. - Postgres Source Errors: The
org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend (EOF)
from the CTID/Xmin iterator suggests a network or resource exhaustion issue during large snapshot reads. This could be exacerbated by the new destination's slower ingestion, causing the source to time out or drop connections. Ensuring no idle/statement timeouts and increasing socket timeouts (as you've done) are good steps. - Checkpointing: Airbyte's checkpointing is designed to help with large syncs, but if the destination is slow, the source may not checkpoint frequently enough, leading to repeated work and further slowdowns [Low-Latency Data Availability Stack](https://airbyte.com/tutorials/low-latency-data-availability-stack). ### Limitations - No Explicit v2.1.x Regression Documentation: The knowledge sources do not explicitly mention a known performance regression in ClickHouse v2.1.x, nor do they provide detailed tuning parameters for this specific scenario. - No Direct Guidance on Window Size: There is no documentation on tuning "window size" for the ClickHouse destination, though batch size is configurable. ### Recommendations 1. Adjust Batch Size: Increase the batch size for ClickHouse inserts (see v2.0.10+ feature). 2. Experiment with Source Fetch Size: Try increasing
defaultRowFetchSize
if possible. 3. Consider CDC for Large Tables: If CTID/Xmin iterators are unreliable for your largest tables, try switching to CDC mode for those tables. 4. Monitor Resource Usage: Ensure both Airbyte and ClickHouse have sufficient resources (CPU, memory, disk I/O). 5. Check for Updates: Stay up to date with the latest connector versions, as recent releases (2.1.4) mention "speed mode" and other performance improvements. 6. Report Issues: If the problem persists, consider opening a GitHub issue with detailed logs and configuration, as the Airbyte team is actively developing and maintaining the ClickHouse v2 connector. I'm sorry, but the knowledge sources do not contain a definitive answer about a specific v2.1.x performance regression for ClickHouse. However, the above steps are supported by the available documentation and user reports, and may help you further diagnose or mitigate the issue. If you need more detailed tuning advice, you may want to join the Airbyte Slack or follow the ongoing discussions for ClickHouse v2 feedback [Destination ClickHouse V2- Ready for Beta Testers!](https://github.com/airbytehq/airbyte/discussions/62035).