From owner-freebsd-questions@FreeBSD.ORG Mon Mar 20 21:17:36 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC43016A400 for ; Mon, 20 Mar 2006 21:17:36 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61D5C43D45 for ; Mon, 20 Mar 2006 21:17:36 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 7E8185E76; Mon, 20 Mar 2006 16:17:33 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 78023-02; Mon, 20 Mar 2006 16:17:32 -0500 (EST) Received: from [199.103.21.238] (pan.codefab.com [199.103.21.238]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id A75545C75; Mon, 20 Mar 2006 16:17:32 -0500 (EST) In-Reply-To: <441F125F.8030101@123.com.sv> References: <441F125F.8030101@123.com.sv> Mime-Version: 1.0 (Apple Message framework v746.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2F7CD998-9048-4299-BEED-9CA475787B2B@mac.com> Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Mon, 20 Mar 2006 16:17:31 -0500 To: Miguel X-Mailer: Apple Mail (2.746.3) X-Virus-Scanned: amavisd-new at codefab.com Cc: freebsd-questions@freebsd.org Subject: Re: setting shmmax for postgres 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: Mon, 20 Mar 2006 21:17:36 -0000 On Mar 20, 2006, at 3:36 PM, Miguel wrote: > shiva2# sysctl -a kern.ipc.shmmax > kern.ipc.shmmax: 2147483647 > > but postgres always fails with this error > > The PostgreSQL documentation contains more information about shared > memory configuration. > FATAL: could not create shared memory segment: Cannot allocate memory > DETAIL: Failed system call was shmget(key=5432001, > size=1149067264, 03600). > HINT: This error usually means that PostgreSQL's request for a > shared memory segment exceeded available memory or swap space. To > reduce the request size (currently 1149067264 bytes), reduce > PostgreSQL's shared_buffers parameter (currently 137626) and/or its > max_connections parameter (currently 200). Just how much RAM do you have in the machine? I don't think you can allocate more than 256MB or so to SysV shared memory without tuning the number of KVA pages being allocated to the kernel...? Maybe it depends on whether the SysV shmem segments are wired down by default or not, I think there's a sysctl which controls that. You should revert Postgres back to a more reasonable default shared region size for now and rebuild the kernel to increase these parameters if you actually have the RAM and the need to do so. -- -Chuck