UFS UFS not syncing during uptime

Been using freebsd as a file/xrdp server for home usage. System has crashed twice now due to running out of RAM and swap space and dumping all current processes. It appears that after receiving/sending files it is leaving it in inactive ram and not clearing it out, even once it hits the swap space. Is there a way to make it sync itself to free up RAM? For instance could I schedule a sync command on crontab to run hourly? It's an older system so I'm maxed out at 16 gigs of ram which I thought would be more than enough for just hosting some pictures and other backups for our other computers.
 
[...] It appears that after receiving/sending files it is leaving it in inactive ram and not clearing it out, even once it hits the swap space. Is there a way to make it sync itself to free up RAM? [...]
IMHO this is a misunderstanding. Dirty buffers are written to disk every ~30 sec by default, see below. Maybe the "it" in your sentence is an misbehaving application, e.g. the xrdp(1) server or a NFS or Samba server running in userland. You may want to use the in-kernel NFS server instead.

1st, please make shure the hardware is ok: If available, run tests provided by the BIOS, run a SMART test on the disks (sysutils/smartmontools) & test the RAM (sysutils/memtest86(+)). Please have in mind that electronic devices fail eventually; rotating HDD devices successively fail more often, non-rotating/NVRAM ones fail suddenly & completely. Since you write of resilvering, you have a gmirror(8), correct? Yes, 16 MB RAM should be well enough for a fileserver with UFS in a home network; it's even enough to run ZFS with deduplication enabled.

We need more detailed information to help:
  • output of freebsd-version
  • any non-standard configuration (do you have sysctl vm.overcommit set?). If you have any non-standard config, post that here, up to let's say 20-30 lines inline as [CODE]config here[/CODE], [ICODE]one line in icode[/ICODE], longer as attachments (maybe on a upload server). I.e. /boot/loader.conf, /etc/rc.conf, /etc/sysctl.conf (and *.local thereof if you have such).
  • Does that machine have ECC RAM? If not, why not?
  • Is UFS journaling enabled or do you use a UFS on a gjournal(8) device?
  • Soft updates enabled?
  • Which services are enabled (xrdp, NFS, Samba,...)?
  • RAM gets freed by the virtual memory subsystem only if there's memory pressure. As long there's no memory pressure, the pages remain in the laundry queue (view with top(1)).
  • AFAIK, dirty blocks are written to disk every 30 seconds in the default configuration:( sysctl kern.{meta,dir,file}delay)
 
Back
Top