Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6zzx-00059y-0i for pgsql-performance@arkaria.postgresql.org; Sun, 18 Dec 2022 20:11:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p6zzu-0002Iz-Ow for pgsql-performance@arkaria.postgresql.org; Sun, 18 Dec 2022 20:10:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6zzu-0002Ik-CU for pgsql-performance@lists.postgresql.org; Sun, 18 Dec 2022 20:10:58 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p6zzr-0006Pe-4l for pgsql-performance@lists.postgresql.org; Sun, 18 Dec 2022 20:10:57 +0000 Received: by mail-il1-x12e.google.com with SMTP id o8so2523206ilq.6 for ; Sun, 18 Dec 2022 12:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=/Uw3Vs8Nt3HIvDlpGKc5V7YPEfWJfu7Yw/Haa+evPxY=; b=4+G0NHSUTQuozs2XoskBZ2GdWunsyljY0pxcWlqcrVyz879RNxyXPvJfdlMGC6x1cA V9MLN5/7voeSd0/Z+bSfXB3UdptljI69q/YIma3WdwPGLee91xcGLG9nwe6Y+OZfZNnm aua6sxCW03cGqkjNqzI5V0wTUMownonooonTn54Kogyak7GgRLTLEcvz5mLT8/PFsjdZ h8z4SbpVOAlEe2WLduz5bQUvzeoPjrS5fE9HKnaiTUiUGOxZQyfI6zscAtWXly/2MOEh mkAi8ob7AzL85TBlFerY6zF2nL3Fkia5ZxaYuxLxGtvw5zUY1Gc8T8N4oe+9U3UcPUP1 9BfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/Uw3Vs8Nt3HIvDlpGKc5V7YPEfWJfu7Yw/Haa+evPxY=; b=yT92kFoxdkcDxy47ANQwp0B6rEcDI++QpnkQok+axtWNvXOPSFfkLz8V+NcauUcjHn Mdm5Nc7N8unE3GLzrGRl2THs83vkvMAqK18TIzCVkMAXtmp19SmER/gFAHnmYXU75QOm UP0eojPeC5/vk7OPEo3fm7fal7aqWJ6vQIYJAIEn0kmiFiqx3AsCcLf7pDrynDLv9WOq ZROg1gT7KE49tg0+nNkozXlM9hFKRDiT5MzKqZWNgS12BvfyUD0G7eNRjN9yYqROey3E D2SkfwbMEqvQM/gZNm60DPs8DrFgFudZjuAFIp9zE6Sr76ISNAwHcpN88JCrwvvqvQQd sNrQ== X-Gm-Message-State: AFqh2kpRuywFyThEznAjVAdN19u5hSQQc0WfM8J3mxYFmAsP+ZP1YaFs v42iHL7NPH+tTdMA2mNe7n8saA== X-Google-Smtp-Source: AMrXdXtiJ50E1QTAUiRhCRZXIc8prWFOVSXv1fxYxAzHD9GK1n2fKRgtkNb3DEGtvCAR+9wsyb6auw== X-Received: by 2002:a92:d945:0:b0:30a:5e27:3d0 with SMTP id l5-20020a92d945000000b0030a5e2703d0mr2926187ilq.31.1671394253811; Sun, 18 Dec 2022 12:10:53 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id s12-20020a92cb0c000000b0030005ae9241sm2600944ilo.43.2022.12.18.12.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 12:10:53 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 6C7A1800A36; Sun, 18 Dec 2022 14:10:52 -0600 (CST) Date: Sun, 18 Dec 2022 14:10:52 -0600 From: Justin Pryzby To: Frits Jalvingh Cc: pgsql-performance@lists.postgresql.org Subject: Re: Fwd: temp_file_limit? Message-ID: <20221218201052.GV1153@telsasoft.com> References: <20221218155705.GT1153@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Dec 18, 2022 at 06:29:41PM +0100, Frits Jalvingh wrote: > Just to be clear: my real question is: why is temp_file_limit not > working at the specified size? Because this is my real problem: when a > query is dying like this it will also kill other queries because these > are also running out of space. Even when the limit is per-process it > should not have exceeded 200GB imo. What OS and filesystem are in use ? Could you list the tmpdir when it's getting huge? The filenames include the PID, which would indicate if there's another procecss involved, or a bug allowed it to get huge. sudo du --max=2 -mx ./pgsql_tmp |sort -nr BTW, pg_ls_tmpdir() hides directories, so you shouldn't rely on it for listing temporary directories... One possibility is that there are files in the tmpdir, which have been unlinked, but are still opened, so their space hasn't been reclaimed. You could check for that by running lsof -nn |grep pgsql_tmp Any deleted files would say things like 'DEL|deleted|inode|no such' > BTW, if that limit is really per process instead of per > session/query then that is a Very Bad Thing(tm), because this makes the > limit effectively worthless - if a query can spawn 8 parallel processes > then you can suddenly, without any form of control, again fill up that disk. 8 is the default value of max_worker_processes and max_parallel_workers, but 2 is the default value of max_parallel_workers_per_gather. You're free the change the default value to balance it with the temp_file_limit (as suggested by the earlier-mentioned commit). -- Justin