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