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

Trigger flushes on put #63

Closed
criccomini opened this issue Nov 4, 2016 · 1 comment
Closed

Trigger flushes on put #63

criccomini opened this issue Nov 4, 2016 · 1 comment

Comments

@criccomini
Copy link
Contributor

KCBQ currently waits until flush() is called before it starts sending messages to BigQuery. This happens every 30s, by default. The flush() method, then sends the messages to BigQuery in a series of threads, and waits for all of them to respond back. This sometimes takes 30s (or longer) when there are a large number of messages in the buffer.

I believe that adding logic in the put() method to more aggressively begin sending messages to BigQuery BEFORE flush() has been called could significantly speed up writes, since we won't be sitting idle for 30s before doing the write. If we have a 30s flush interval, and it takes 30s to write messages to BigQuery, flushing during put could increase performance by as much as 2x, since the two 30s intervals would overlap.

flush() should just flush any outstanding data in the buffer, and then sync on all futures (including those that had been invoked during put() methods).

Some thought should be put into how this will impact the adaptive batch sizes.

@criccomini
Copy link
Contributor Author

I think this will also help with memory pressure, as writes that finish early can have their buffers cleared out.

@mtagle mtagle closed this as completed Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants