Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wdars-000140-5S for pgsql-performance@arkaria.postgresql.org; Fri, 25 Apr 2014 07:48:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wdarr-0004VD-HT for pgsql-performance@arkaria.postgresql.org; Fri, 25 Apr 2014 07:48:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wdarp-0004V4-8b for pgsql-performance@postgresql.org; Fri, 25 Apr 2014 07:48:17 +0000 Received: from mail-ie0-x233.google.com ([2607:f8b0:4001:c03::233]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wdarl-0004v7-Ud for pgsql-performance@postgresql.org; Fri, 25 Apr 2014 07:48:16 +0000 Received: by mail-ie0-f179.google.com with SMTP id lx4so3515787iec.10 for ; Fri, 25 Apr 2014 00:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=HDqZzEOXstEjnQM2UrGAAunpp5zKUHaz25jNXMUG1GY=; b=wa/XRJtnQqHrD8maKv2P+ZNwZ1dGS9qHrhS/+pD9mQihJmOGJ+wHQfAje6nVV+38pI ZmFagnB7cV+eAllsgOTf3O4rZbYOmHVcJUTz2o5gd6uuxVcqTGBbyPY04wmyjeupk1yQ L2KLBS0hhe4aMh+jLohZrdlgNUlUmqtfTNkTnKieaRnYmybjwyXDgmDgdYxw4Gfk8zm4 9j9W4yypy/NezzBUw/ub/rw7ZvOIhV0pcsW0GR+hVIdt8+ISOWoSpxejjmWc2sx6IGlo a8zFQ6LlLufJuvNT2Y+qVP8zWRIDDeva7mCI7e+rAuIFwy9vrIr+I4AfPnzXfyi4EVnv uBkw== X-Received: by 10.50.67.3 with SMTP id j3mr3417468igt.10.1398412092390; Fri, 25 Apr 2014 00:48:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.163.8 with HTTP; Fri, 25 Apr 2014 00:47:51 -0700 (PDT) From: =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0KjQsNC70LDRiNC+0LI=?= Date: Fri, 25 Apr 2014 11:47:51 +0400 Message-ID: Subject: Server vacuuming the same table again and again To: "pgsql-performance@postgresql.org" Content-Type: multipart/alternative; boundary=047d7bdc18a00446a604f7d9304a X-Pg-Spam-Score: -2.0 (--) 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 --047d7bdc18a00446a604f7d9304a Content-Type: text/plain; charset=UTF-8 Hi! Half a day ago one of our production PG servers (arguably busiest one) become very slow; I went to investigate the issue and found that it runs simultaneously '(auto)VACUUM ANALYZE recommendations' - largest table on that server - and checkpoint, giving a 100% disk load, that resulted with queue of queries which only made things worse of course. For a while I tried to set different ionice settings to wal writer and checkpointer processes (-c 2 -n [5-7]) for no visible effect. Then I cancelled autovacuum and it seems to help. When things settled up and day was reaching end I started VACUUM ANALYZE of this table by hand and continued observations. Vacuum ended in about 2 hours and half. But soon I noticed that server started another autovacuum of the same table... Problems returned and resolved after it finished (not 100% sure it was the reason though). In the morning autovacuum was back. And then it finished and I gone to work. And now I'm here and there is autovacuum again %) And load too. But I had to say, sometimes there is autovacuum and no load. I'm not really sure autovacuum is the culprit, but there is correlation and it behaves strange anyway. In the app code nothing changed I believe. Any recommendations where to dig further? PG version: 9.2.8 Server hardware: E5-2690 x 2, 96GB RAM, 146GB 15k SAS x 8, HP P420i 2G RAID controller, raid 1 for system and raid 50 for DB. Perfomance settings changed: shared_buffers = 24GB temp_buffers = 128MB work_mem = 16MB maintenance_work_mem = 1GB effective_cache_size = 48GB effective_io_concurrency = 6 (I just realised I have to set it to 4, right?) synchronous_commit = off checkpoint_segments = 64 checkpoint_timeout = 10min checkpoint_completion_target = 0.8 checkpoint_warning = 3600s Plus I set vm.dirty_background_bytes to 134217728 and vm.dirty_bytes to 1073741824. Also I believe now that raid 1 for system might be a mistake. Maybe give it for WAL? Best regards, Dmitriy Shalashov --047d7bdc18a00446a604f7d9304a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!

Half a day ago one of our productio= n PG servers (arguably busiest one) become very slow; I went to investigate= the issue and found that it runs simultaneously '(auto)VACUUM ANALYZE = recommendations' - largest table on that server - and checkpoint, givin= g a 100% disk load, that resulted with queue of queries which only made thi= ngs worse of course.
For a while I tried to set different ionice settings to wal writer and= checkpointer processes (-c 2 -n [5-7]) for no visible effect. Then I cance= lled autovacuum and it seems to help.

When things = settled up and day was reaching end I started VACUUM ANALYZE of this table = by hand and continued observations.
Vacuum ended in about 2 hours and half. But soon I noticed that server= started another autovacuum of the same table...
Problems returne= d and resolved after it finished (not 100% sure it was the reason though).<= /div>

In the morning autovacuum was back. And then it finishe= d and I gone to work. And now I'm here and there is autovacuum again %)=
And load too. But I had to say, sometimes there is autovacuum an= d no load. I'm not really sure autovacuum is the culprit, but there is = correlation and it behaves strange anyway.
In the app code nothing changed I believe.

An= y recommendations where to dig further?

PG version= : 9.2.8

Server hardware: E5-2690 x 2, 96GB RAM, 14= 6GB 15k SAS x 8, HP P420i 2G RAID controller, raid 1 for system and raid 50= for DB.

Perfomance settings changed:
shared_buffers = =3D 24GB
temp_buffers =3D 128MB
work_mem =3D 16MB
=
maintenance_work_mem =3D 1GB
effective_cache_size =3D 48= GB
effective_io_concurrency =3D 6 (I just realised I have to set it to 4,= right?)
synchronous_commit =3D off
checkpoint= _segments =3D 64
checkpoint_timeout =3D 10min
checkpoin= t_completion_target =3D 0.8
checkpoint_warning =3D 3600s

Plus I set= vm.dirty_background_bytes to 134217728 and vm.dirty_bytes to 1073741824.

Also I believe now that raid 1 for system might be = a mistake. Maybe give it for WAL?

Best regards,
Dmitriy Shalasho= v
--047d7bdc18a00446a604f7d9304a--