Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E13749F974C for ; Sat, 25 Aug 2007 18:24:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 45037-06 for ; Sat, 25 Aug 2007 18:23:55 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.189]) by postgresql.org (Postfix) with ESMTP id 1A9229F974B for ; Sat, 25 Aug 2007 18:23:59 -0300 (ADT) Received: by fk-out-0910.google.com with SMTP id b27so1078113fka for ; Sat, 25 Aug 2007 14:23:58 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:to:subject:from:cc:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; b=CqjBR071bNwLxV7TSikVI01S5O5bRHusz58VuB8bqvHrfcGXAU4fAVxdmIBbo1ZRsCq3WZ2j7x5K2w2ngFj/vRNxdUUdAgmprhd5tPY3Q9EwrHJKBmcOD7RMQ5peIu1AKu9yIVmAeuYsDI+G7+7hPHkOr6HKyY6qVDE4kQUc2PM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:subject:from:cc:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; b=RseKDdROWhqD+HxXioa+NGwUOSqdM77f8tpw2P65aUWAdJmgdf1Y5l8OkvXuKvk51OMytcnaBrZKkiiPgbLB5lsPB0qxOXAnVuEQRqEqi1N8R1FHrjysS15kE4j4CSqCBt44z9t+6DfRXkN4LuGa/Ac0iYwXuWVhduS0QmemUqY= Received: by 10.86.1.1 with SMTP id 1mr1740673fga.1188077038742; Sat, 25 Aug 2007 14:23:58 -0700 (PDT) Received: from 1-rtt202dnf3uds.mshome.net ( [85.113.33.1]) by mx.google.com with ESMTPS id i4sm4858037nfh.2007.08.25.14.23.52 (version=SSLv3 cipher=OTHER); Sat, 25 Aug 2007 14:23:53 -0700 (PDT) Date: Sun, 26 Aug 2007 02:22:23 +0400 To: "Martijn van Oosterhout" Subject: Re: Shared memory usage From: "Max Zorloff" Cc: "pgsql-general@postgresql.org" , "pgsql-performance@postgresql.org" Content-Type: text/plain; format=flowed; delsp=yes; charset=koi8-r MIME-Version: 1.0 References: <20070825203951.GA14526@svana.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20070825203951.GA14526@svana.org> User-Agent: Opera Mail/9.02 (Win32) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/1585 X-Sequence-Number: 119434 On Sun, 26 Aug 2007 00:39:52 +0400, Martijn van Oosterhout wrote: > On Sun, Aug 26, 2007 at 01:22:58AM +0400, Max Zorloff wrote: >> Hello. >> >> I have a postgres 8.0 and ~400mb database with lots of simple selects >> using indexes. >> I've installed pgpool on the system. I've set num_init_children to 5 and >> here is the top output. >> One of postmasters is my demon running some insert/update tasks. I see >> that they all use cpu heavily, but do not use the shared memory. >> shared_buffers is set to 60000, yet they use a minimal part of that. I'd >> like to know why won't they use more? All the indexes and half of the >> database should be in the shared memory, is it not? Or am I completely >> missing what are the shared_buffers for? If so, then how do I put my >> indexes and at least a part of the data into memory? > > shared_memory is used for caching. It is filled as stuff is used. If > you're not using all of it that means it isn't needed. Remember, it is > not the only cache. Since your database is only 400MB it will fit > entirely inside the OS disk cache, so you really don't need much shared > memory at all. > > Loading stuff into memory for the hell of it is a waste, let the system > manage the memory itself, if it needs it, it'll use it. > > Have a nice day, Could it be that most of the cpu usage is from lots of fast indexed sql queries wrapped in sql functions?