Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 7CFE99FA24F for ; Tue, 2 Oct 2007 15:37:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 71929-03 for ; Tue, 2 Oct 2007 15:37:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by postgresql.org (Postfix) with ESMTP id 1F3B99FA20D for ; Tue, 2 Oct 2007 15:37:06 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id u77so8814776pyb for ; Tue, 02 Oct 2007 11:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:reply-to:to:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=Iqn49DROXXBxQjlatELZ+tX1+WsJUfcVKeAnzGBbOtw=; b=Zisz+MMXoVhOBdSIf3nyJB/LwX2Tp2fTZxf2QG4gxL4b189B7b/l32ktVhBj8PpZ72ZXEtvRUjBEp/ZVYspRZ59p5PM7O3I4xIwY/EocGNfDjMKRWy8BM3SCGy22xe/pxJuaZhD6PG6uNaK3qwHA0qWatx/6EQAJjd7drK7E7Ks= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:reply-to:to:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=K8sHrxvxsUvuycan8wTqp+nHSP78XAdc0W6iiKez4Zy3+CspfGk+E/l5zQECDiOmStFcMjC2Fk+v+zu1PZJZF24J+nq9NMdbI9hn//nnmMf6shms1YxrX07ZDXP1PJYSJV75GHpuwIptRUqqgRKiTRB6LmN+kO6qRM8Nqobl+Is= Received: by 10.65.214.19 with SMTP id r19mr6806296qbq.1191350219466; Tue, 02 Oct 2007 11:36:59 -0700 (PDT) Received: from ?192.168.1.212? ( [206.114.45.106]) by mx.google.com with ESMTPS id 38sm2743058nza.2007.10.02.11.36.52 (version=SSLv3 cipher=RC4-MD5); Tue, 02 Oct 2007 11:36:56 -0700 (PDT) Subject: Re: Linux mis-reporting memory From: Adam Tauno Williams Reply-To: adamtaunowilliams@gmail.com To: pgsql-performance@postgresql.org In-Reply-To: <094E11EB-8F17-4C96-993A-4AD637404F91@decibel.org> References: <20070920230400.GM95343@decibel.org> <16213.1190329934@sss.pgh.pa.us> <87r6ksa1jb.fsf@oxford.xeocode.com> <1190363401.4661.116.camel@PCD12478> <87r6ksuzf8.fsf@oxford.xeocode.com> <094E11EB-8F17-4C96-993A-4AD637404F91@decibel.org> Content-Type: text/plain Date: Tue, 02 Oct 2007 14:37:30 -0400 Message-Id: <1191350250.5466.6.camel@aleph.wmmi.net> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/4 X-Sequence-Number: 27026 > >> But then why is it not reporting that in the "Swap: used" > >> section ? It > >> only reports 42308k used swap. > > Hm, good point. > > The other possibility is that Postgres just hasn't even touched a > > large part > > of its shared buffers. > Sorry for the late reply... > No, this is on a very active database server; the working set is > almost certainly larger than memory (probably by a fair margin :( ), "almost certainly" > and all of the shared buffers should be in use. "should be" It would be better to just check! :) The catalogs and informational views will give you definitive answers to these quests. > I'm leaning towards "top on linux == dumb". I disagree, it just isn't the appropriate tool for the job. What top tells you is lots of correct information, it just isn't the right information. For starters try - SELECT 'HEAP:' || relname AS table_name, (heap_blks_read + heap_blks_hit) AS heap_hits, ROUND(((heap_blks_hit)::NUMERIC / (heap_blks_read + heap_blks_hit) * 100), 2) AS heap_buffer_percentage FROM pg_statio_user_tables WHERE (heap_blks_read + heap_blks_hit) > 0 UNION SELECT 'TOAST:' || relname, (toast_blks_read + toast_blks_hit), ROUND(((toast_blks_hit)::NUMERIC / (toast_blks_read + toast_blks_hit) * 100), 2) FROM pg_statio_user_tables WHERE (toast_blks_read + toast_blks_hit) > 0 UNION SELECT 'INDEX:' || relname, (idx_blks_read + idx_blks_hit) AS heap_hits, ROUND(((idx_blks_hit)::NUMERIC / (idx_blks_read + idx_blks_hit) * 100), 2) FROM pg_statio_user_tables WHERE (idx_blks_read + idx_blks_hit) > 0 -- Adam Tauno Williams, Network & Systems Administrator Consultant - http://www.whitemiceconsulting.com Developer - http://www.opengroupware.org