From owner-freebsd-fs@FreeBSD.ORG Mon Jun 11 16:11:52 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16A0316A468 for ; Mon, 11 Jun 2007 16:11:52 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id AE23813C45A for ; Mon, 11 Jun 2007 16:11:51 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 19556 invoked by uid 2001); 11 Jun 2007 16:11:48 -0000 Date: Mon, 11 Jun 2007 11:11:48 -0500 From: "Rick C. Petty" To: Francisco Reyes Message-ID: <20070611161148.GA19299@keira.kiwi-computer.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: FreeBSD Filesystem Subject: Re: Inode density for database machines - newfs -i X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 16:11:52 -0000 On Sun, Jun 10, 2007 at 11:11:21PM -0400, Francisco Reyes wrote: > For my mailstore machines I usually do "newfs -i 32768" to decrease fsck > time in case of problems. > > For database machines, postgresql in particular, would it help to have a > number larger than 65536? It depends on the average size of the files, which is what the inode density refers to (actually it means "create an inode for every N bytes of filesystem" which amounts to the same thing). Look at the average file size of those machines. An easy computation can be performed by using a combination of "df" and "find | wc". > Looking at one of my existing database machines, I have a filesystem using > 1.2TB and only 2053 inodes. There are 3,539,385 free inodes. If I recall > correctly I used "newfs -i 65536" for that filesystem. Then you guessed incorrectly. Try a much larger number.. in your case you want: "-i 20132659". Note that specifying an inode density means newfs will minimize the number of inodes in each cylinder group. It tries to create precisely the inode density you give it, but the density is adjusted as the number of cylinder groups increases. Basically there's a loop in newfs which increases the number of cylinder groups until the free bitmap for each CG can fit into a single filesystem block. Because of that loop, you won't always get the inode density you specify, but you will minimize the number of inodes created. > Will fsck be significantly faster in case of crash if I used say > 131072(128K) or even 256K? Of course, but it also depends on the number of cylinder groups. Specifying any number for the inode density will minimize the number of cylinder groups and also minimize the number of inodes per CG. Both of these will reduce fsck time. Using a higher inode density means fewer inodes will likely be created, meaning faster fsck time. However, make sure you have enough inodes for your filesystem... running out is no fun either. "newfs" tells you how many inodes it creates per cylinder group and how many CGs it creates. Multiply the two together, and make sure that number is larger than the number of inodes you need. Remember: every directory entry and almost every file entry uses 1 inode. Hard links don't use an inode but each symbolic link does. > What is the best list to find the current status of gjournal? freebsd-geom. > This list of geom? Looking at archives most of the gjournal posts seem to > be in current. Then that is a mistake, or it's cross-posted. -- Rick C. Petty