Re: Changing work_mem

From: rihad <rihad(at)mail(dot)ru>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Changing work_mem
Date: 2019-08-13 17:04:45
Message-ID: 9c6b069a-c99b-4b65-92fa-59404012e576@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/13/2019 08:44 PM, rihad wrote:
> On 08/13/2019 08:22 PM, Luca Ferrari wrote:
>> On Tue, Aug 13, 2019 at 5:59 PM rihad <rihad(at)mail(dot)ru> wrote:
>>> [dbname] LOG:  temporary file: path
>>> "base/pgsql_tmp/pgsql_tmp93683.257381", size 594
>>>
>> The setting 'work_mem' is within context 'user', that means it will
>> affect running sessione unless the session itself has already issued a
>> SET work_mem to xxx.
>> So this could be a reason why you don't seem to see any change.
>>
>> Also keep in mind that work_mem work on a connection basis, so you are
>> going to possibly see 521MB x num_connections if all your clients are
>> doig the same kind of sort concurrently, which probably causes
>> PostgreSQL to go to disk due to memory unavailable.
>>
>> Hope this helps.
>> Luca
>> .
>>
> Thanks. The box has 15GB mem free (as in FreeBSD )))
>
> And it hasn't moved a notch after the increase.
>
> No code does SET work_mem=... AFAIK.
>
> My apologies to Mr. Peter but I still think that older processes, some
> of them started a couple of weeks ago, use the older setting.
Sorry, I just decreased work_mem back to 256MB, reloaded, and instantly
started seeing 82mb temp file creation, not 165mb as was usual with
work_mem=512MB.

So it indeed was applied immediately.
Really weird figures )

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rihad 2019-08-13 17:14:44 Re: Changing work_mem
Previous Message Bikram MAJUMDAR 2019-08-13 16:50:02 RE: Question on pgwatch