From: Lucas Madar <lucas@negaverse.org>
To: pgsql-admin@postgresql.org
Subject: Problem with bulk inserts
Date: Fri, 20 Sep 2002 16:16:29 -0400
Message-ID: <1032552989.3d8b821d44e78@wwwmail.negaverse.org> (raw)
I am running into a strange problem with postgresql when I attempt to insert
1200 rows per second into a database.
The problem is not due to the machine (Dual Xeon 2.2ghz, 2GB, RAID 1/0, running
FreeBSD 4.6.2-REL).
Postgres consumes approximately 3 to 4% CPU time. Very little disk activity
occurs (0.02MB/sec usually, sometimes there are bursts up to 5MB/sec).
However, postgresql sits there and takes its time processing the insert
queries, while not using any resources. This is leading to a huge backlog of
insert queries.
My configuration is as follows:
shared_buffers = 32768 # 32768 * 8192 = 256MB
sort_mem = 33554432 # 16mb of memory
vacuum_mem = 134217728 # 128mb of memory
fsync = false
Turning 'fsync' on or off does not seem to make a difference.
In top, postgresql generally sits in the 'sbwait' state. I'm assuming this
means it's waiting for a blocking socket. I have tried sending more inserts per
query, but this does not seem to make a difference.
Is this a bug? Is there a better way to handle inserts of this volume?
Thanks,
Lucas Madar <lucas at negaverse dot org>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: lucas@negaverse.org
Subject: Re: Problem with bulk inserts
In-Reply-To: <1032552989.3d8b821d44e78@wwwmail.negaverse.org>
References: <1032552989.3d8b821d44e78@wwwmail.negaverse.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox