But actually linux never ejects pages to swap just for the cache. It will only eject pages for memory pressure, which, when freed, can leave extra room for cache. But it won't eject the pages in the first place for the cache.
Being able to run locate and have it quickly return an accurate result is useful at times. I just don't want it paging my entire session out to disk every night in order to do that.
It doesn't.
assume the RAM alone are enough for heaviest load, no memory leak, no exhaustive ... that's it, the server is never out of RAM memory
hmmm, does hn server use swap?
14.4.1 - About swap Historically, all kinds of rules have been tossed about to guide administrators on how much swap to configure on their machines. The problem, of course, is there are few "normal" application.
One non-obvious use for swap is to be a place the kernel can dump a copy of what is in core in the event of a system panic for later analysis. For this to work, you must have a swap partition (not a swap file) at least as large as your RAM. By default, the system will save a copy of this dump to /var/crash on reboot, so if you wish to be able to do this automatically, you will need sufficient free space on /var. However, you can also bring the system up single-user, and use savecore(8) to dump it elsewhere.
Many types of systems may be appropriately configured with no swap at all. For example, firewalls should not swap in normal operation. Machines with flash storage generally should not swap. If your firewall is flash based, you may benefit (slightly) by not allocating a swap partition, though in most other cases, a swap partition won't actually hurt anything; most disks have more than enough space to allocate a little to swap.
There are all kinds of tips about optimizing swap (where on the disk, separate disks, etc.), but if you find yourself in a situation where optimizing swap is an issue, you probably need more RAM. In general, the best optimization for swap is to not need it.
In OpenBSD, swap is managed with the swapctl(8) program, which adds, removes, lists and prioritizes swap devices and files.
That will do EXACTLY the opposite of what he wants. Give it a swap file and unneeded parts of memory will be swapped out to disk, freeing memory for use as a file system cache.
There is _never_ a reason to configure a system without a swap file - except if it's a laptop and you don't want the disk to spin up.
Don't want the system to use swap space? Don't allocate more memory than you have (or buy more memory), but disabling the swapfile never helps. In some cases disabling it doesn't hurt anything, but it never helps.