From owner-freebsd-questions@freebsd.org Wed Jun 8 10:56:23 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E53F7B6FE9B for ; Wed, 8 Jun 2016 10:56:23 +0000 (UTC) (envelope-from emorrasg@yahoo.es) Received: from nm38-vm8.bullet.mail.ir2.yahoo.com (nm38-vm8.bullet.mail.ir2.yahoo.com [212.82.97.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49C9A11B2 for ; Wed, 8 Jun 2016 10:56:22 +0000 (UTC) (envelope-from emorrasg@yahoo.es) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1465383206; bh=25fG+hptC4ceeo2LMsHFA7rgE58i3f14Z19e8fdL9vo=; h=Date:From:To:Subject:In-Reply-To:References:From:Subject; b=LE5sh3g7EkK5bTGhPhh3wzmLsmBD8Elh2sSbNpUXAjYv23DeDzBGj9h/R+Vcrt/rI+c2TpY6qvT9oM/b3z8CHag5D96uTUStLPwa7cgDA3TpGOunqA/nKta7uQoLVJoF6Wx1wm/jFprMc7b3muR65zC/RYcdZZGMnWd5UTeAphvxUnAChPJ6BeTgMNZ44kC3mIOGyCL+BzShGuYSJBROs+ppNfanfCizVU99VlKeHMKChNLHOdXHjsHqLwKkE1SR33rQEhsbFe6ephHH9M6qeKxdzNzrVtq/AwJsXYIo85qoeNPIf9xOfL8w+aF7eBXIEVHFKIVTik1JPE3Kg3nLkA== Received: from [212.82.98.61] by nm38.bullet.mail.ir2.yahoo.com with NNFMP; 08 Jun 2016 10:53:26 -0000 Received: from [46.228.39.69] by tm14.bullet.mail.ir2.yahoo.com with NNFMP; 08 Jun 2016 10:53:25 -0000 Received: from [127.0.0.1] by smtp106.mail.ir2.yahoo.com with NNFMP; 08 Jun 2016 10:53:25 -0000 X-Yahoo-Newman-Id: 930712.70007.bm@smtp106.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: vM8PCogVM1lqnADMKz1Mvd6nujWgH0Pkx02ikehvupUweIm VpGBg20kJoWA7vG8roKS13NiXz4GZvOcrLI1ibwxc3ZZHSeiyh3yxp1ZGnYe 5i6rMQc7IJKYPH6m.wfHBIX.mUXb7_RCqiHoq0Y08hAyOP4DJFSSzsf7r30e F3ZN5yvkLOWEYWqCohg0dOHJ0WR3fASuUXhEfCVBxxA9Kff75sV.UC9iUVmo cn8NP9vkUiKfnu.nrDpGBS5xhQAZe7YCM8pdGE.LQkZphPnqZTkhMNDwlwCf .sL2H7mNqguU3d5V_u3JuDVnhAWGM3xCMAohyXYJVv4uPC84iWkwvtb1xM5m B9GMPvAVOxsTML9E6iBRK4TG7rbizjuoRWyLVp4C8EL8Im6d2ftrS5T7Mkf1 cYI6NIk1utr.Ei_EB50ZK_OC0HsbC7HGVhVums.O.bBvCqBvPFlrWuH3eoac H0qirUDByY3fweDESqj3pVb62ikEAQD4bDroU_NrdoXyCiueob6JNHYUXlWJ .e5iX7Icl5Khp.10jPw1SD.gpzzC71jjEuqqcwbl2Vx0q0icOMLs_VIqETZJ Kfw4aOJ4- X-Yahoo-SMTP: mX392iiswBAeJNdO_s.EW62LZDJR Date: Wed, 8 Jun 2016 12:53:25 +0200 From: Eduardo Morras 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: References: X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 10:56:24 -0000 On Wed, 8 Jun 2016 11:14:40 +0300 Ciprian Dorin Craciun 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