Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B13D2B5D944 for ; Fri, 17 Jun 2011 17:47:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 61808-04 for ; Fri, 17 Jun 2011 20:47:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from forward7.mail.yandex.net (forward7.mail.yandex.net [77.88.61.37]) by mail.postgresql.org (Postfix) with ESMTP id 1356AB5D803 for ; Fri, 17 Jun 2011 17:47:36 -0300 (ADT) Received: from web94.yandex.ru (web94.yandex.ru [77.88.60.18]) by forward7.mail.yandex.net (Yandex) with ESMTP id AE2CE1C1357; Sat, 18 Jun 2011 00:47:25 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1308343645; bh=1Hfj1I8PiWlIVAQVGj0f1DR4WSSmNCrvSHFLKj7ytTY=; h=From:To:Cc:In-Reply-To:References:Subject:MIME-Version:Message-Id: Date:Content-Transfer-Encoding:Content-Type; b=ptUq2Xj9PdWhMUVGD8mz5lyczjNIPekaYK5C7bz4kPIcv88OfHfiapuvPXV7Qm3qu leTjgLUZQVNRblZpfgRdzt+gu0Ka3r4hNdJXqf4vP9fse03ZmAGwWk5bc5kWaLBH2Q a58hBrSeSZoVcMzcNbTxdDTImx8TSMDKlrHgQPy0= Received: from localhost (localhost.localdomain [127.0.0.1]) by web94.yandex.ru (Yandex) with ESMTP id 9379919C0350; Sat, 18 Jun 2011 00:47:25 +0400 (MSD) X-Yandex-Spam: 1 Received: from dhcp174-219-red.yandex.net (dhcp174-219-red.yandex.net [95.108.174.219]) by web94.yandex.ru with HTTP; Sat, 18 Jun 2011 00:47:23 +0400 From: =?koi8-r?B?4c7Uz84g89TF0MHOxc7Lzw==?= To: Merlin Moncure Cc: Kevin Grittner ,pgsql-bugs@postgresql.org In-Reply-To: References: <1208551308255001@web137.yandex.ru> <4DFA2130020000250003E76A@gw.wicourts.gov> <438511308318660@web144.yandex.ru> <4DFB32F4020000250003E7E2@gw.wicourts.gov> <1202541308329125@web105.yandex.ru> <56961308340142@web152.yandex.ru> Subject: Re: could not read block XXXXX in file "base/YYYYY/ZZZZZZ": read only 160 of 8192 bytes MIME-Version: 1.0 Message-Id: <1245841308343644@web94.yandex.ru> Date: Sat, 18 Jun 2011 00:47:23 +0400 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.372 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FSL_RU_URL=2.271, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201106/158 X-Sequence-Number: 30537 > > I wonder if you are oversubscribing your memory, and are getting weird > errors when reading data into memory because the pages can't be > reserved to do that. šWhat happens when you enable overcommit and > attempt to start the server? > > merlin In my first post I wrote: "I tried to set vm.overcommit_memory=2 and vm.overcommit_ratio=90 - no sense. Then I tried vm.overcommit_memory=1 - no sense." "No sense" means that server starts, works for about 3 hours, and then dies with signal 7 and almost all buffers filled. Just as with vm.overcommit_memory=0. I copypasted vmstat log, that shows that there were 5Gb of free memory when postgresql died. In one of my experiments postgresql worked for about half an hour with 0k free memory (at least top and vmstat said so). Abscence of free memory was caused by the fact that replica had been down for 12 hours or so, and when started wal writer procees took much resources. But it was woking! With no free memory. But this is not important. As I noticed the thing is not how much free memory I have. The thing is how shared buffers are filled. And shared buffers fillings makes sense only when they are set to 12Gb. When they set to less - everything works fine. If I am oversubcribing memory - then I expect to get some "out of memory error" and see 0k free in top output. Memory for shared buffers can not be ovesubscribed - because if kernel did not provide enough shared memory postgres will not start. If I am wrong - please, explain why and where.