Re: Huge number of INSERTs

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Huge number of INSERTs
Date: 2011-11-20 06:11:09
Message-ID: 4EC899FD.5000102@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2011-11-20 06:16:23 Re: Installed. Now what?
Previous Message Amitabh Kant 2011-11-20 05:57:34 Re: Installed. Now what?