pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedOverusing 1 CPU
6+ messages / 5 participants
[nested] [flat]
* Overusing 1 CPU
@ 2010-06-02 11:12 Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:24 ` Re: Overusing 1 CPU Matthew Wakeling <matthew@flymine.org>
0 siblings, 1 reply; 6+ messages in thread
From: Mozzi @ 2010-06-02 11:12 UTC (permalink / raw)
To: pgsql-performance
Hallo all
I have a strange problem here.
I have a pgsql database running on Intel hardware here, it has 8 cores
hyperthreaded so you see 16 cpu's.
This box is basically adle @ the moment as it is still in testing yet
top shows high usage on just 1 of the cores.
mpstat gives the below.
As you can see only cpu 1 is verey bussy, the rest are idle.
Thanx
Mozzi
13:02:19 CPU %usr %nice %sys %iowait %irq %soft %steal
%guest %idle
13:02:21 all 4.70 0.00 0.41 1.57 0.00 0.00 0.00
0.00 93.32
13:02:21 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 1 72.68 0.00 5.37 21.46 0.00 0.49 0.00
0.00 0.00
13:02:21 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 3 0.00 0.00 0.51 0.00 0.00 0.00 0.00
0.00 99.49
13:02:21 4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 5 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 6 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 7 0.00 0.00 0.36 0.00 0.00 0.00 0.00
0.00 99.64
13:02:21 8 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 9 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 10 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 11 0.00 0.00 0.00 1.00 0.00 0.00 0.00
0.00 99.00
13:02:21 12 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
13:02:21 13 0.00 0.00 0.00 2.00 0.00 0.00 0.00
0.00 98.00
13:02:21 14 0.00 0.00 0.51 0.00 0.00 0.00 0.00
0.00 99.49
13:02:21 15 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: CPU %usr %nice %sys %iowait %irq %soft %steal
%guest %idle
Average: all 4.66 0.00 0.43 1.46 0.00 0.04 0.00
0.00 93.41
Average: 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 1 72.27 0.00 5.47 21.58 0.00 0.59 0.00
0.00 0.10
Average: 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 3 0.10 0.00 0.50 0.00 0.00 0.00 0.00
0.00 99.40
Average: 4 0.10 0.00 0.10 0.00 0.00 0.00 0.00
0.00 99.80
Average: 5 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 6 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 7 0.00 0.00 0.10 0.60 0.00 0.00 0.00
0.00 99.30
Average: 8 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 9 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 10 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 11 0.00 0.00 0.00 0.20 0.00 0.00 0.00
0.00 99.80
Average: 12 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
Average: 13 0.00 0.00 0.10 0.40 0.00 0.00 0.00
0.00 99.50
Average: 14 0.00 0.00 0.50 0.00 0.00 0.00 0.00
0.00 99.50
Average: 15 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 100.00
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Overusing 1 CPU
2010-06-02 11:12 Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
@ 2010-06-02 11:24 ` Matthew Wakeling <matthew@flymine.org>
2010-06-02 11:37 ` Re: Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Wakeling @ 2010-06-02 11:24 UTC (permalink / raw)
To: Mozzi <mozzi.glug@gmail.com>; +Cc: pgsql-performance
On Wed, 2 Jun 2010, Mozzi wrote:
> This box is basically adle @ the moment as it is still in testing yet
> top shows high usage on just 1 of the cores.
First port of call: What process is using the CPU? Run top on a fairly
wide terminal and use the "c" button to show the full command line.
Matthew
--
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it. - Kernighan
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Overusing 1 CPU
2010-06-02 11:12 Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:24 ` Re: Overusing 1 CPU Matthew Wakeling <matthew@flymine.org>
@ 2010-06-02 11:37 ` Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:48 ` Re: Overusing 1 CPU J. Roeleveld <joost@antarean.org>
2010-06-02 11:58 ` Re: Overusing 1 CPU A. Kretschmer <andreas.kretschmer@schollglas.com>
2010-06-02 11:59 ` Re: Overusing 1 CPU Stephen Frost <sfrost@snowman.net>
0 siblings, 3 replies; 6+ messages in thread
From: Mozzi @ 2010-06-02 11:37 UTC (permalink / raw)
To: Matthew Wakeling <matthew@flymine.org>; +Cc: pgsql-performance
Hi
Thanx mate Create Index seems to be the culprit.
Is it normal to just use 1 cpu tho?
Mozzi
On Wed, 2010-06-02 at 12:24 +0100, Matthew Wakeling wrote:
> On Wed, 2 Jun 2010, Mozzi wrote:
> > This box is basically adle @ the moment as it is still in testing yet
> > top shows high usage on just 1 of the cores.
>
> First port of call: What process is using the CPU? Run top on a fairly
> wide terminal and use the "c" button to show the full command line.
>
> Matthew
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Overusing 1 CPU
2010-06-02 11:12 Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:24 ` Re: Overusing 1 CPU Matthew Wakeling <matthew@flymine.org>
2010-06-02 11:37 ` Re: Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
@ 2010-06-02 11:48 ` J. Roeleveld <joost@antarean.org>
2 siblings, 0 replies; 6+ messages in thread
From: J. Roeleveld @ 2010-06-02 11:48 UTC (permalink / raw)
To: pgsql-performance
On Wednesday 02 June 2010 13:37:37 Mozzi wrote:
> Hi
>
> Thanx mate Create Index seems to be the culprit.
> Is it normal to just use 1 cpu tho?
If it is a single-threaded process, then yes.
And a "Create index" on a single table will probably be single-threaded.
If you now start a "create index" on a different table, a different CPU should
be used for that.
>
> Mozzi
>
> On Wed, 2010-06-02 at 12:24 +0100, Matthew Wakeling wrote:
> > On Wed, 2 Jun 2010, Mozzi wrote:
> > > This box is basically adle @ the moment as it is still in testing yet
> > > top shows high usage on just 1 of the cores.
> >
> > First port of call: What process is using the CPU? Run top on a fairly
> > wide terminal and use the "c" button to show the full command line.
> >
> > Matthew
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Overusing 1 CPU
2010-06-02 11:12 Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:24 ` Re: Overusing 1 CPU Matthew Wakeling <matthew@flymine.org>
2010-06-02 11:37 ` Re: Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
@ 2010-06-02 11:58 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
2 siblings, 0 replies; 6+ messages in thread
From: A. Kretschmer @ 2010-06-02 11:58 UTC (permalink / raw)
To: pgsql-performance
In response to Mozzi :
> Hi
>
> Thanx mate Create Index seems to be the culprit.
> Is it normal to just use 1 cpu tho?
If you have only one client, yes. If you have more then one active
connections, every connection will use one CPU. In your case: create
index can use only one CPU.
Regards, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Overusing 1 CPU
2010-06-02 11:12 Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:24 ` Re: Overusing 1 CPU Matthew Wakeling <matthew@flymine.org>
2010-06-02 11:37 ` Re: Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
@ 2010-06-02 11:59 ` Stephen Frost <sfrost@snowman.net>
2 siblings, 0 replies; 6+ messages in thread
From: Stephen Frost @ 2010-06-02 11:59 UTC (permalink / raw)
To: Mozzi <mozzi.glug@gmail.com>; +Cc: Matthew Wakeling <matthew@flymine.org>; pgsql-performance
Mozzi,
* Mozzi (mozzi.glug@gmail.com) wrote:
> Thanx mate Create Index seems to be the culprit.
> Is it normal to just use 1 cpu tho?
Yes, PG can only use 1 CPU for a given query or connection. You'll
start to see the other CPUs going when you have more than one connection
to the database. If you're building alot of indexes then you probably
want to split up the statements into multiple connections and run them
in parallel.
Thanks,
Stephen
Attachments:
signature.asc (application/pgp-signature, 196B) download
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2010-06-02 11:59 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-06-02 11:12 Overusing 1 CPU Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:24 ` Matthew Wakeling <matthew@flymine.org>
2010-06-02 11:37 ` Mozzi <mozzi.glug@gmail.com>
2010-06-02 11:48 ` J. Roeleveld <joost@antarean.org>
2010-06-02 11:58 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
2010-06-02 11:59 ` Stephen Frost <sfrost@snowman.net>
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