Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)
Дата
Msg-id CAOR=d=2bMfcv9d5Lok5WddVm7ztM4a1QNcxm9Tcpx+PChjQunQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)  (Claudio Freire <klaussfreire@gmail.com>)
Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-performance
On Wed, Jun 3, 2015 at 1:24 PM, Tomas Vondra
<tomas.vondra@2ndquadrant.com> wrote:
>
>
> On 06/03/15 17:09, Scott Marlowe wrote:
>>
>> On Wed, Jun 3, 2015 at 8:56 AM, Tomas Vondra
>>>
>>>
>>>
>>> I don't see why you think you have less than 3GB used. The output you
>>> posted
>>> clearly shows there's only ~300MB memory free - there's 15GB shared
>>> buffers
>>> and ~45GB of page cache (file system cache).
>>
>>
>> Because you subtract cached from used to see how much real spare
>> memory you have. The kernel will dump cached mem as needed to free up
>> space for memory usage. So 64141-61761=2380MB used.
>
>
> Well, except that 15GB of that is shared_buffers, and I wouldn't call that
> 'free'. Also, I don't see page cache as entirely free - you probably want at
> least some caching at this level.
>
> In any case, even if all 64GB were free, this would not be enough for the
> query that needs >95GB for temp files.

You can argue all you want, but this machine has plenty of free memory
right now, and unless the OP goes crazy and cranks up work_mem to some
much higher level it'll stay that way, which is good. There's far far
more than 300MB free here. At the drop of a hat there can be ~60G
freed up as needed, either for shared_buffers or work_mem or other
things to happen. Cache doesn't count as "used" in terms of real
memory pressure. IE you're not gonna start getting swapping becase you
need more memory, it'll just come from the cache.

Cache is free memory. If you think of it any other way when you're
looking at memory usage and pressure on theings like swap you're gonna
make some bad decisions.


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)
Следующее
От: Claudio Freire
Дата:
Сообщение: Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)