Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust JDBC source fetch size dynamically to avoid OOME #12192

Closed
Tracked by #11715
tuliren opened this issue Apr 20, 2022 · 2 comments · Fixed by #12400
Closed
Tracked by #11715

Adjust JDBC source fetch size dynamically to avoid OOME #12192

tuliren opened this issue Apr 20, 2022 · 2 comments · Fixed by #12400
Assignees
Labels

Comments

@tuliren
Copy link
Contributor

tuliren commented Apr 20, 2022

Summary

  • Implement the solution discussed in Research OOM errors in JDBC source connectors #11883
    • The assumption is that all the database rows have similar size.
    • Firstly, set the fetch size to 10. Fetch the 10 rows, measure the mean serialized size of those rows, and use that size to estimate the best fetch size (N).
    • Secondly, set the fetch size to N. Sample the serialized size for every 100 to 1000 rows to adjust the fetch size.
  • Make sure the JDBC drivers respect the fetch size, rather than taking it as a hint.
@tuliren tuliren added type/enhancement New feature or request needs-triage labels Apr 20, 2022
@tuliren tuliren self-assigned this Apr 20, 2022
@tuliren tuliren changed the title Implement the solution based on the design spec Adjust JDBC source fetch size dynamically to avoid OOME Apr 25, 2022
@tuliren
Copy link
Contributor Author

tuliren commented Apr 27, 2022

Results

Testing Postgres database: one table, one text column, 10MB per row

Without dynamic fetch size adjustment With dynamic fetch size adjustment
Screen Shot 2022-04-27 at 09 26 19 Screen Shot 2022-04-27 at 09 54 52
Immediate OOME when trying to fetching 1000 rows Stable memory consumption

@tuliren
Copy link
Contributor Author

tuliren commented Apr 29, 2022

Still need to publish the new connector versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants