If we store the time of the last autoclean operation in the mtime db, then we can trigger it at a configured time interval. <toralf> the "'Finished. Cleaning up...'" here at the tinderbox take 0 sec for the first packages and 18 seconeds now after ~5000 packages being isntalled at an image - why does this time increase ? <toralf> I'm asking b/c with about 1,000 emerges per image this cumulates to 5 hours of CPU time for an image <toralf> per day <toralf> the hardware is fast: zen3 + NVMe <zmedico> toralf: it's the post_emerge stuff in https://gitweb.gentoo.org/proj/portage.git/tree/lib/_emerge/post_emerge.py?h=portage-3.0.19 and I rememeber vapier opened about bug about handling things differently but I can't find it right now <zmedico> toralf: also we could add a way to disable the global autoclean thing (for AUTOCLEAN=y) <zmedico> the autoclean thing is typically not useful, though it can eliminate unecessary packages following slotmove [00:06:26] <toralf> zmedico: it would be cool if it could be disabled - at a tinderbox I could run it once a day during @system or @world - because running it after each emerge decreases the performance too much IMO
<Arfrever> PORTAGE_AUTOCLEAN_INTERVAL="1d" <Arfrever> (Without suffix ("d" above), seconds would be used)
Coming back to this (after some discussion on the forums), I'm wondering if we're better off only doing it after operations we know are useful (like if we processed a slotmove or something?) rather than keeping track of when we last run it. I was surprised to see iteration over all packages in unmerge() on any re-emerging of a package then figured out this is why. [0] https://forums.gentoo.org/viewtopic-p-8693815.html#8693815
(In reply to Sam James from comment #2) > Coming back to this (after some discussion on the forums), I'm wondering if > we're better off only doing it after operations we know are useful (like if > we processed a slotmove or something?) rather than keeping track of when we > last run it. > > I was surprised to see iteration over all packages in unmerge() on any > re-emerging of a package then figured out this is why. > > [0] https://forums.gentoo.org/viewtopic-p-8693815.html#8693815 ... and on depcleans. Would that be sufficient?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=eecd073d274c6d669f324cbb31151789d32f87fb commit eecd073d274c6d669f324cbb31151789d32f87fb Author: Sam James <sam@gentoo.org> AuthorDate: 2022-03-05 05:57:25 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-04-13 03:05:45 +0000 autoclean: only enable for global updates and depcleans Closes: https://bugs.gentoo.org/792195 Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/gentoo/portage/pull/795 Signed-off-by: Sam James <sam@gentoo.org> cnf/make.globals | 2 +- lib/_emerge/actions.py | 22 ++++++++++++++++------ lib/portage/dbapi/vartree.py | 24 +++++------------------- 3 files changed, 22 insertions(+), 26 deletions(-)