An old question brought up the performance issues of PostgreSQL on Windows. There’s been some major improvements to PostgreSQL since that time… has the performance gap improved between Windows and the Linux varieties?
An old question brought up the performance issues of PostgreSQL on Windows. There’s been
Share
PostgreSQL performs rather well on Windows these days. You tend to need to use a smaller shared_buffers value so be aware of that when reading tuning advice written for Linux or BSD. The gap in performance has narrowed a lot, but well-tuned Linux+Pg will still outperform well-tuned Windows+Pg.
Most of the (non-file-system related) advice on Pg performance now applies pretty well to Windows and Linux, AFAIK. It’s important to tune random_page_cost and effective_cache_size for best performance, same as on Linux/BSD, and you may find query planner choices to be sub-optimal until you do so. Similarly, you need to pay close attention to your disk subsystem, have as much RAM as possible, etc.
You will have problems with large connection counts on Windows, so I suggest putting PgBouncer or PgPool-II in front of it unless you have an appserver that does its own connection pooling. Pg doesn’t perform particularly well with huge numbers of concurrent connections on *nix either, it’s just worse on Windows.
The connection startup/teardown cost is greater on Windows, which is another reason to use a connection pool where possible. Pg can’t use
fork()to efficiently start new backends, it has toEXEC_BACKENDand do more new-process setup than on Linux.While it’s somewhat more focused on Linux/BSD, I’d recommend the book “PostgreSQL high performance” by Greg Smith, a significant PostgreSQL contributor. If you’re concerned about Pg performance it’s the best place to go.