From owner-freebsd-questions@FreeBSD.ORG Fri Dec 10 12:50:11 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D802106566C for ; Fri, 10 Dec 2010 12:50:11 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mx1.freebsd.org (Postfix) with ESMTP id BBBED8FC17 for ; Fri, 10 Dec 2010 12:50:10 +0000 (UTC) Received: from localhost (c-67-171-66-177.hsd1.pa.comcast.net [67.171.66.177]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id CB765F7419; Fri, 10 Dec 2010 07:50:09 -0500 (EST) Date: Fri, 10 Dec 2010 07:50:14 -0500 From: Bill Moran To: Gary Gatten Message-Id: <20101210075014.b08b5675.wmoran@potentialtech.com> In-Reply-To: <29967_1291944608_4D0182A0_29967_949_1_D9B37353831173459FDAA836D3B43499A7AF8E5D@WADPMBXV0.waddell.com> References: <29967_1291944608_4D0182A0_29967_949_1_D9B37353831173459FDAA836D3B43499A7AF8E5D@WADPMBXV0.waddell.com> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.18.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "'questions@freebsd.org'" , "'gandalf@shopzeus.com'" , "'danieleff@gmail.com'" Subject: Re: What is loading my server so much? 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: Fri, 10 Dec 2010 12:50:11 -0000 On Thu, 9 Dec 2010 19:30:08 -0600 Gary Gatten wrote: > Could there be a ulimit issue as well? I think shared memory is unaffected by ulimits ... at least, I've never had trouble with ulimit preventing PostgreSQL from allocating gigs and gigs of shared memory, and I don't recall every having to bump ulimits. > > ----- Original Message ----- > From: owner-freebsd-questions@freebsd.org > To: Laszlo Nagy > Cc: questions@freebsd.org ; danieleff@gmail.com > Sent: Thu Dec 09 18:55:26 2010 > Subject: Re: What is loading my server so much? > > On Fri, 10 Dec 2010 00:15:14 +0100 > Laszlo Nagy wrote: > > > > > > First off, you have 24G of RAM available and PostgreSQL only seems to > > > have access to 400M of it. Bump shared_buffers up to 2 or 3 G at least, > > > and bump up work_mem to at least a few hundred meg, and > > > maintenance_work_mem up to at 1/2G or so. > > > > All right. Here is what I did. I setup a new shmmax value this way: > > > > sysctl kern.ipc.shmmax=8589934592 > > > > It is 8G. (By the way I also have kern.ipc.shm_use_phys: 1 ) Then I > > have changed shared_mem to 1024MB in postgresql.conf. > > Then I tried to start postgresql I got this message in the log: > > > > Dec 9 17:53:59 shopzeus postgres[27247]: [1-4] The PostgreSQL > > documentation contains more information about shared memory configuration. > > Dec 9 17:55:52 shopzeus postgres[27328]: [1-1] FATAL: could not create > > shared memory segment: Cannot allocate memory > > Dec 9 17:55:52 shopzeus postgres[27328]: [1-2] DETAIL: Failed system > > call was shmget(key=5432001, size=1105051648, 03600). > > Dec 9 17:55:52 shopzeus postgres[27328]: [1-3] 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 1105051648 bytes), reduce PostgreSQL's shared_buffers > > parameter (currently 131072) and/or its max_connections parameter > > (currently 203). > > Dec 9 17:55:52 shopzeus postgres[27328]: [1-4] The PostgreSQL > > documentation contains more information about shared memory configuration. > > > > I do not understand. > > > > Doc says these: > > > > "max_connections cost ~ 400 bytes of shared memory slot, plus lock space > > (see max_locks_per_transaction)." > > > > Even if I had max_connections = 5000, total shared memory required would > > be way below shmmax=8G. > > > > What am I missing here? > > Did you bump kern.ipc.shmall? The one you bumped is the maximum size of > a single shared memory request, shmall is the maximum amount of shared > memory for the entire system. They both have to be increased. To make > it more confusing, shmall is in pages, not bytes, so you have to divide > by pagesize (sysctl hw.pagesize). > > -Bill > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > > > > > >
>
> "This email is intended to be reviewed by only the intended recipient > and may contain information that is privileged and/or confidential. > If you are not the intended recipient, you are hereby notified that > any review, use, dissemination, disclosure or copying of this email > and its attachments, if any, is strictly prohibited. If you have > received this email in error, please immediately notify the sender by > return email and delete this email from your system." >
>