From: Ezequiel Lovelle <elovelle@dialdata.com.ar>
To: pgsql-performance@postgresql.org
Subject: slow loop inserts?
Date: Sun, 15 May 2011 19:02:39 -0300
Message-ID: <284696193619d8ac712400941bc5946c@dialdata.com.ar> (raw)
Hi, I'm new to postgres and I have the next question.
I have a
php program that makes 100000 inserts in my database.
autoincrement
numbers inserted into a table with 5 columns.
The script takes about 4
minutes from a webserver
Is it a normal time?
How could reduce this
time by a bulce of inserts?
When I turn off fsync get much more
performance, but it is not ideal in power failure
HARDWARE: 2 disks
1TB 7200 rpm with software raid 1 (gmirror raid)
8 Gb RAM
CPU Intel
Quad Core 2.4 Ghz
OS: Freebsd 8.2
POSTGRES VERSION: 9.0.4
MY
POSTGRES CONFIG:
listen_addresses = '*'
wal_level = archive
fsync =
on
archive_mode = on
archive_command = 'exit 0'
maintenance_work_mem
= 480MB
checkpoint_completion_target = 0.5
effective_cache_size =
5632MB
work_mem = 40MB
wal_buffers = 16MB
checkpoint_segments = 30
shared_buffers = 1920MB
max_connections = 40
MY EXECUTION TIME OF MY
SCRIPT:
[root@webserver ~]# time php script.php
real 4m54.846s
user
0m2.695s
sys 0m1.775s
MY SCIPT:
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: elovelle@dialdata.com.ar
Subject: Re: slow loop inserts?
In-Reply-To: <284696193619d8ac712400941bc5946c@dialdata.com.ar>
* 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