From owner-freebsd-stable@FreeBSD.ORG Fri May 10 02:18:44 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E017451A for ; Fri, 10 May 2013 02:18:44 +0000 (UTC) (envelope-from benjamindadams@gmail.com) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id B28CE169 for ; Fri, 10 May 2013 02:18:44 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id 9so6638271iec.8 for ; Thu, 09 May 2013 19:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Z4n52HTkN0OOuXpebMB9tBVQDFQ3cEGzG0cr5CpdvTs=; b=zIxxqmA+AYI0LaCE8vMi3U+iKJlBvcDsUpXe34E/QJswGE0rWStzZLGwpEgKAPVXMa RarAsWtlzzNmEdOuxuG+6Ooi21NEY5tv85ndTMpKlgrFihk7Wt1d8A7A9v/BU2lxBSRy 7KIyzyabYaoqQQqMb46B2FvpHEWHGrPjxqEApPZTBmmQEWXz7OFXSAtPxtG333VqkTo2 zu/z3DuVWmaDPccF6ZxTRjpt6TZg50P69lnUDWLPm6Tc3m4y4YzXgqWQ+rwSbs28LZu9 ly+D6XkK8pxsMgy+wd9r7qTVdEvYpTRp+O4nk2fRAprqg/MxExCezivZ6y22JAllP0iN ZmhA== X-Received: by 10.50.192.165 with SMTP id hh5mr449896igc.89.1368152324461; Thu, 09 May 2013 19:18:44 -0700 (PDT) Received: from localhost.localdomain (cpe-67-249-53-57.twcny.res.rr.com. [67.249.53.57]) by mx.google.com with ESMTPSA id o10sm1484933igh.2.2013.05.09.19.18.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 09 May 2013 19:18:43 -0700 (PDT) Message-ID: <518C5902.5050909@gmail.com> Date: Thu, 09 May 2013 22:18:42 -0400 From: Benjamin Adams User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 To: Jeremy Chadwick Subject: Re: recommended memory for zfs References: <518BA237.3030700@gmail.com> <518C450B.5070809@ShaneWare.Biz> <518C51AF.5050609@gmail.com> <20130510020628.GA98750@icarus.home.lan> In-Reply-To: <20130510020628.GA98750@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org, Shane Ambler X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 02:18:44 -0000 On 05/09/2013 10:06 PM, Jeremy Chadwick wrote: > On Thu, May 09, 2013 at 09:47:27PM -0400, Benjamin Adams wrote: >> On 05/09/2013 08:53 PM, Shane Ambler wrote: >>> On 09/05/2013 22:48, Benjamin Adams wrote: >>>> Hello zfs question about memory. >>>> I heard zfs is very ram hungry. >>>> Service looking to run: >>>> - nginx >>>> - postgres >>>> - php-fpm >>>> - python >>>> >>>> I have a machine with two quad core cpus but only 4 G Memory >>>> >>>> I'm looking to buy more ram now. >>>> What would be the recommend amount of memory for zfs across 6 drives on >>>> this setup? >>>> >>> I believe I heard a calculation of 1GB cache per 1TB of disk. But >>> basically zfs will use all free ram available if you access that >>> much data from disk. You will want to set vfs.zfs.arc_max to allow >>> enough ram for your apps to work in. >>> >>> If you consider the files for your website and the data you store >>> you may find that you would never fill more than 500MB of cache. >>> >>> If you will be serving large media files that will easily use up >>> the cache you could give them their own filesystem that only >>> caches metadata - zfs set primarycache=metadata zroot/mediafiles >>> >>> >> Thanks for all the replies Size of DB and HD's are: >> >> Current DB Size = 23 GB >> HD sizes = (6) 500 GB drives > Nobody is going to be able to give you a precise/accurate recommendation > given the lack of detail provided, I'm sorry to say. What's the RES > size of nginx (all processes combined)? What's the RES size of > postgres (same)? Do you have PHP scripts that "run amok" for long > periods of time and take up lots of RAM? Same with python? How many > concurrent visitors and what sort of content are you hosting? Do you > maintain/write your own PHP/Python code or are you using some crap like > Wordpress? > > This is just a **small** list of questions -- and what may come as a > shock is that I do not expect you to provide answers to any of them. > They are questions that you should, for yourself, attempt to answer and > work out what you need from there ("teach a man to fish" and all that). > > The advice of "1GB of RAM per 1TB of disk space" is absolute nonsense on > numerous levels -- whoever gave this advice to Shane either has no > understanding of how filesystems/ZFS works, or does but chose to > simplify to the point where they're providing half-ass information. > There is no direct, or even indirect, correlation between disk capacity > and ZFS ARC size -- what matter is your "working set" (to quote Tom). > You need to have some idea of how much disk I/O you're doing, and what > type of I/O (sequential or random). > > If you want my general advice, Benjamin, it's this: get yourself a > system with *minimum* 8GB of RAM but has the physical possibility of > supporting more (and only add more RAM when/if you know you need it); do > not bother with ZFS on a system with 4GB. Run amd64, not i386 (I don't > recommend bothering with ZFS on i386 -- I am not going to get into a > discussion about this either). Run stable/9, not 9.1-RELEASE. Avoid > compression and dedup. And test disk failures as well (don't get caught > with your pants down later). > > The above advice comes from someone who did hosting (web/ssh/etc.) for > almost 20 years with KISS principle applied at all levels. YMMV though, > depending on what all you're doing/what you truly need. > > Good luck. > Jeremy, Was just see if I should just get raid controller and more ram down the road. List of priorities. Main thing is I move from BSD when 9.0 came out. Was looking to see if zfs is included in the installer. Now. Sum up: upgrade ram to 16GB (not 64 like plained) and raid controller that supports level 5. Thanks Ben