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
Improve performance by cutting way down on ProgressReport updating #1552
Conversation
38fa2b7
to
86d4023
Compare
pulp_rpm/app/tasks/synchronizing.py
Outdated
| for batch in grouper(updates, 250): | ||
| advisories_pb.increase_by(len(batch)) | ||
|
|
||
| for update in batch: |
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.
Hard to tell from the diff but the only change is the above 3 lines and the removal of .increment() below
pulp_rpm/app/tasks/synchronizing.py
Outdated
| for batch in grouper(list(packages.values()), 250): | ||
| packages_pb.increase_by(len(batch)) | ||
|
|
||
| for pkg in batch: |
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.
Hard to tell from the diff but the only change is these 3 lines and the removal of .increment() below
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.
I took a time measurement of the total time spent in this loop before changing anything, and measured that it took about 30 seconds with 10,500 packages. So 250 packages should represent about 1 update per second, roughly (on my machine).
6e242f6
to
41f06af
Compare
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.
I read through this and it looks good to me. It would maybe be good to have an ack from @goosemania or another RPM team member too perhaps.
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.
Thanks!
Use auto-throttling behavior of ProgressReport context manager. [noissue]
Update ProgressReport for batches of content instead of individually.
ProgressReport updating took 30% of the runtime of syncs, now 1%.
Required PR: pulp/pulpcore#441
[noissue]