Re: Database performs massive reads when I'm doing writes. - Mailing list pgsql-general

From Ray Cote
Subject Re: Database performs massive reads when I'm doing writes.
Date
Msg-id 13809757.3380.1370548501758.JavaMail.rgacote@ip-225.appropriatesolutions.com
Whole thread Raw
In response to Re: Database performs massive reads when I'm doing writes.  (bricklen <bricklen@gmail.com>)
List pgsql-general


From: "bricklen" <bricklen@gmail.com>
To: "Ray Cote" <rgacote@appropriatesolutions.com>
Cc: pgsql-general@postgresql.org
Sent: Thursday, June 6, 2013 3:44:04 PM
Subject: Re: [GENERAL] Database performs massive reads when I'm doing writes.

On Thu, Jun 6, 2013 at 9:53 AM, Ray Cote <rgacote@appropriatesolutions.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.
Yes Autovacuum is set to 'on'.
I'll run a Vacuum Analyze Verbose after the data load finally completes (which could easily be another two hours).
Don't want to touch the system until this data finally gets loaded.

Thanks for the recommendation.
--Ray



--
Ray Cote, President Appropriate Solutions, Inc.
We Build Software
www.AppropriateSolutions.com 603.924.6079

pgsql-general by date:

Previous
From: bricklen
Date:
Subject: Re: Database performs massive reads when I'm doing writes.
Next
From: Adarsh Sharma
Date:
Subject: Re: Load Mysql table CSV into postgresql