Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VBKxC-00004y-Pu for pgsql-admin@arkaria.postgresql.org; Mon, 19 Aug 2013 08:36:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VBKxC-00035I-5z for pgsql-admin@arkaria.postgresql.org; Mon, 19 Aug 2013 08:36:46 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VBKxB-00035B-2j for pgsql-admin@postgresql.org; Mon, 19 Aug 2013 08:36:45 +0000 Received: from ks392306.kimsufi.com ([176.31.105.177] helo=cathode.atosc.org) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VBKx8-000184-DV for pgsql-admin@postgresql.org; Mon, 19 Aug 2013 08:36:44 +0000 Received: from [192.168.1.12] (bre70-2-78-243-5-30.fbx.proxad.net [78.243.5.30]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by cathode.atosc.org (Postfix) with ESMTPSA id 3607A60F76 for ; Mon, 19 Aug 2013 10:37:10 +0200 (CEST) Message-ID: <5211D917.5060805@postgresql.fr> Date: Mon, 19 Aug 2013 10:36:39 +0200 From: =?UTF-8?B?U3TDqXBoYW5lIFNjaGlsZGtuZWNodA==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130704 Icedove/17.0.7 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: postgres crashes on insert in 40 different threads References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Le 19/08/2013 10:07, Dzmitry a écrit : > Hey folks, > I have postgres server running on ubuntu 12,Intel Xeon 8 CPUs 29 GB RAM. > With following settings: > max_connections = 550 > shared_buffers = 12GB > temp_buffers = 8MB > max_prepared_transactions = 0 > work_mem = 50MB > maintenance_work_mem = 1GB > fsync = on > wal_buffers = 16MB > commit_delay = 50 > commit_siblings = 7 > checkpoint_segments = 32 > checkpoint_completion_target = 0.9 > effective_cache_size = 22GB > autovacuum = on > autovacuum_vacuum_threshold = 1800 > autovacuum_analyze_threshold = 900 > > I am doing a lot of writes to DB in 40 different threads – so every thread > check if record exists – if not => insert record, if exists => update record. > During this update, my disk IO almost always – 100% and sometimes it crash my > DB with following message: > > 2013-08-19 03:18:00 UTC LOG: checkpointer process (PID 28354) was terminated > by signal 9: Killed > 2013-08-19 03:18:00 UTC LOG: terminating any other active server processes > 2013-08-19 03:18:00 UTC WARNING: terminating connection because of crash of > another server process > 2013-08-19 03:18:00 UTC DETAIL: The postmaster has commanded this server > process to roll back the current transaction and exit, because another server > process exited abnormally and possibly corrupted shared memory. > 2013-08-19 03:18:00 UTC HINT: In a moment you should be able to reconnect to > the database and repeat your command. > 2013-08-19 03:18:00 UTC WARNING: terminating connection because of crash of > another server process > 2013-08-19 03:18:00 UTC DETAIL: The postmaster has commanded this server > process to roll back the current transaction and exit, because another server > process exited abnormally and possibly corrupted shared memory. > 2013-08-19 03:18:00 UTC HINT: In a moment you should be able to reconnect to > the database and repeat your command. > 2013-08-19 03:18:00 UTC WARNING: terminating connection because of crash of > another server process > 2013-08-19 03:18:00 UTC DETAIL: The postmaster has commanded this server > process to roll back the current transaction and exit, because another server > process exited abnormally and possibly corrupted shared memory. > > My DB size is not very big – 169GB. > > Anyone know how can I get rid of DB crash ? > > > Thanks, > Dzmitry > The fact that the checkpointer was killed -9 let me think the OOMKiller has detected you were out of memory. Could that be the case? 12GB of shared_buffers on a 29Gb box is too high. You should try to lower that value to 6GB, for instance. 550*50MB, that is 27GB of RAM that PostgreSQL could try to adress. I can imagine your system is swapping a lot, and you exhaust swap memory before crash. Regards, -- Stéphane Schildknecht Loxodata - Conseil, expertise et formations -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin