Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 792195 - sys-apps/portage: group post_emerge autoclean operations into periodic batches
Summary: sys-apps/portage: group post_emerge autoclean operations into periodic batches
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 837899
Blocks: 835380
  Show dependency tree
 
Reported: 2021-05-26 07:12 UTC by Zac Medico
Modified: 2022-07-10 16:31 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2021-05-26 07:12:33 UTC
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
Comment 1 Zac Medico gentoo-dev 2021-05-27 07:31:23 UTC
<Arfrever> PORTAGE_AUTOCLEAN_INTERVAL="1d"
<Arfrever> (Without suffix ("d" above), seconds would be used)
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-05 03:09:57 UTC
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
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-05 03:11:58 UTC
(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?
Comment 4 Larry the Git Cow gentoo-dev 2022-04-13 03:06:04 UTC
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(-)