Re: Postgres refusing to use >1 core - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: Postgres refusing to use >1 core
Date
Msg-id 4DC81A3F020000250003D433@gw.wicourts.gov
Whole thread Raw
In response to Postgres refusing to use >1 core  (Aren Cambre <aren@arencambre.com>)
Responses Re: Postgres refusing to use >1 core
List pgsql-performance
Aren Cambre <aren@arencambre.com> wrote:

> Postgres won't use more than 1 CPU core.

One *connection* to PostgreSQL won't directly use more than one
core.  As Merlin suggests, perhaps you're really only running one
query at a time?  The other possibility is that you're somehow
acquiring locks which cause one process to block others.

>    - Core i7 processor--4 physical cores, but OS sees 8 cores
>    via hyper-threading

Most benchmarks I've seen comparing hyper-threading show that
PostgreSQL performs better if you don't try to convince it that one
core is actually two different cores.  With HT on, you tend to see
context switching storms, and performance suffers.

> At first, the app pounds all 8 cores.

You really shouldn't let the marketers get to you like that.  You
have four cores, not eight.

The most important information for finding your bottleneck is
probably going to be in pg_stat_activity and pg_locks.

-Kevin

pgsql-performance by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Postgres refusing to use >1 core
Next
From: Aren Cambre
Date:
Subject: Re: Postgres refusing to use >1 core