From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jerry Sievers <gsievers19@comcast.net>
Cc: Jeremy Finzel <finzelj@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Unkillable processes creating millions of tiny temp files
Date: Fri, 05 Mar 2021 18:57:08 -0500
Message-ID: <1520805.1614988628@sss.pgh.pa.us> (raw)
In-Reply-To: <875z25jhc6.fsf@jsievers.enova.com>
References: <CAMa1XUhZ1sjmJ9LiTz4Oz61=8+VDguTTi6GQhRoYQ9n7pFGqSQ@mail.gmail.com>
<1517658.1614983320@sss.pgh.pa.us>
<875z25jhc6.fsf@jsievers.enova.com>
Jerry Sievers <gsievers19@comcast.net> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> The "unkillable" aspect is odd, but I wonder if that's just a red
>> herring. A query that's generated lots of temp files will try to
>> clean them up at termination, so maybe the backend is just sitting
>> there removing temp files before it'll give control back.
> I believe this is confirmed. I see that the backend after being
> sig-term'd are now cycling through unlinks as seen by strace -p $pid.
> None too quickly I might add and as mentioned earlier, the number of
> these files is in the millions so it's hard to predict when cleanup will
> finish.
Hm. I don't recall exactly what sort of data structure we use to track
open temp files, but it's certainly plausible that it's not too efficient
with millions of temp files :-(
> As we did one night prior, a hard shutdown got the rogue jobs closed a
> lot more quickly and we noticed that on the recovery restart, Pg took
> about 15 minutes to clear >23M files from the temp area. I assume we'd
> experience the same again if we need to do it.
Not sure how fast that is either. If you need to do it again, you could
try manually rm'ing everything under the pgsql_tmp directory before
letting the postmaster start.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, gsievers19@comcast.net, finzelj@gmail.com
Subject: Re: Unkillable processes creating millions of tiny temp files
In-Reply-To: <1520805.1614988628@sss.pgh.pa.us>
References: <CAMa1XUhZ1sjmJ9LiTz4Oz61=8+VDguTTi6GQhRoYQ9n7pFGqSQ@mail.gmail.com> <1517658.1614983320@sss.pgh.pa.us> <875z25jhc6.fsf@jsievers.enova.com> <1520805.1614988628@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox