filesystem performance with lots of small files

David Malone dwmalone at
Fri Aug 26 10:15:22 GMT 2005

On Thu, Aug 25, 2005 at 11:25:23PM +0200, Marian Hettwer wrote:
> I didn't changed anything from the defaults... it looks like that:
> mhettwer at submaster-test$ sysctl vfs.ufs.dirhash_maxmem
> vfs.ufs.dirhash_maxmem: 2097152
> mhettwer at submaster-test$ sysctl vfs.ufs.dirhash_mem
> vfs.ufs.dirhash_mem: 368622
> By the way, the copy job of my small files finished, so here we go with 
> some small facts :)
> mhettwer at submaster-test$ sudo time find /usr/tmp/ | wc -l
>       133.81 real         2.01 user         3.95 sys
>  2904696

(Sorry - I missed the start of this thread.)

With dirhash it is how many files/directories you have in one
directory that is important. Subdirectories don't count. One way
to get a rough estimate of how big you should make vfs.ufs.dirhash_maxmem
is do to "ls -ld /usr/tmp" and see how many bytes the directory
takes. The number of bytes shown is probably a reasonable estimate
of what you should set vfs.ufs.dirhash_maxmem to.


More information about the freebsd-current mailing list