Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UDvST-0002R1-Gy for pgsql-performance@arkaria.postgresql.org; Fri, 08 Mar 2013 11:27:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UDvST-0008JJ-00 for pgsql-performance@arkaria.postgresql.org; Fri, 08 Mar 2013 11:27:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UDvSS-0008JD-9B for pgsql-performance@postgresql.org; Fri, 08 Mar 2013 11:27:28 +0000 Received: from mail.sihirhosting.com ([77.92.143.143]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UDvSL-0000M7-7r for pgsql-performance@postgresql.org; Fri, 08 Mar 2013 11:27:27 +0000 Received: (qmail 6328 invoked by uid 509); 8 Mar 2013 13:27:18 +0200 Received: from 212.156.129.218 by gaya (envelope-from , uid 507) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.7/2391. spamassassin: 3.0.2. perlscan: 1.25-st-qms. Clear:RC:0(212.156.129.218):SA:0(-97.0/6.7):. Processed in 1.708464 secs); 08 Mar 2013 11:27:18 -0000 X-Spam-Status: No, hits=-97.0 required=6.7 X-Antivirus-MYDOMAIN-Mail-From: emre.hasegeli@tart.com.tr via gaya X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(212.156.129.218):SA:0(-97.0/6.7):. Processed in 1.708464 secs Process 6295) Received: from unknown (HELO hasegeli.local) (emre.hasegeli@tart.com.tr@212.156.129.218) by mail.sihirhosting.com with AES256-SHA encrypted SMTP; 8 Mar 2013 13:27:17 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: pgsql-performance@postgresql.org Date: Fri, 08 Mar 2013 13:27:16 +0200 Subject: PostgreSQL 9.2.3 performance problem caused Exclusive locks Cc: dba@tart.com.tr MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Emre Hasegeli" Organization: =?utf-8?B?VGFydCDEsG50ZXJuZXQgVGVrbm9sb2ppbGVyaSBUaWNhcmV0IEHFng==?= Message-ID: User-Agent: Opera Mail/12.14 (MacIntel) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hi, I upgraded our master database server from 9.2.2 to 9.2.3 on Monday. We have been experiencing performance problems since then. Yesterday, our application hit the connection limit 5 times. It causes approximately 15 seconds of downtime. The database server hit 50 load average, then everything came back to normal. We have a very good database server dedicated to PostgreSQL. It has 64 cores and 200 GiB of RAM which is 2 times bigger than our database. We run PostgreSQL on RHEL relase 6.2. The database executes 2k transactions per second in busy hours. The server is running 1 - 2 load average normally. PostgreSQL writes several following logs during the problem which I never saw before 9.2.3: LOG: process 4793 acquired ExclusiveLock on extension of relation 305605 of database 16396 after 2348.675 ms The relation 305605 was the biggest table of the database. Our application stores web service logs as XML's on that table. It is only used to insert new rows. One row is approximately 2 MB and 50 rows inserted per second at most busy times. We saw autovacuum processes during the problem. We disabled autovacuum for that table but is does not help. I tried to archive the table. Create a new empty one, but it does not help, too. We also have an unlogged table to used by our application for locking. It is autovacuumed every 5 minutes as new rows are inserted and deleted continuously. Most of our configuration parameters remain default except the following: max_connections = 200 shared_buffers = 64GB max_prepared_transactions = 0 work_mem = 64MB maintenance_work_mem = 512MB shared_preload_libraries = '$libdir/pg_stat_statements' wal_level = hot_standby checkpoint_segments = 40 effective_cache_size = 128GB track_activity_query_size = 8192 autovacuum = on autovacuum_max_workers = 10 I will try to reduce autovacuum_max_workers and increase max_connections to avoid downtime. Do you have any other suggestions? Do you know what might have caused this problem? Do you think downgrading to 9.2.2 is a good idea? -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance