Re: Linux mis-reporting memory

Поиск
Список
Период
Сортировка
От Adam Tauno Williams
Тема Re: Linux mis-reporting memory
Дата
Msg-id 1191350250.5466.6.camel@aleph.wmmi.net
обсуждение исходный текст
Ответ на Re: Linux mis-reporting memory  (Decibel! <decibel@decibel.org>)
Ответы Re: Linux mis-reporting memory
Список pgsql-performance
> >> But then why is it not reporting that in the "Swap: used"
> >> section ? It
> >> only reports 42308k used swap.
> > Hm, good point.
> > The other possibility is that Postgres just hasn't even touched a
> > large part
> > of its shared buffers.
> Sorry for the late reply...
> No, this is on a very active database server; the working set is
> almost certainly larger than memory (probably by a fair margin :( ),

"almost certainly"

> and all of the shared buffers should be in use.

"should be"

It would be better to just check! :)  The catalogs and informational
views will give you definitive answers to these quests.

> I'm leaning towards "top on linux == dumb".

I disagree, it just isn't the appropriate tool for the job.  What top
tells you is lots of correct information,  it just isn't the right
information.

For starters try -
SELECT
 'HEAP:' || relname AS table_name,
 (heap_blks_read + heap_blks_hit) AS heap_hits,
 ROUND(((heap_blks_hit)::NUMERIC / (heap_blks_read + heap_blks_hit) *
100), 2) AS heap_buffer_percentage
FROM pg_statio_user_tables
WHERE (heap_blks_read + heap_blks_hit) > 0
UNION
SELECT
 'TOAST:' || relname,
 (toast_blks_read + toast_blks_hit),
 ROUND(((toast_blks_hit)::NUMERIC / (toast_blks_read + toast_blks_hit) *
100), 2)
FROM pg_statio_user_tables
WHERE (toast_blks_read + toast_blks_hit) > 0
UNION
SELECT
 'INDEX:' || relname,
 (idx_blks_read + idx_blks_hit) AS heap_hits,
 ROUND(((idx_blks_hit)::NUMERIC / (idx_blks_read + idx_blks_hit) * 100),
2)
FROM pg_statio_user_tables
WHERE (idx_blks_read + idx_blks_hit) > 0

--
Adam Tauno Williams, Network & Systems Administrator
Consultant - http://www.whitemiceconsulting.com
Developer - http://www.opengroupware.org


В списке pgsql-performance по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Linux mis-reporting memory
Следующее
От: Kevin Kempter
Дата:
Сообщение: performance of like queries