On Mon, Aug 12, 2024 at 07:30:20AM -0400, Greg Troxel wrote: > Steve Rikli <s...@genyosha.net> writes: > > > 1) is my understanding correct? I.e. does tmpfs use main memory for > > backing, rather than swap or something else? > > It uses virtual memory which can be paged. So if you have swap space > configured, it can be bigger than physical memory. However, things in > /tmp will compete with other memory usage. > > > 2) can I configure /tmp as ffs rather than tmpfs? > > Absolutely. tmpfs is relatively new in the history of unix and having > tmp as a real filesystem is entirely reasonable. > > > Seems like I should be able to (manually?) configure /tmp as ffs during > > initial sysinst, or leave some unallocated disk space to do it later. > > As Martin said you can leave it on /. Original unix tradition was to > have separate / and /usr, which let you boot if / was ok. And it > protects / from becoming full from runaway activities in /usr, like > actual users on a multiusers system. So you can make a 4GB /tmp > separately so that when /tmp is full / is still ok. Or you can just > have one giant partition and take your chances, with more efficiency. > 128G isn't that big a disk. > > Definitely add swap, maybe even more then 4G depending on what you want > to do. But 4G is probably enough for anything you want to put up with > waiting for anyway.
Be sure to always reserve some extra partitions (I personnally prefer them other swap files) for swapping in order to add more if needed. I was hit some times by "new" programs that make absolutely no provision for limited memory and put everything in memory, the original file and the result (example: jpeg2 files). Spare space is always a must have. > > > My main thoughts were to avoid using RAM for tmpfs and simply configure > > a larger swap partition, or add a swap file, etc. > > There is a really good question here. Which is, for some reasonable > workloads, building programs that use 100M of /tmp and 1.5 GB of /tmp, how > things go with > > both system 4 GB swap > > A) big / with tmp just part of / > > B) big / with 2GB tmpfs > > I am really not sure what is better. I suspect tmpfs performance is > better for the times when /tmp is only 100-200 MB or so. I am really > not sure how it would go with larger. > > When building packages, some are ridiculous, e.g. thunderbird, which I > think needs around 19 GB of $WRKDIR space. I have code in mk.conf.local > to flip from /tmp/work to /nfs/ztmp/work-$hostname where the latter is > over NFS and a zfs filesystem on a big disk. It's slow but the builds > finish. So you may be able to use a smallish tmpfs and point specific > big jobs elsewhere. That's more work but higher performance - after you > get it right. -- Thierry Laronde <tlaronde +AT+ kergis +dot+ com> http://www.kergis.com/ http://kertex.kergis.com/ http://nunc-et-hic.fr/ Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C