From owner-freebsd-questions@FreeBSD.ORG Thu Dec 9 23:15:20 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 2AF351065672 for ; Thu, 9 Dec 2010 23:15:20 +0000 (UTC) (envelope-from gandalf@shopzeus.com) Received: from fep18.mx.upcmail.net (fep18.mx.upcmail.net [62.179.121.38]) by mx1.freebsd.org (Postfix) with ESMTP id 442518FC0A for ; Thu, 9 Dec 2010 23:15:18 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep18-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20101209231517.IIKL1353.viefep18-int.chello.at@edge02.upcmail.net>; Fri, 10 Dec 2010 00:15:17 +0100 Received: from [192.168.0.101] ([89.132.77.158]) by edge02.upcmail.net with edge id hBFG1f00L3QvkXM02BFHk3; Fri, 10 Dec 2010 00:15:17 +0100 X-SourceIP: 89.132.77.158 Message-ID: <4D016302.70505@shopzeus.com> Date: Fri, 10 Dec 2010 00:15:14 +0100 From: Laszlo Nagy User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; hu; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bill Moran References: <4D00BDF8.6020206@shopzeus.com> <20101209083818.e622a146.wmoran@potentialtech.com> In-Reply-To: <20101209083818.e622a146.wmoran@potentialtech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=YkiHm+ATFBqfWDprzc7VyYVud6sOBg0JMTRaeRDeqNo= c=1 sm=0 a=Xb4xUz3OdD0A:10 a=8nJEP1OIZ-IA:10 a=-eHe1VUEINe11T5p2yYA:9 a=ZpcxRoL9eozjKB6_42cA:7 a=sK8Nx0HzHcojcPJ4y24AuLofni4A:4 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: questions@freebsd.org, 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: Thu, 09 Dec 2010 23:15:20 -0000 > 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? Thanks Laszlo