Re: Database performs massive reads when I'm doing writes.

From: bricklen <bricklen(at)gmail(dot)com>
To: Ray Cote <rgacote(at)appropriatesolutions(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database performs massive reads when I'm doing writes.
Date: 2013-06-06 19:44:04
Message-ID: CAGrpgQ_nJftTLEb+7zXtXD46wotHO5AZLv9OJi+yQgx1UM6XUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 6, 2013 at 9:53 AM, Ray Cote
<rgacote(at)appropriatesolutions(dot)com>wrote:

> Starting a few days ago we started to see a strange behavior where writing
> to the database causes massive read operations.
> For example, I have a table that needs to be updated every night (about
> 20,000 rows).
> Using Django ORM, we update them one item at a time.
> Usually the overall process takes a few minutes; it is now taking hours
> (like over 15 hours).
>
> Running atop, we're seeing Read Disk values in the range of 147.2M/10s and
> Write Disk values in the range of 16K/10s.
> Together, the Disk throughput is in the high 90% and frequently hits 100%.
>
> When I'm not writing to the database, it becomes quiet without any disk
> activity.
>
> This is a 256 MByte system and atop shows we're not swapping
>

Is autovacuum set to 'on'?
Possibly there is bloat in your table and indexes; what happens to the
system after you issue a manual "VACUUM ANALYZE VERBOSE"? If that helps,
you might need to make your autovacuum settings more aggressive.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ray Cote 2013-06-06 19:55:05 Re: Database performs massive reads when I'm doing writes.
Previous Message Ioana Danes 2013-06-06 18:21:52 Re: Function use in query