-
Notifications
You must be signed in to change notification settings - Fork 131
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
Change default cache count from 65536 to 512 #721
Conversation
/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, worker-count * batch-size
is not suitable as a default value, for the following reasons:
- It may surprise the user. If a user finds that the downstream is quite far behind the upstream, he may try to make
worker-count
andbatch-size
larger and accidentally cause OOM. - There's a unit mismatch here. The unit for the buffer of drainer is the whole binlog, while the unit for
batch-size
is individual mutation in binlog. One binlog may contain many row mutations.
What we have learned so far is that 65536
may be too large for quite a few users, so maybe just explicitly use a smaller default value would be a safer way to solve the problem.
@suzaku So what do you think of the right value? How about 512? I'm not so sure about this. |
@lichunzhu Note that What I am suggesting is that, since we are facing a complicated problem with no perfect solution right now, we'd better just use a simple solution that can make OOM less likely. |
@suzaku I understand what you mean now. Then what do you think of the limit value? Is 512 OK? |
@lichunzhu just change to 512 but don't add the config in |
512 or anything less than or equal to 1024 should be a safe choice, because in loader we also have a buffered channel which is hard coded to be 1024 in length. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@lichunzhu Just writing |
…tidb-binlog into czli/changeCacheCount
Revised. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
A son PR of #715.
Current default cache count is too big which can easily cause OOM of drainer.
What is changed and how it works?
The default size is changed from 65536 to 512.
Check List
Tests
Code changes
Side effects
Related changes