User talk:Pietinger/Tutorials/Optimize compile times

From Gentoo Wiki
Jump to:navigation Jump to:search

With regard to using tmpfs for compile, I find that as long as the system is reasonably stable and not going to crash it's simpler to temporarily set the following via sysctl:

  • vm.dirty_ratio=90
  • vm.dirty_background_ratio=85
  • vm.dirty_writeback_centisecs=60000 #ten minutes is a reasonable compromise.

This allows the system to keep written files in the disk cache much longer, so the files created during the compile process won't ever touch the disk if you have sufficient memory and the compile is faster than the writeback timeout. The install is still safe since it calls sync. If you run short on memory the system will automatically push things out of the cache to make space. So you get most of the speed improvement of using a tmpfs, without the hassle of doing the memory management yourself.

--Tlhonmey (talk) 16:48, 16 February 2023 (UTC)

First of all: Thanks a lot for your hint ! I will copy it into my article ... IF you think it is matching here ... but maybe it is even more better in Portage_TMPDIR_on_tmpfs ? What do you think ? --Pietinger 18:17, 16 February 2023 (UTC)
I'm not entirely sure. I ended up here after your writeup was referenced on the user mailing list. It might be good to mention on the tmpfs page, but I don't know that it makes the most sense to put a description of something other than using tmpfs on the tmpfs page, whereas your page seems to be more generic tips and tricks that aren't necessarily limited to one particular approach. (In case it wasn't clear, tweaking the cache settings largely obviates the need to use tmpfs at all rather than being something to use in addition to setting up a tmpfs.) --Tlhonmey (talk) 23:34, 17 February 2023 (UTC)
Done ;-) Thanks again ! --Pietinger 00:20, 19 February 2023 (UTC)