-
Notifications
You must be signed in to change notification settings - Fork 260
perf: [NPM] make apply ipsets faster #1307
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
Conversation
23f8c0b to
b95cf6e
Compare
0dd7e58 to
bab47ba
Compare
|
|
||
| // NOTE: duplicate code in the first step in this function and fileCreatorForApplyWithSaveFile | ||
| func (iMgr *IPSetManager) fileCreatorForApply(maxTryCount int) *ioutil.FileCreator { | ||
| creator := ioutil.NewFileCreator(iMgr.ioShim, maxTryCount, ipsetRestoreLineFailurePattern) // TODO make the line failure pattern into a definition constant eventually |
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.
should we persist these creators within the ipsetmanager to avoid creating these in both this and fileCreatorForApplyWithSaveFile?
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.
talked offline. rough to duplicate a lot between the functions but no clean solution
vakalapa
left a comment
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.
Great work, this improves our perf by about 10x !! ![]()
* wip * fix member update * fix hashed name bug * fix hashed name bug and bug for original members for delete cache * fix delete bug * print cache in logs again * some UTs * dirty cache UTs * fix windows build problem * dirty cache with members to add/delete & keep old apply with save file code * fix windows * fix windows 2 * fix windows 3 * UTs and dirty cache in same struct shared between each OS * fix windows build * change some error situations to valid situations * log clean up and addressing comments
dramatically improves apply time for medium to large scale.
Previously, we would parse through an ipset save file for every batch dataplane operation. We can forego that by maintaining member diff for our ipset dirty cache.
New dirty cache adds robustness to all combinations of create/add/del/destroy calls. Windows doesn't need to maintain member diff by nature of HNS.