[RFC] Bumping ufs.dirhash_maxmem to a larger value?

David Malone dwmalone at maths.tcd.ie
Sun Aug 7 20:24:48 GMT 2005


On Mon, Aug 08, 2005 at 02:51:29AM +0800, Xin LI wrote:
> My proposal is to increase the default dirhash_maxmem value to at least
> 32MB or 64MB.  Any objections?

I think autotuning the value on boot might be a good idea, providing
that there's reasonable evidence that the existing value is too
small. Maybe setting it to some fraction of the available ram might
be a reasonable plan.

I set it to 20MB on our NFS server which has 1GB of ram. That's
more than enough enough to quickly clean up when a user accidently
puts a million files in one directory.

> Cons for this, discussed in -developer:
>  - dirhash does not implements automatical mechanism to reduce memory
>    usage in response to system memory pressure, and benefits mainly to
>    large directories, e.g. Maildirs.

Note that it benefits *only* large directories. Making dirhash
respond to demands on memory would be a good plan, certainly on
-current where we can in principle get feedback from UMA about
memory shortages. This would eliminate most of the disadvantages
of increasing the limit. In fact, you might be able to remove the
limit all together.

	David.


More information about the freebsd-performance mailing list