pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mikkel Lauritsen <renard@tala.dk>
To: pgsql-performance@postgresql.org
Subject: Windows slowness?
Date: Wed, 10 Jun 2020 21:28:51 +0200
Message-ID: <db3f5345af6b95330b2a51fbebbb0f02@tala.dk> (raw)

Hi all,

I have a query that runs much slower in Postgres on Windows than on 
Linux, and I'm so far unable to explain why - the execution plans are 
identical and the hardware is reasonably the same caliber.

Using explain analyze on the database running on Windows I get

->  Index Scan using event_pkey on event t1  (cost=0.56..0.95 rows=1 
width=295) (actual time=0.075..0.075 rows=0 loops=229227)

The server is Postgres 12, and for reasons outside of my control it runs 
on Windows 2012 on a virtual server. It has 4 cores and 32 GB ram 
allocated on a Xeon E5 4660 v4, and running winsat shows satisfactory 
disk and memory bandwidth and CPU performance.

If I copy the database to my laptop running Linux (Postgres 12 on Fedora 
32, i7-9750H, 16 GB ram) I get the exact same execution plan. Explain 
analyze says

->  Index Scan using event_pkey on event t1  (cost=0.56..0.95 rows=1 
width=295) (actual time=0.008..0.008 rows=0 loops=229227)

Note that the index scans are more than 9 times faster on my laptop, and 
the entire query executes about 12 times faster. I realize that each 
core in the laptop CPU is faster than a server core and that 
virtualization doesn't help performance, but I wouldn't expect that to 
make the Windows box 10 times slower.

The table is freshly vacuumed. It has about 10M rows and takes about 
2.6G disk space; the index is about 600M. Everything is cached; there's 
basically no disk I/O happening while the query is executing.

The only Postgres configuration difference between the Windows and Linux 
environments is shared_buffers, which is 4G on my laptop and 512M on the 
Windows server, and effective_cache_size which are 8G on the laptop and 
16G on the server.

I suspect that something is rotten in for example the provisioning of 
the virtualization environment, but before I start pestering the 
operations people I would really appreciate any comments on whether the 
performance difference is to be expected or if there's some obvious 
tuning to try.

Best regards & thanks,
   Mikkel Lauritsen





view thread (4+ messages)  latest in thread

Message-ID: <db3f5345af6b95330b2a51fbebbb0f02@tala.dk>
Permalink:  ../db3f5345af6b95330b2a51fbebbb0f02@tala.dk/
Also on:    postgresql.org/message-id/db3f5345af6b95330b2a51fbebbb0f02@tala.dk

 · 

reply

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: renard@tala.dk
  Subject: Re: Windows slowness?
  In-Reply-To: <db3f5345af6b95330b2a51fbebbb0f02@tala.dk>

* 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