Marcin Koziej
2006-Jun-22 12:36 UTC
Poor swapping performance -- lot's of unused free memory.
Hello, I use FreeBSD 6.1-STABLE #0: Mon Jun 12 18:00:56 CEST 2006 for a desktop (Launch several apps at the start and mostly nothing else, except when compiling). I've got 512 MB of ram. From some time, I've noticed poor swapping performance -- this can be very annoying when memory needs to be swapped in and the whole systems chokes on disk I/O. Most frequently when launching a big application or clicking on recently not used application window. What I notice, is that top(1) reports: 60 MB free, and 150 MB on the swap, which means these 60 mb are just sitting there doing nothing. I remember in older versions of FreeBSD tried to keep swap as little used as possible, leaving 3-4 mb ram free. This is just a feeling, of course, but it feels like it's slower now. Can anybody comment on this? Maybe there is a sysctl which can tune this ? (I've searched for such, but found nothing). Best regards, Marcin Koziej
Dan Nelson
2006-Jun-22 15:58 UTC
Poor swapping performance -- lot's of unused free memory.
In the last episode (Jun 22), Marcin Koziej said:> I use FreeBSD 6.1-STABLE #0: Mon Jun 12 18:00:56 CEST 2006 for a > desktop (Launch several apps at the start and mostly nothing else, > except when compiling). I've got 512 MB of ram. > > From some time, I've noticed poor swapping performance -- this can be > very annoying when memory needs to be swapped in and the whole > systems chokes on disk I/O. Most frequently when launching a big > application or clicking on recently not used application window. > > What I notice, is that top(1) reports: 60 MB free, and 150 MB on the > swap, which means these 60 mb are just sitting there doing nothing. I > remember in older versions of FreeBSD tried to keep swap as little > used as possible, leaving 3-4 mb ram free. This is just a feeling, of > course, but it feels like it's slower now.That 60MB might be free due to a large process that recently exited; you'd have to run top for a while and see what the trends are. Note that if you're asking for freebsd to pre-emptively pull some stuff back into RAM from swap, there's no way for the OS to know which blocks will be needed, if any. That 150MB swap might be truly unused data in long-lived processes that will never get swapped back in, in which case it's better for the system to leave that 60MB alone, for disk cache or memory for new processes.> Can anybody comment on this? Maybe there is a sysctl which can tune > this ? (I've searched for such, but found nothing).Putting swap on a different disk from the rest of the OS should help. It's probably jumping between the swap partition and your filesystem, alternately paging in private data from swap and shared library/executable code from /usr. -- Dan Nelson dnelson@allantgroup.com