Re: [PERFORM] How to diagnose a “context-switching ” storm problem ? - Mailing list pgsql-performance

From Sergey Konoplev
Subject Re: [PERFORM] How to diagnose a “context-switching ” storm problem ?
Date
Msg-id i2jc3a7de1f1004121427kaed843d1w4f1b51244b8c480a@mail.gmail.com
Whole thread Raw
In response to How to diagnose a “context-switching ” storm problem ?  (RD黄永卫 <yongwei_huang@temp.gtmc.com.cn>)
List pgsql-performance
2010/4/12 RD黄永卫 <yongwei_huang@temp.gtmc.com.cn>:
> I donnt know what make the "context-switching"  storm ?
>
> How should I investigate  the real reason ?
>
> Could you please give me some advice ?

It might be because of cascading locks so try to monitor them when it happens.

You may find this query useful:

SELECT
    granted,
    count(1) AS locks,
    pid,
    now() - xact_start AS xact_age,
    now() - query_start AS query_age,
    current_query
FROM
    pg_locks AS l
    LEFT JOIN pg_stat_activity AS a ON
        pid = procpid
GROUP BY 1, 3, 4, 5, 6
ORDER BY 1 DESC, 2 DESC
-- ORDER BY 4 DESC
LIMIT 100;


--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802

pgsql-performance by date:

Previous
From: norn
Date:
Subject: Re: significant slow down with various LIMIT
Next
From: "Kevin Grittner"
Date:
Subject: Re: significant slow down with various LIMIT