aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.54k stars 369 forks source link

Improve publish performance, especially for prefixes with a large number of snapshots #1222

Closed refi64 closed 2 months ago

refi64 commented 9 months ago

This contains a variety of improvements for publish performance, specifically speeding up the cleanup operation by:

Benchmarks were added for all of these, and some unit tests were added specifically to test aspects of cleanup.

We have a relatively large aptly repository with >90 repositories, ~207k packages across all of the repositories, and >3.5k snapshots; a testing version of that repository was used to measure the publishing performance. Prior to these changes, publishing took >9 minutes, with over 8 minutes of that time just in the cleanup phase. With these, the cleanup time goes down to ~13 seconds, for a total publish time of a little under a minute.

Checklist

codecov[bot] commented 9 months ago

Codecov Report

Attention: Patch coverage is 83.72093% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 66.06%. Comparing base (f1649a6) to head (ae09dfc). Report is 40 commits behind head on master.

:exclamation: Current head ae09dfc differs from pull request most recent head 75b858b. Consider uploading reports for the commit 75b858b to get more accurate results

Files Patch % Lines
api/files.go 0.00% 8 Missing :warning:
deb/publish.go 79.31% 4 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1222 +/- ## ========================================== - Coverage 74.85% 66.06% -8.80% ========================================== Files 143 143 Lines 16187 16215 +28 ========================================== - Hits 12117 10712 -1405 - Misses 3134 4752 +1618 + Partials 936 751 -185 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

randombenj commented 8 months ago

I think this is a fantastic change!

@neolynx @dario-gallucci you wanna have a look at this?

neolynx commented 8 months ago

I think this is a fantastic change!

yes indeed,thanks !

@neolynx @dario-gallucci you wanna have a look at this?

sure!

refi64 commented 7 months ago

As an aside, we've been running this on our production infra for a bit now, and nothing has exploded, which is probably a good thing.