Swap on SSD

John R. Levine johnl at iecc.com
Mon Feb 5 20:08:27 UTC 2018


In article <24BAEBB4-FAA7-47C8-A6FC-32839063666F at kreme.com>, LuKreme  <kremels at kreme.com> wrote:
>On Feb 5, 2018, at 09:13, Frank Leonhardt <frank2 at fjl.co.uk> wrote:
>> FreeBSD doesn't actually swap these days; uses demand paging. This means that blocks of RAM that are hardly ever used can get
>copied to disk. This may include some stuff that's only accessed a few times a year, but would otherwise be occupying precious
>RAM that would be much more useful as a disk cache. That said, FreeBSD tends not to page out except as a last resort - probably a
>mistake but I can't prove it.

That's right.  The swap space is where it pages stuff that doesn't have a 
home anywhere else.  A great deal of what's in memory is a copy of 
something on the disk, so if it's paged out, it goes back to the disk, or 
it's just deleted in the common case that it hasn't changed since being 
read in.

Unless your system is trying to do something that wants a lot more R/W 
address space than is physically available, the system doesn't write much 
to the swap space.

On one of my BSD cloud virtual machines I have a server process that 
slurps in about a gigabyte of stuff into a very large perl table, then 
sits there and answers queries from that table.  The system swaps like 
crazy for a few seconds while it's loading up the table, then quiets down 
and reads a few pages a second from the swap as the queries come in. 
That's about the worst case, and only becasue I'm a cheapskate and don't 
want to pay for a larger VM where everything would fit in RAM.

-- 
Regards,
John Levine, johnl at iecc.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly



More information about the freebsd-questions mailing list