Hacker News new | ask | show | jobs
by adrian_b 1984 days ago
You might be right if you are running some sort of experimental FreeBSD system, where for some reason you expect crashes.

On the other hand, I have run continuously, 24/7, for almost 20 years a FreeBSD server without any swap and without ever seeing any crash or panic. In my opinion the swap is useless and it is better to just install enough physical memory.

I reboot that system just once a year or so, for a kernel update or a hardware upgrade.

I run on it a large number of services, mostly Internet related, e.g. firewall, router, NTP server, DNS server for outside, DNS resolver for the internal network, e-mail server, Web server, Web proxy, file server.

2 comments

Swap is not meant to enable you to escape the memory demands of your workload. If your workload requires more physical memory than you have, then swap will probably not help you.

However just because your software allocates data in memory doesn't mean it needs to be there. Rarely used memory could be swapped out to cache more frequently used files on disk instead, increasing the overall throughput of the system. This could be true whether or not you have an excess of physical memory for your workload.

I've been running freebsd my primary home and work platforms for almost 20 years and the only time I've had crashes that would have dumped to swap were when I was doing some driver development for early flash storage cards and a few times with the early ZFS merges.

None of my FreeBSD systems have swapped anything out in years. Most of the VMs get half gig of "I guess it might by used by something" swap space.

Somewhat ironically NVME would be insanely good for historical swap use cases but anything that cares about performance hasn't swapped in the better part of a decade.