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

Improve performance by cutting way down on ProgressReport updating #1552

Merged
merged 1 commit into from Dec 9, 2019

Conversation

dralley
Copy link
Contributor

@dralley dralley commented Dec 7, 2019

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]

@pep8speaks
Copy link

pep8speaks commented Dec 7, 2019

Hello @dralley! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-12-09 21:08:16 UTC

for batch in grouper(updates, 250):
advisories_pb.increase_by(len(batch))

for update in batch:
Copy link
Contributor Author

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

for batch in grouper(list(packages.values()), 250):
packages_pb.increase_by(len(batch))

for pkg in batch:
Copy link
Contributor Author

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

Copy link
Contributor Author

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).

@dralley dralley force-pushed the performance branch 3 times, most recently from 6e242f6 to 41f06af Compare December 9, 2019 19:40
Copy link
Member

@bmbouter bmbouter left a 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.

Copy link
Member

@goosemania goosemania left a 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]
@dralley dralley merged commit 5f7c6ee into pulp:master Dec 9, 2019
@dralley dralley deleted the performance branch December 9, 2019 21:35
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

Successfully merging this pull request may close these issues.

None yet

4 participants