Very inconsistent (read) speed on UFS2

Kirk McKusick mckusick at mckusick.com
Tue Aug 30 20:09:09 UTC 2011


Now that you have defragmented your filesystem, we can factor that out
of the equation. What is left is the management of the memory used for
caching the files. I expect what is happening is that you are busily
reading along and run out of free memory in which to read. This triggers
a cleanup thread that churns through the memory pool to decide what
should be thrown out to make room. Your reading process is demanding
memory faster than the cleanup thread can produce it. The result is
that your read idles (e.g., appears to run slowly). It is random because
it depends on when you run out of memory.

The cleanup is complex because it has to deal with all of memory and
it wants to avoid a simple LRU which would cause the read of a large 
file to throw out a lot of things you would rather keep (like your 
window manager, browser, etc). Not sure what the best strategy is here.

	Kirk McKusick


More information about the freebsd-fs mailing list