Re: Huge number of INSERTs - Mailing list pgsql-general

From Tomas Vondra
Subject Re: Huge number of INSERTs
Date
Msg-id 4EC899FD.5000102@fuzzy.cz
Whole thread Raw
In response to Re: Huge number of INSERTs  (Phoenix Kiula <phoenix.kiula@gmail.com>)
Responses Re: Huge number of INSERTs
List pgsql-general
Dne 18.11.2011 13:30, Phoenix Kiula napsal(a):
> Full DB:   32GB
> The big table referenced above:  28 GB
>
> It's inserts into this one that are taking time.

Hm, in that case the shared_buffers is probably too low. It'd be nice to
have at least the indexes on the table in the buffers, and I guess
they're significantly over 256MB (your shared_buffers).

But regarding the "vmstat 5 10" output you've posted, you probably don't
issue with I/O as the iowait is 0 most of the time.

You do have a serious problem with CPU, though - most of the time, the
CPU is almost 100% utilized. Not sure which process is responsible for
this, but this might be the main problem problem.

I'm not saying adding a row to the table (and indexes) is extremely
expensive, but you do have an insane number of processes (350
connections, a lot of apache workers) and a lot of them are asking for
CPU time.

So once again: set the number of connections and workers to sane values,
considering your current hardware. Those numbers are actually a handy
throttle - you may increase the numbers until the CPU is reasonably
utilized (don't use 100%, leave a reasonable margin - I wouldn't go
higher than 90%).

Tomas

pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Huge number of INSERTs
Next
From: Tomas Vondra
Date:
Subject: Re: Installed. Now what?