From owner-freebsd-fs@FreeBSD.ORG Mon Jun 13 09:48:05 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B7EE106566B for ; Mon, 13 Jun 2011 09:48:05 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta09.emeryville.ca.mail.comcast.net (qmta09.emeryville.ca.mail.comcast.net [76.96.30.96]) by mx1.freebsd.org (Postfix) with ESMTP id F35778FC13 for ; Mon, 13 Jun 2011 09:48:04 +0000 (UTC) Received: from omta06.emeryville.ca.mail.comcast.net ([76.96.30.51]) by qmta09.emeryville.ca.mail.comcast.net with comcast id vMix1g00116AWCUA9Mo2RB; Mon, 13 Jun 2011 09:48:02 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta06.emeryville.ca.mail.comcast.net with comcast id vMo31g0041t3BNj8SMo3g0; Mon, 13 Jun 2011 09:48:03 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 39C0F102C19; Mon, 13 Jun 2011 02:48:03 -0700 (PDT) Date: Mon, 13 Jun 2011 02:48:03 -0700 From: Jeremy Chadwick To: Steven Hartland Message-ID: <20110613094803.GA10290@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@FreeBSD.ORG Subject: Re: Impossible compression ratio on ZFS X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 09:48:05 -0000 On Mon, Jun 13, 2011 at 10:13:33AM +0100, Steven Hartland wrote: > I've just done an optimisation of a mysql table which is located > on a compressed zfs partition and spotted that the size reported > by du is impossibly small for the file:- > > du -h detail* > 1.5K detail.frm > 7.5K detail.ibd > > ls -l detail* > -rw-rw---- 1 mysql mysql 8660 Jun 13 10:00 detail.frm > -rw-rw---- 1 mysql mysql 650117120 Jun 13 10:04 detail.ibd > > The table format for those interested is 3 int's, 3 indexes and > contains 8million rows. > > I highly doubt that my 620MB table is taking up just 7.5K on disk > any ideas? Well-known "quirk"; welcome to ZFS. :-) The following article is long, but if you grab a coffee and read it in full, it'll shed some light on the ordeal: http://www.cuddletech.com/blog/pivot/entry.php?id=983 There's also this: http://blog.buttermountain.co.uk/2008/05/10/zfs-compression-when-du-and-ls-appear-to-disagree/ This is one of the many reasons I do not use ZFS compression. Not spreading FUD, just saying stuff like this throws users for a loop, case in point. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |