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

From Ray Cote
Subject Database performs massive reads when I'm doing writes.
Date
Msg-id 21030682.3225.1370537595804.JavaMail.rgacote@ip-225.appropriatesolutions.com
Whole thread Raw
Responses Re: Database performs massive reads when I'm doing writes.  (bricklen <bricklen@gmail.com>)
Re: Database performs massive reads when I'm doing writes.  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
Hello:

I have a PostgreSQL 9.0.3 database that has suddenly started exhibiting odd read behavior.

The version number is:
"PostgreSQL 9.0.3 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50), 64-bit"
This was compiled from source about a year ago and has been running just fine.
The database feeds a very low-volume web site (a few hits per minute).

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.

There's nothing unusual in the PostgreSQL logs.

Appreciate any pointers as to how I go about identifying the root cause of this problem.

Thanks.

--Ray


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


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Trouble with replication
Next
From: Adarsh Sharma
Date:
Subject: Load Mysql table CSV into postgresql