Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2016 12:53:25 +0200
From:      Eduardo Morras <emorrasg@yahoo.es>
To:        freebsd-questions@freebsd.org
Subject:   Re: Feedback on UFS2 tuning for large number of small files (~100m)
Message-ID:  <20160608125325.71fab3fe95b0bc3c6272ea7c@yahoo.es>
In-Reply-To: <CA%2BTk8fyZjdvb70HFfwJBD=%2BJ4PU9Ae5FcsaQgSvMZW5B2T3YLA@mail.gmail.com>
References:  <CA%2BTk8fyZjdvb70HFfwJBD=%2BJ4PU9Ae5FcsaQgSvMZW5B2T3YLA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 8 Jun 2016 11:14:40 +0300
Ciprian Dorin Craciun <ciprian.craciun@gmail.com> wrote:

> Hello all!  (Please keep me in CC as I'm not subscribed on the mailing
> list.  Should I perhaps post this to the `freebsd-fs` mailing list?)
> 
> 
> I would like your feedback on tuning a UFS2 file-system for the
> following use-case, which is very similar to a maildir mail server.  I
> tried to look for hints on the internet, but found nothing more
> in-depth than enabling soft-updates, `noatime`, etc.
> 

You can use tunefs to set:

a) average file size and expected number of files per directory,
b) check if your filesystem has any ACL flags on (NFS, POSIX, whatever) and disable them if you don't use ACLs,
c) if filesystem is full or near full, system switch from faster writes to minimize fragmentation strategy (slower), force the fast access optimization.

They requires a umount/mount only no reformating. 

Newfs can set those values at fs formatting/createing.

There are some sysctl you can tweak, again without reformating:

vfs.ufs.dirhash_maxmem: maximum allowed dirhash memory usage

Defaul value is 6MB. Check first dirhash usage with 

#sysctl vfs.ufs.dirhash_mem

and if it's equal or close to maxmem, grow it (24MB or more, f.ex.)

Tuning at ffs level are more tricky and risky, check sysctl vfs.ffs.*




---   ---
Eduardo Morras <emorrasg@yahoo.es>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160608125325.71fab3fe95b0bc3c6272ea7c>