Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-27 Thread Merlin Moncure
On Thu, Sep 26, 2013 at 10:14 PM, Merlin Moncure wrote: > On Thu, Sep 26, 2013 at 6:08 PM, Andres Freund wrote: >> On 2013-08-27 12:17:55 -0500, Merlin Moncure wrote: >>> On Tue, Aug 27, 2013 at 10:55 AM, Andres Freund >>> wrote: >>> > On 2013-08-27 09:57:38 -0500, Merlin Moncure wrote: >>> >>

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-26 Thread Merlin Moncure
On Thu, Sep 26, 2013 at 6:08 PM, Andres Freund wrote: > On 2013-08-27 12:17:55 -0500, Merlin Moncure wrote: >> On Tue, Aug 27, 2013 at 10:55 AM, Andres Freund >> wrote: >> > On 2013-08-27 09:57:38 -0500, Merlin Moncure wrote: >> >> + bool >> >> + RecoveryMightBeInProgress(void) >> >> + { >> >> +

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-26 Thread Andres Freund
On 2013-08-27 12:17:55 -0500, Merlin Moncure wrote: > On Tue, Aug 27, 2013 at 10:55 AM, Andres Freund > wrote: > > On 2013-08-27 09:57:38 -0500, Merlin Moncure wrote: > >> + bool > >> + RecoveryMightBeInProgress(void) > >> + { > >> + /* > >> + * We check shared state each time only until

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Andres Freund
On 2013-09-17 08:40:23 -0500, Merlin Moncure wrote: > > If you ever get into the situation I mistakenly referred to again, I'd > > strongly suggest recompling postgres with -fno-omit-frame-pointer. That > > makes hierarchical profiles actually useful which can help tremendously > > with diagnosing

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Merlin Moncure
On Tue, Sep 17, 2013 at 8:35 AM, Andres Freund wrote: > On 2013-09-17 08:32:30 -0500, Merlin Moncure wrote: >> On Tue, Sep 17, 2013 at 8:24 AM, Andres Freund >> wrote: >> > On 2013-09-17 08:18:54 -0500, Merlin Moncure wrote: >> >> Do you think it's worth submitting the lock avoidance patch for f

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Andres Freund
On 2013-09-17 08:32:30 -0500, Merlin Moncure wrote: > On Tue, Sep 17, 2013 at 8:24 AM, Andres Freund wrote: > > On 2013-09-17 08:18:54 -0500, Merlin Moncure wrote: > >> Do you think it's worth submitting the lock avoidance patch for formal > >> review? > > > > You mean the bufmgr.c thing? General

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Merlin Moncure
On Tue, Sep 17, 2013 at 8:24 AM, Andres Freund wrote: > On 2013-09-17 08:18:54 -0500, Merlin Moncure wrote: >> Do you think it's worth submitting the lock avoidance patch for formal >> review? > > You mean the bufmgr.c thing? Generally I think that that code needs a > good of scalability work - t

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Andres Freund
On 2013-09-17 08:18:54 -0500, Merlin Moncure wrote: > On Tue, Sep 17, 2013 at 6:59 AM, Andres Freund wrote: > > Hi, > > > > On 2013-09-17 17:55:01 +0600, Дмитрий Дегтярёв wrote: > >> We have not been able to reproduce this problem on a test servers. Use this > >> patch to production servers do not

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Merlin Moncure
On Tue, Sep 17, 2013 at 6:59 AM, Andres Freund wrote: > Hi, > > On 2013-09-17 17:55:01 +0600, Дмитрий Дегтярёв wrote: >> We have not been able to reproduce this problem on a test servers. Use this >> patch to production servers do not dare. >> >> In the course of studying the problems we have iden

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Andres Freund
Hi, On 2013-09-17 17:55:01 +0600, Дмитрий Дегтярёв wrote: > We have not been able to reproduce this problem on a test servers. Use this > patch to production servers do not dare. > > In the course of studying the problems we have identified that many queries > are executed on the slave several ti

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-09-17 Thread Дмитрий Дегтярёв
Hello. We have not been able to reproduce this problem on a test servers. Use this patch to production servers do not dare. In the course of studying the problems we have identified that many queries are executed on the slave several times slower. On master function heap_hot_search_buffer execute

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-08-27 Thread Merlin Moncure
On Tue, Aug 27, 2013 at 10:55 AM, Andres Freund wrote: > On 2013-08-27 09:57:38 -0500, Merlin Moncure wrote: >> + bool >> + RecoveryMightBeInProgress(void) >> + { >> + /* >> + * We check shared state each time only until we leave recovery mode. >> We >> + * can't re-enter recovery,

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-08-27 Thread Andres Freund
On 2013-08-27 09:57:38 -0500, Merlin Moncure wrote: > + bool > + RecoveryMightBeInProgress(void) > + { > + /* > + * We check shared state each time only until we leave recovery mode. We > + * can't re-enter recovery, so there's no need to keep checking after > the > + * shared v

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-08-27 Thread Merlin Moncure
On Tue, Aug 27, 2013 at 9:12 AM, Merlin Moncure wrote: > Something like the attached. Note, this patch is for research > purposes only and should *not* be applied to your production > environment. Here is a revised version that is missing the spurious whitespace edit. merlin recovery2.patch D

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-08-27 Thread Merlin Moncure
On Tue, Aug 27, 2013 at 8:38 AM, Merlin Moncure wrote: > On Tue, Aug 27, 2013 at 8:23 AM, Merlin Moncure wrote: >> It looks like you're hitting spinlock connection inside >> heap_page_prune_opt(). Which is commented: >> * Note: this is called quite often. It's important that it fall out quickl

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-08-27 Thread Merlin Moncure
On Tue, Aug 27, 2013 at 8:23 AM, Merlin Moncure wrote: > It looks like you're hitting spinlock connection inside > heap_page_prune_opt(). Which is commented: > * Note: this is called quite often. It's important that it fall out quickly > * if there's not any use in pruning. > > This in turn ca

Re: [PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-08-27 Thread Merlin Moncure
On Tue, Aug 27, 2013 at 2:57 AM, Дмитрий Дегтярёв wrote: > Hello. > > Exist 2 identical server DELL PowerEdge™ R720, CPU Dual Intel® Xeon® E5-2620 > Hexa-Core inkl, RAM 256Gb, RAID-10 8 x 600 GB SAS 6 Gb/s 15000 rpm. > > $ cat /etc/fedora-release > Fedora release 19 > > $ postgres --version > post

[PERFORM] Cpu usage 100% on slave. s_lock problem.

2013-08-27 Thread Дмитрий Дегтярёв
Hello. Exist 2 identical server DELL PowerEdge™ R720, CPU Dual Intel® Xeon® E5-2620 Hexa-Core inkl, RAM 256Gb, RAID-10 8 x 600 GB SAS 6 Gb/s 15000 rpm. $ cat /etc/fedora-release Fedora release 19 $ postgres --version postgres (PostgreSQL) 9.2.4 Data ~220Gb and Indexes ~140Gb iowait ~0.2-0.5. D