Unix Technical Forum

Performance of PostgreSQL on Windows vs Linux

This is a discussion on Performance of PostgreSQL on Windows vs Linux within the Pgsql Performance forums, part of the PostgreSQL category; --> I am sure that this has been discussed before, but I can't seem to find any recent posts. (I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 10:01 AM
Jeremy Haile
 
Posts: n/a
Default Performance of PostgreSQL on Windows vs Linux

I am sure that this has been discussed before, but I can't seem to find
any recent posts. (I am running PostgreSQL 8.2)

I have always ran PostgreSQL on Linux in the past, but the company I am
currently working for uses Windows on all of their servers. I don't
have the luxury right now of running my own benchmarks on the two OSes,
but wanted to know if anyone else has done a performance comparison. Is
there any significant differences?

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 10:01 AM
Magnus Hagander
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

Jeremy Haile wrote:
> I am sure that this has been discussed before, but I can't seem to find
> any recent posts. (I am running PostgreSQL 8.2)
>
> I have always ran PostgreSQL on Linux in the past, but the company I am
> currently working for uses Windows on all of their servers. I don't
> have the luxury right now of running my own benchmarks on the two OSes,
> but wanted to know if anyone else has done a performance comparison. Is
> there any significant differences?


That depends on your usage pattern. There are certainly cases where the
Win32 version will be significantly slower.
For example, if you open a lot of new connections, that is a lot more
expensive on Windows since each connection needs to execute a new
backend due to the lack of fork().

I don't think you'll find any case where the Windows version is faster
than Linux ;-) But to get a good answer on if the difference is
significant enough to matter, you really need to run some kind of simple
benchmark on *your* workload.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 10:01 AM
Dimitri Fontaine
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

Le jeudi 4 janvier 2007 00:18, Magnus Hagander a écrit*:
> But to get a good answer on if the difference is
> significant enough to matter, you really need to run some kind of simple
> benchmark on *your* workload.


To easily stress test a couple of servers and compare results on *your*
workload, please consider using both pgfouine[1,2] and tsung[3].

The companion tool tsung-ploter[4] (for plotting several results using common
graph, hence scales), may also be usefull.

[1]: http://pgfouine.projects.postgresql.org/
[2]: http://pgfouine.projects.postgresql.org/tsung.html
[3]: http://tsung.erlang-projects.org/
[4]: http://debian.dalibo.org/unstable/ts...r_0.1-1.tar.gz

Regards,
--
Dimitri Fontaine
http://www.dalibo.com/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBFnEBYl4JX7QVNfwQRAsaTAJ0Qexnf+zEHo40rUq9lSp SB9T0uFwCfcZeA
bYa/HZ1gBxJm5LUBdTGTCnY=
=plSO
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 10:01 AM
Jeremy Haile
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

Thanks for the recommendations. I wasn't familiar with those packages!

On Thu, 4 Jan 2007 00:46:32 +0100, "Dimitri Fontaine" <dim@dalibo.com>
said:
> Le jeudi 4 janvier 2007 00:18, Magnus Hagander a écrit :
> > But to get a good answer on if the difference is
> > significant enough to matter, you really need to run some kind of simple
> > benchmark on *your* workload.

>
> To easily stress test a couple of servers and compare results on *your*
> workload, please consider using both pgfouine[1,2] and tsung[3].
>
> The companion tool tsung-ploter[4] (for plotting several results using
> common
> graph, hence scales), may also be usefull.
>
> [1]: http://pgfouine.projects.postgresql.org/
> [2]: http://pgfouine.projects.postgresql.org/tsung.html
> [3]: http://tsung.erlang-projects.org/
> [4]: http://debian.dalibo.org/unstable/ts...r_0.1-1.tar.gz
>
> Regards,
> --
> Dimitri Fontaine
> http://www.dalibo.com/


---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 10:01 AM
Jeremy Haile
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

Thanks for the response! I know I have to benchmark them to get a real
answer. I am just looking to hear someone say "We benchmarked Linux vs.
Windows with similar configuration and hardware and experienced a 25%
performance boost in Linux." or "We benchmarked them and found no
significant difference."

I realize the situation varies based on usage patterns, but I'm just
looking for some general info based on anyone else's experiences.

My usage pattern is a single application that hits the database. The
application uses a connection pool, so opening lots of connections is
not a huge issue. However - it does have very large tables and
regularly queries and inserts into these tables. I insert several
million rows into 3 tables every day - and also delete about the same
amount.



On Thu, 04 Jan 2007 00:18:23 +0100, "Magnus Hagander"
<magnus@hagander.net> said:
> Jeremy Haile wrote:
> > I am sure that this has been discussed before, but I can't seem to find
> > any recent posts. (I am running PostgreSQL 8.2)
> >
> > I have always ran PostgreSQL on Linux in the past, but the company I am
> > currently working for uses Windows on all of their servers. I don't
> > have the luxury right now of running my own benchmarks on the two OSes,
> > but wanted to know if anyone else has done a performance comparison. Is
> > there any significant differences?

>
> That depends on your usage pattern. There are certainly cases where the
> Win32 version will be significantly slower.
> For example, if you open a lot of new connections, that is a lot more
> expensive on Windows since each connection needs to execute a new
> backend due to the lack of fork().
>
> I don't think you'll find any case where the Windows version is faster
> than Linux ;-) But to get a good answer on if the difference is
> significant enough to matter, you really need to run some kind of simple
> benchmark on *your* workload.
>
> //Magnus


---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-19-2008, 10:01 AM
Tom Lane
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

"Jeremy Haile" <jhaile@fastmail.fm> writes:
> Thanks for the response! I know I have to benchmark them to get a real
> answer. I am just looking to hear someone say "We benchmarked Linux vs.
> Windows with similar configuration and hardware and experienced a 25%
> performance boost in Linux." or "We benchmarked them and found no
> significant difference."


I've heard anecdotal reports both ways: "there's no difference" and
"there's a big difference". So there's no substitute for benchmarking
your own application.

I think one big variable in this is which PG version you are testing.
We've been gradually filing down some of the rough edges in the native
Windows port, so I'd expect that the performance gap is closing over
time. I don't know how close to closed it is in 8.2, but I'd surely
suggest that you do your benchmarking with 8.2.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-19-2008, 10:01 AM
Jeremy Haile
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

I'm using 8.2. I don't know when I'll get a chance to run my own
benchmarks. (I don't currently have access to a Windows and Linux
server with similar hardware/configuration) But when/if I get a chance
to run them, I will post the results here.

Thanks for the feedback.

Jeremy Haile


On Thu, 04 Jan 2007 10:23:51 -0500, "Tom Lane" <tgl@sss.pgh.pa.us> said:
> "Jeremy Haile" <jhaile@fastmail.fm> writes:
> > Thanks for the response! I know I have to benchmark them to get a real
> > answer. I am just looking to hear someone say "We benchmarked Linux vs.
> > Windows with similar configuration and hardware and experienced a 25%
> > performance boost in Linux." or "We benchmarked them and found no
> > significant difference."

>
> I've heard anecdotal reports both ways: "there's no difference" and
> "there's a big difference". So there's no substitute for benchmarking
> your own application.
>
> I think one big variable in this is which PG version you are testing.
> We've been gradually filing down some of the rough edges in the native
> Windows port, so I'd expect that the performance gap is closing over
> time. I don't know how close to closed it is in 8.2, but I'd surely
> suggest that you do your benchmarking with 8.2.
>
> regards, tom lane


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-19-2008, 10:03 AM
Jim C. Nasby
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

On Wed, Jan 03, 2007 at 12:24:24PM -0500, Jeremy Haile wrote:
> I am sure that this has been discussed before, but I can't seem to find
> any recent posts. (I am running PostgreSQL 8.2)
>
> I have always ran PostgreSQL on Linux in the past, but the company I am
> currently working for uses Windows on all of their servers. I don't
> have the luxury right now of running my own benchmarks on the two OSes,
> but wanted to know if anyone else has done a performance comparison. Is
> there any significant differences?


One thing to consider... I've seen a case or two where pgbench running
on windows with HyperThreading enabled was actually faster than with it
turned off. (General experience has been that HT hurts PostgreSQL). I
suspect that the windows kernel may have features that allow it to
better utilize HT than linux.

Of course if you don't have HT... it doesn't matter.
--
Jim Nasby jim@nasby.net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-19-2008, 10:03 AM
Jeremy Haile
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

Hey Jim -

Thanks for the feedback. The server has dual Xeons with HyperThreading
enabled - so perhaps I should try disabling it. How much performance
boost have you seen by disabling it? Of course, the bottleneck in my
case is more on the I/O or RAM side, not the CPU side.

Jeremy Haile


On Wed, 10 Jan 2007 14:15:26 -0600, "Jim C. Nasby" <jim@nasby.net> said:
> On Wed, Jan 03, 2007 at 12:24:24PM -0500, Jeremy Haile wrote:
> > I am sure that this has been discussed before, but I can't seem to find
> > any recent posts. (I am running PostgreSQL 8.2)
> >
> > I have always ran PostgreSQL on Linux in the past, but the company I am
> > currently working for uses Windows on all of their servers. I don't
> > have the luxury right now of running my own benchmarks on the two OSes,
> > but wanted to know if anyone else has done a performance comparison. Is
> > there any significant differences?

>
> One thing to consider... I've seen a case or two where pgbench running
> on windows with HyperThreading enabled was actually faster than with it
> turned off. (General experience has been that HT hurts PostgreSQL). I
> suspect that the windows kernel may have features that allow it to
> better utilize HT than linux.
>
> Of course if you don't have HT... it doesn't matter.
> --
> Jim Nasby jim@nasby.net
> EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-19-2008, 10:04 AM
Scott Marlowe
 
Posts: n/a
Default Re: Performance of PostgreSQL on Windows vs Linux

On Wed, 2007-01-10 at 14:15, Jim C. Nasby wrote:
> On Wed, Jan 03, 2007 at 12:24:24PM -0500, Jeremy Haile wrote:
> > I am sure that this has been discussed before, but I can't seem to find
> > any recent posts. (I am running PostgreSQL 8.2)
> >
> > I have always ran PostgreSQL on Linux in the past, but the company I am
> > currently working for uses Windows on all of their servers. I don't
> > have the luxury right now of running my own benchmarks on the two OSes,
> > but wanted to know if anyone else has done a performance comparison. Is
> > there any significant differences?

>
> One thing to consider... I've seen a case or two where pgbench running
> on windows with HyperThreading enabled was actually faster than with it
> turned off. (General experience has been that HT hurts PostgreSQL). I
> suspect that the windows kernel may have features that allow it to
> better utilize HT than linux.


I've also seen a few comments in perform (and elsewhere) in the past
that newer linux kernels seem to handle HT better than older ones, and
also might give better numbers for certain situations.

Note that you should really test with a wide variety of loads (i.e. a
lot of parallel loads, a few etc...) to see what the curve looks like.
If HT gets you 10% gain on 4 or fewer clients, but 20% slower with 8
clients, then hyperthreading might be a not so good choice.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com