From owner-freebsd-fs@FreeBSD.ORG Wed Oct 23 17:14:33 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4498CA30; Wed, 23 Oct 2013 17:14:33 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 188F62E8C; Wed, 23 Oct 2013 17:14:32 +0000 (UTC) Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id CFB7F20CAC; Wed, 23 Oct 2013 13:14:25 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute6.internal (MEProxy); Wed, 23 Oct 2013 13:14:25 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=wnKDUyOj9OT9emJ7KZqCK5FfF0I=; b=OV9 wehDboy2zmVghFgYXrI79/EzO+2wul5psyc6AM2dpRjMGPRPWXTESb49QWfCsTbE u3S6o9APXm/eCE6ZYvQimpMZaPOTd9yZv8BL5EFjdzNJ47ui4Y93uUK05X97nXSK W5XhnJ0YXtmmxMyjgcy6fSM+6+PQ9sjHtU0JQCL0= Received: by web3.nyi.mail.srv.osa (Postfix, from userid 99) id 81DE1112CAE; Wed, 23 Oct 2013 13:14:25 -0400 (EDT) Message-Id: <1382548465.32073.37624113.6AA8DB42@webmail.messagingengine.com> X-Sasl-Enc: ZB3phMnykfvYtnsScG5xuDSYrImvYv+PKGgSX4PlbR7F 1382548465 From: Mark Felder To: Albert Shih , pgsql-admin@postgresql.org, freebsd-fs@freebsd.org, freebsd-jail@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-25c9bdb0 In-Reply-To: <20131023162545.GA19794@pcjas.obspm.fr> References: <20131023162545.GA19794@pcjas.obspm.fr> Subject: Re: ZFS-FreeBSD + postgresql performance Date: Wed, 23 Oct 2013 12:14:25 -0500 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 17:14:33 -0000 On Wed, Oct 23, 2013, at 11:25, Albert Shih wrote: > Hi > > I would like to known if someone here have in production a FreeBSD server > with postgresql and the FS for the data of postgresql is a ZFS pool. > > I'm going to buy some server with 96Go of Ram and a jbod of 12 disks (4To > each) > > The purpose is to have everything on this zfs pool (except the system who > still on classic raid). So to have > > many jail (~20-30) running apache/mysql/etc. > one postgresql server with all data on the zfs. > > each jail use his own zfs partition. So I can use zfs send/received to > have > a mirror of everything in a other server. > > My question is about the performance, I known ZFS eat all memory he can > have (or almost), so what append when we run database like postgresql and > jail ? (it's also the reason of 96 Go ram). > > Sorry for cross-posting but it's about 3 differents things.... > To my understanding the solution is to change the primarycache to "metadata" for any ZFS filesystem that you do not want ZFS to heavily cache in memory. Example: # zfs set primarycache=metadata tank/usr/local/pgsql Now for my ZFS filesystem "tank/usr/local/pgsql" where the postgres data directory exists we will tell ZFS to only cache metadata there. Postgres will do its own caching of the data.