Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hxZCr-0002F0-NJ for pgsql-general@arkaria.postgresql.org; Tue, 13 Aug 2019 15:59:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hxZCq-0005rh-Dm for pgsql-general@arkaria.postgresql.org; Tue, 13 Aug 2019 15:59:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hxZCp-0005rE-6f for pgsql-general@lists.postgresql.org; Tue, 13 Aug 2019 15:59:28 +0000 Received: from smtp53.i.mail.ru ([94.100.177.113]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hxZCm-0000TI-Uc for pgsql-general@postgresql.org; Tue, 13 Aug 2019 15:59:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=6rCsolnu5B81J1ZOEE0Z124Ym99BH6W2MU6AIgm8SVY=; b=uu+j4JDhQiyy1TljZG4i/D/8IXNS7jPU/7WAPzmFggYY0j7hXawky65vxgnEAOt2Jv1SEiNAKyU3AMf/qYtRe1EtSt3PZkSnGF7EPoV0ylW5t/tkNqUOMJOQ3Me48vcpx/0/Lo/kXlgCEayY/KS6q7ML4iWb5h6qZWGRoARX/PI=; Received: by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1hxZCk-0002CO-Nd; Tue, 13 Aug 2019 18:59:23 +0300 Subject: Re: Changing work_mem To: Peter Eisentraut , pgsql-general General References: <2cbec921-a0c2-016f-1831-82dd45106af3@mail.ru> From: rihad Message-ID: <6d170b3b-17b7-8e02-bbf6-2a6885b317eb@mail.ru> Date: Tue, 13 Aug 2019 19:59:20 +0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: smtp53.i.mail.ru; auth=pass smtp.auth=rihad@mail.ru smtp.mailfrom=rihad@mail.ru X-77F55803: 689590B63E0A4B015A78504BD2AC2941ABDFC7E166457DED89DB10FCC478B8696B02E7E64144F9315A4B2FCBD75C3D31 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74E3CEF8E5F9AB669EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063723F42433767FAC988638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCD3871748D871613E121D460D8D049C1030CE4803EBA5DA05389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999725571747095F342E8C26CFBAC0749D213D2E47CDBA5A9658359CC434672EE6371117882F4460429728AD0CFFFB425014E40A5AABA2AD371193AA81AA40904B5D9A18204E546F3947CEB7D890E3377C531BA3038C0950A5D36C8A9BA7A39EFB766BE1D6DAAD8F14AE176E601842F6C81A127C277FBC8AE2E8B6F7F07423981555D3AA81AA40904B5D99449624AB7ADAF3735872C767BF85DA227C277FBC8AE2E8B452692BD19358D8117D74697F3558D6835872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C99B0B8D173C204012BD9CCCA9EDD067B1EDA766A37F9254B7 X-Mailru-Sender: B19AB4DAF1EA2FB5AD9FC17C94DC39F516D691414D29A8F467CEAAA61F7420FBA033CBB7CDB34F37ABBFE0CF075BC50BFB559BB5D741EB96004FA9CEFBA991DA3A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 08/13/2019 07:41 PM, Peter Eisentraut wrote: > On 2019-08-13 17:16, rihad wrote: >> If I increase it in postgresql.conf and SIGHUP the master server, will >> the change be applied to all running backends, or only to the ones >> started after the change? Thanks. > It will be applied to all running backends. > Thanks, but this isn't what I'm seeing in the logs. After I increased work_mem from 256MB to 512MB I still see lines even with very small files created as before, including much larger ones, hundreds of MB. [dbname] LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp93683.257381", size 594 It seems unlikely that the temp file is still 594 bytes bigger than 512MB after the change. Maybe some other stuff unconditionally creates temp files regardless of what's in work_mem? All these "tempies" are the reason our SSD disks hosting a single database are seeing 1TB writes in a day, according to SMART.