Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to limit amount of virtual memory used for files (was: Re: Tuning ZFS memory usage on NetBSD - call for advice)



Hello all,

On 22.09.22 18:38, Mike Pumford wrote:


On 22/09/2022 06:44, Lloyd Parkes wrote:

Can we put together a catalogue of clearly defined problems so that we can reproduce them and investigate further? While Håvard appears to have solved his problem, I'm pretty sure I have an unused G4 Mac Mini of my own that I can try and reproduce his problem on.

So I changed vm.filemin and vm.filemax to solve my excessive swapping issues. Basically the system was preferring to keep file cache around and was evicting memory for processes that consumed swap (so data pages I'm assuming) rather than file cache. Under heavy memory/file usage (pkgsrc bulk builds) any large process running at the time of the build ended up going non-responsive.

So it could be that the all that needs to change here are the defaults for those parameters.

For the record I have:
vm.filemax=10
vm.filemin=1

in /etc/sysctl.conf on a 16GB 9.3-STABLE system. The system can comfortably use more memory than that for file cache. As I write this message its currently using 9GB for file cache (which I don't see as a problem as there are no other demands on the system memory at the moment. Starting a new process like firefox correctly dumped file cache over other memory with this config. Also long running firefox processes remained responsive both during and after the builds with this change.

Mike

Thank you very much for the helpful input. I had read through the linked thread and also adjusted the settings vm.filemax=10 and vm.filemin=1 for me. This has resulted in a noticeable relaxation when I now send a zfs with the destination of a file on a USB disk. The file cache still fills up, but the swap usage is no longer detectable or only minimal. The system remains stable and responsive.

In summary, this has solved my problem.

Kind regards
Matthias

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



Home | Main Index | Thread Index | Old Index