From owner-freebsd-questions@FreeBSD.ORG Wed May 6 16:09:55 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 199251065672 for ; Wed, 6 May 2009 16:09:55 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4078FC0A for ; Wed, 6 May 2009 16:09:54 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from phenom.cordula.ws (phenom [192.168.254.60]) by fw.farid-hajji.net (Postfix) with ESMTP id DFA6B34B7B; Wed, 6 May 2009 18:09:52 +0200 (CEST) Date: Wed, 6 May 2009 18:09:52 +0200 From: cpghost To: freebsd-questions@freebsd.org Message-ID: <20090506160952.GB1154@phenom.cordula.ws> References: <1241610888.16418.64.camel@ompc.insign.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Subject: Re: filesystem: 12h to delete 32GB of data X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2009 16:09:55 -0000 On Wed, May 06, 2009 at 05:34:24PM +0200, Wojciech Puchar wrote: > > -> it took about 12 hours to delete these 30GB of files and > > > > sub-directories (smarty cache files: many small files in many dirs). > > It's a little bit surprising, as it's on a recent HP proliant DL360 g5 > > with SAS disks (Raid1) running freebsd 6.x > > ( /dev/da0s1f on /usr (ufs, local, soft-updates) ) > > if you would use no raid or software raid it will behave normally. > > it takes <30 minutes for me to delete 300GB of squid files on > ordinary SATA disk , millions of small files. Alternatively, you could assign a dedicated filesystem for the cache and when cleaning up: * stop the app (or disable caching), * umount * newfs * mount * restart the app (or reenable caching). newfs is MUCH faster than manually deleting gazillions of files. If you don't like the (small) downtime during newfs, you could also play with two or more dedicated filesystems, and rotate between them (though that would be a waste of disk space). I can't recall how many times I've used a fresh newfs-ed filesystem instead of removing stuff one file at a time. -cpghost. -- Cordula's Web. http://www.cordula.ws/