-
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
drainer/: Change unreasonable buff size and reduce memory usage #735
Conversation
/run-all-tests |
/run-all-tests |
/run-all-tests |
1 similar comment
/run-all-tests |
lgtm |
/run-all-tests |
why ci was failed? |
i don't know, failed at |
LGTM |
/run-integration-test |
IMO, CI fails because drainer hasn't consumed the pump 8250's storaged binlogs in 15 seconds when closing pump. This problem can be reproduced on my server. |
Is it something relate to this pr change? can you fix this? |
I'm not so sure now. I'm working on that now and later I will get a conclusion. |
/run-all-tests |
/run-all-tests |
/run-all-tests |
There is still 4s gap between drainer and pump after 15s. I guess when drainer has cache it can cache some binlogs from pump then drainer can still sort and execute the cached binlogs even though this pump is paused. Maybe |
/run-all-tests |
/run-all-tests |
/run-all-tests |
/run-all-tests |
@lichunzhu PTAL, the root cause is when runs into the |
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?
the
maxBinlogItemCount
var will affect the job buffer size in an unreasonable way.In syncer.sync will work like this
note execute the sql may take times, and not consume the job chan.
so the upstream may block at add job into the chan, and also will not add job the other
sync
job chan.What is changed and how it works?
avoid any buffer at upstream to much mem and not decrease performance, and don't make buffer size of job chan depent on
maxBinlogItemCount
the flowing v1 means f9e4589
v2 means one more commit 3074b3b
before 10:53 version: v2.1.16 maxBinlogItemCount=16
start at 10:53 version: v1 maxBinlogItemCount=16
start at 30 11:17 version:v2.1.16 maxBinlogItemCount=64k (the previous default value)
start at 30 11:47 version: v1 maxBinlogItemCount=0
all using worker-count = 256, txn-batch = 20
note when the drainer restarts, the first 5 minutes will use safe-mode, the event metrics count the changed events.
Another test:
the upstream data one binlog near 60M
start at 19:25: version: v1
start at 19:45: version: v2
Check List
Tests