pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #9342: CPU / Memory Run-away
5+ messages / 5 participants
[nested] [flat]

* BUG #9342: CPU / Memory Run-away
@ 2014-02-24 20:47 cnielsen@atlassian.com
  2014-02-25 17:06 ` Re: BUG #9342: CPU / Memory Run-away Heikki Linnakangas <hlinnakangas@vmware.com>
  2014-02-25 21:49 ` Re: BUG #9342: CPU / Memory Run-away Peter Geoghegan <pg@heroku.com>
  0 siblings, 2 replies; 5+ messages in thread

From: cnielsen@atlassian.com @ 2014-02-24 20:47 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      9342
Logged by:          Christopher Nielsen
Email address:      cnielsen@atlassian.com
PostgreSQL version: 9.2.6
Operating system:   CentOS 6.5
Description:        


Hello,

Thanks very much for authoring such a full-featured and useful database. 
It’s been a rock-solid component of many applications I’ve worked with, and
am very glad to see it grow.

There is an issue we’ve run into recently, that could be a database bug, and
it would be great to get someone’s input.

In the last few months, and more frequently, recently, we have seen Postgres
run away with CPU and disk resources.

When this occurs, performance becomes degraded, and response time for all
queries increases.

This seems to happen, regardless of query-load, and often happens when
traffic to the application is very low.

Here is some more information that characterizes the issue we found.

Some symptoms include:

    * The machine load is very high (many times of the number of cpus
available)
    * The CPU is 100% utilized, with 85% user and 15% sys
    * We do not see increase in iowait, that we might expect from a storage
issue
    * All query results take significantly longer to be delivered
    * The issue can be worked around, by restarting the database
        - This gives us downtime we would like to avoid
    * On strace, we often workers stuck on semop syscalls 

Our setup, looks like the below:

    System Properties:
        
        PG Version:     9.2.6
        OS and Version: CentOS 6.5 running 2.6.32-431.3.1
        CPU:            80 cores (Intel Xeon)
        Memory:         252 GB
 
    Postgresql Setup:

        * 1 master and 3 slaves streaming replication from the master
        * WALs are archived using rsync in the archive_command
        * WAL files on the master are stored on a separate partition
        * Both pgdata and pg_xlog partitions have CFQ IO scheduler set.
            - We plan to switch both to either deadline or noop,
              possibly if that could help

We have core and stack traces available, and would love to collaborate with
anyone who has time to look into the issue with us, anytime.

Thanks very much again,

Chris



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #9342: CPU / Memory Run-away
  2014-02-24 20:47 BUG #9342: CPU / Memory Run-away cnielsen@atlassian.com
@ 2014-02-25 17:06 ` Heikki Linnakangas <hlinnakangas@vmware.com>
  2014-02-27 00:10   ` Re: BUG #9342: CPU / Memory Run-away Christopher Nielsen <cnielsen@atlassian.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Heikki Linnakangas @ 2014-02-25 17:06 UTC (permalink / raw)
  To: cnielsen@atlassian.com; +Cc: pgsql-bugs

On 02/24/2014 10:47 PM, cnielsen@atlassian.com wrote:
> We have core and stack traces available, and would love to collaborate with
> anyone who has time to look into the issue with us, anytime.

Feel free to post the stack traces on this list, so that everyone can 
have a look.

- Heikki


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #9342: CPU / Memory Run-away
  2014-02-24 20:47 BUG #9342: CPU / Memory Run-away cnielsen@atlassian.com
  2014-02-25 17:06 ` Re: BUG #9342: CPU / Memory Run-away Heikki Linnakangas <hlinnakangas@vmware.com>
@ 2014-02-27 00:10   ` Christopher Nielsen <cnielsen@atlassian.com>
  2014-02-27 00:33     ` Re: BUG #9342: CPU / Memory Run-away Jeff Janes <jeff.janes@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Christopher Nielsen @ 2014-02-27 00:10 UTC (permalink / raw)
  To: pgsql-bugs

Thank you, Heikki,

 We have core and stack traces available, and would love to collaborate with
>> anyone who has time to look into the issue with us, anytime.
>
>

>  Feel free to post the stack traces on this list, so that everyone can
> have a look.
>

Linked is a strace / status / syscall list of what our postgres processes
were doing, at the time of the run-away.

    Archive on Google
Drive<https://drive.google.com/a/atlassian.com/file/d/0B9wdVVUs5uWVTVVSSXpZN0JxX3M/edit?usp=sharing;
(Will
bonk on "approve" on request)

Also included, is a copy of the postgresql.conf, for reference.

It seemed funny that a db-wide slow-down should happen, independent of
increased query / app load.

Thanks again for any insight, or opinions, into what could be going on,

-Chris

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #9342: CPU / Memory Run-away
  2014-02-24 20:47 BUG #9342: CPU / Memory Run-away cnielsen@atlassian.com
  2014-02-25 17:06 ` Re: BUG #9342: CPU / Memory Run-away Heikki Linnakangas <hlinnakangas@vmware.com>
  2014-02-27 00:10   ` Re: BUG #9342: CPU / Memory Run-away Christopher Nielsen <cnielsen@atlassian.com>
@ 2014-02-27 00:33     ` Jeff Janes <jeff.janes@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Jeff Janes @ 2014-02-27 00:33 UTC (permalink / raw)
  To: Christopher Nielsen <cnielsen@atlassian.com>; +Cc: pgsql-bugs

On Wed, Feb 26, 2014 at 4:10 PM, Christopher Nielsen <cnielsen@atlassian.com
> wrote:

> Thank you, Heikki,
>
>  We have core and stack traces available, and would love to collaborate
>>> with
>>> anyone who has time to look into the issue with us, anytime.
>>
>>
>
>>  Feel free to post the stack traces on this list, so that everyone can
>> have a look.
>>
>
> Linked is a strace / status / syscall list of what our postgres processes
> were doing, at the time of the run-away.
>
>     Archive on Google Drive<https://drive.google.com/a/atlassian.com/file/d/0B9wdVVUs5uWVTVVSSXpZN0JxX3M/edit?usp=sharing; (Will
> bonk on "approve" on request)
>
> Also included, is a copy of the postgresql.conf, for reference.
>
> It seemed funny that a db-wide slow-down should happen, independent of
> increased query / app load.
>
> Thanks again for any insight, or opinions, into what could be going on,
>


Hi Chris,

It is the very high max_connections that is allowing the problem to happen.
 If you only have 80 cores, nothing good can happen by allowing 3000
connections.  Once the connections start spending most of their time
fighting each over internal locks (spinlocks and lwlocks) than doing what
they came for, you will never recover because queries continue to come in
faster than they can be handled.  So by allowing too many connections, you
allow a (probably) transient load spike to turn into a permanent overload
condition.

It looks like you need a connection pooler (or more than one) in front of
your database.

Cheers,

Jeff

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #9342: CPU / Memory Run-away
  2014-02-24 20:47 BUG #9342: CPU / Memory Run-away cnielsen@atlassian.com
@ 2014-02-25 21:49 ` Peter Geoghegan <pg@heroku.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Peter Geoghegan @ 2014-02-25 21:49 UTC (permalink / raw)
  To: cnielsen@atlassian.com; +Cc: pgsql-bugs

On Mon, Feb 24, 2014 at 12:47 PM,  <cnielsen@atlassian.com> wrote:
> This seems to happen, regardless of query-load, and often happens when
> traffic to the application is very low.

Is there anything that these queries share in common? Is there a GIN
index involved?

Speaking of bugs, perhaps you could see to it that this one is fixed?  :-)

http://help.hipchat.com/forums/138883-suggestions-issues/suggestions/5163526-wrong-sort-order-c-loca...


-- 
Peter Geoghegan


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2014-02-27 00:33 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 20:47 BUG #9342: CPU / Memory Run-away cnielsen@atlassian.com
2014-02-25 17:06 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2014-02-27 00:10   ` Christopher Nielsen <cnielsen@atlassian.com>
2014-02-27 00:33     ` Jeff Janes <jeff.janes@gmail.com>
2014-02-25 21:49 ` Peter Geoghegan <pg@heroku.com>

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