From owner-freebsd-fs@FreeBSD.ORG Mon Oct 3 18:37:19 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 1EA3D106566C for ; Mon, 3 Oct 2011 18:37:19 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id BD2EE8FC08 for ; Mon, 3 Oct 2011 18:37:18 +0000 (UTC) Received: by gyf2 with SMTP id 2so4719780gyf.13 for ; Mon, 03 Oct 2011 11:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=TkaN6FYArBBBOffnlJrhRvrOoW62uoiMzWNUkqCDqeo=; b=KObN0Y/etQUX1oJtOhmOGwJWeMRTaubEqmthEc6ItZemojBv7qz7Crf9f9FFNa++27 u0EoX/H2fSqwhtC9dHt9Vbq10JZQYEwpPKdrmx3hz0cUHUJIqWCMJ4ZjDaJgRoo04hAK 1La1scBaZzBbY9j1tYDiPgFqUq+TS4SqXmbPg= MIME-Version: 1.0 Received: by 10.150.91.2 with SMTP id o2mr465471ybb.107.1317667038190; Mon, 03 Oct 2011 11:37:18 -0700 (PDT) Received: by 10.151.145.18 with HTTP; Mon, 3 Oct 2011 11:37:18 -0700 (PDT) In-Reply-To: References: <20111002020231.GA70864@icarus.home.lan> Date: Mon, 3 Oct 2011 11:37:18 -0700 Message-ID: From: Xin LI To: Ivan Voras Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org Subject: Re: is TMPFS still highly experimental? 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, 03 Oct 2011 18:37:19 -0000 On Sun, Oct 2, 2011 at 3:33 PM, Ivan Voras wrote: > On 02/10/2011 07:27, Xin LI wrote: > >> The problem Ivan have asserted was not confirmed by anyone who have >> swap configured properly. =C2=A0Gleb have pointed out that it might be >> related to a series of integer overflow by the way (he have also fixed >> a lot of tmpfs issues by the way). > > Well, instead of guessing I can point you to the way I got the original > situation - you said you have ZFS configured so it would be easy for you > to check. > > You should to something like this: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0- configure your system to the best of your ab= ilities (but post what > you did different from the defaults) It's mostly "normal" configuration -- 6GB RAM, 14GB swap, ZFS as /usr; The following sysctl tweaks were done to make postgresql start (these are not scientific, just large enough to make it work): kern.ipc.shmmax=3D4294967296 kern.ipc.shmall=3D1048576 > =C2=A0 =C2=A0 =C2=A0 =C2=A0- install postgresql (8.4+, but I don't think = the version is > important), configure it so it gets half the system memory or 2/3 the > system memory for its shared_buffers. Configured to half of system memory (3072MB). # ipcs -a Message Queues: T ID KEY MODE OWNER GROUP CREATOR CGROUP CBYTES QNUM QBYTES LSPID LRPID STIME RTIME CTIME Shared Memory: T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME m 65536 5432001 --rw------- pgsql pgsql pgsql pgsql 6 3295936512 2130 2130 10:57:12 11:09:17 10:57:12 Semaphores: T ID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS OTIME CTIME s 65536 5432001 --rw------- pgsql pgsql pgsql pgsql 17 11:09:25 10:57:12 s 65537 5432002 --rw------- pgsql pgsql pgsql pgsql 17 10:57:12 10:57:12 > =C2=A0 =C2=A0 =C2=A0 =C2=A0- install pgbench Done. > =C2=A0 =C2=A0 =C2=A0 =C2=A0- initialize pgbench so that the database defi= nitely is larger than the > entire memory you got (NOTE: THIS IS NOT A CONTRIVED TEST - lots of > databases in practice are larger than the RAM in the server). Initialized with pgbench -i -s 500 pgbench. > =C2=A0 =C2=A0 =C2=A0 =C2=A0- run pgbench & observe the results. pgbench -t 20000 -c 64 -S pgbench Can't seem to reproduce: # df -Httmpfs Filesystem Size Used Avail Capacity Mounted on tmpfs 10G 69k 10G 0% /tmp Any suggestions? > This should create really bad contention problem for memory between > postgresql and ZFS, which should manifest itself in tmpfs shrinking to 0 > bytes free. > > If you don't get this problem then great, it might be solved! > > > (for more info on pgbench, see this: > http://www.westnet.com/~gsmith/content/postgresql/pgbench-scaling.htm). > > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > --=20 Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die