Skip site navigation (1) Skip section navigation (2)

Re: PostgreSQL is extremely slow on Windows

From: "Vig, Sandor (G/FI-2)" <Sandor(dot)Vig(at)audi(dot)hu>
To: 'Magnus Hagander' <mha(at)sollentuna(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: PostgreSQL is extremely slow on Windows
Date: 2005-02-23 10:41:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance

I changed fsync to false. It took 8 minutes to restore the full database.
That is 26 times faster than before. :-/ (aprox. 200 tps)
With background writer it took 12 minutes. :-(

The funny thing is, I had a VMWARE emulation on the same Windows mashine,
running Red Hat, with fsync turned on. It took also 8 minutes to finish.
Probably the Linux code is better + VMWARE optimises (physical) disk

It seems to me, I need 2 types of operating modes:
- For bulk loading (database restore) : fsync=false
- Normal operation fsync=true

Am I right? How can I do it "elegantly"?

I Think, it should be a "performance tuning guide" in the docomentation.
(not just explaning the settings) Playing with the settings could be quite

Anyway, thanks for the tips.

Vig Sándor

-----Original Message-----
From: Magnus Hagander [mailto:mha(at)sollentuna(dot)net]
Sent: Tuesday, February 22, 2005 7:15 PM
To: Vig, Sandor (G/FI-2); pgsql-performance(at)postgresql(dot)org
Subject: RE: [PERFORM] PostgreSQL is extremely slow on Windows

>I've downloaded the latest release (PostgreSQL 8.0) for windows.
>Installation was OK, but I have tried to restore a database.
>It had more than ~100.000 records. Usually I use PostgreSQL
>under Linux, and it used to be done under 10 minutes.
>Under W2k und XP it took 3 hours(!) Why is it so slow????
>The commands I used:
>Under Linux: (duration: 1 minute)
>	pg_dump -D databasename > databasename.db
>Under Windows: (duration: 3 - 3.5 hours(!))
>	psql databasename < databasename.db >nul
>It seemed to me, that only 20-30 transactions/sec were
>writen to the database.

20-30 transactionsi s about what you'll get on a single disk on Windows
We have a patch in testing that will bring this up to about 80.
You can *never* get above 80 without using write cache, regardless of
your OS, if you have a single disk. You might want to look into wether
write cacheing is enabled on your linux box, and disable it. (unless you
are using RAID) A lot points towards write cache enabled on your system.

If you need the performance that equals the one with write cache on, you
can set fsync=off. But then you will lose the guarantee that your
machine will survive an unclean shutdown or crash. I would strongly
advice against it on a production system - same goes for running with
write cache!


The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any

pgsql-performance by date

Next:From: Butkus_CharlesDate: 2005-02-23 13:06:08
Subject: Re: Joins, Deletes and Indexes
Previous:From: Richard HuxtonDate: 2005-02-23 08:39:47
Subject: Re: Joins, Deletes and Indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group