Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tZT9K-009qav-7M for pgsql-general@arkaria.postgresql.org; Sun, 19 Jan 2025 11:07:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tZT9H-006VhZ-5v for pgsql-general@arkaria.postgresql.org; Sun, 19 Jan 2025 11:07:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tZT9G-006VhQ-MC for pgsql-general@lists.postgresql.org; Sun, 19 Jan 2025 11:07:23 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tZT9D-000NDy-1W for pgsql-general@lists.postgresql.org; Sun, 19 Jan 2025 11:07:21 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 807F37FED8; Sun, 19 Jan 2025 12:06:16 +0100 (CET) Date: Sun, 19 Jan 2025 12:06:16 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Postgresql database terminates abruptly with too many open files error Message-ID: <20250119110616.2vu7oblzoxnqfkqx@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <0af98214-3c2a-43e5-9bbf-ddd79b85ea93@ebi.ac.uk> <709d5fa0-85e1-40a2-a6a4-11040f4e5b62@ebi.ac.uk> <679341.1736864393@sss.pgh.pa.us> <9b69fcc6-dca1-4671-af00-b250f154fb14@ebi.ac.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4wiyeb4m4bmacisy" Content-Disposition: inline In-Reply-To: <9b69fcc6-dca1-4671-af00-b250f154fb14@ebi.ac.uk> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --4wiyeb4m4bmacisy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2025-01-15 11:42:30 +0000, Sri Mrudula Attili wrote: > The max_connections =3D200 and max_files_per_process =3D1000 as you menti= oned. >=20 > So should a max_files_per_process =3D500 helps? >=20 >=20 > I could see from the number of connections to the databaseis not exceeding > 20. But still these 20 are causing all the damage or using up all the > openfiles quota. If there are 20 processes with at most 1000 open files each, that's only 20'000 open files. So where do the other 45'536 files come from? Use something like lsof | awk '{print $1, $2}' | uniq -c | sort -n to find the processes with the most open files (but be aware that lsof reports file descriptors for each thread, so any multi-threaded programs will be vastly inflated) hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --4wiyeb4m4bmacisy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmeM3KIACgkQ8g5IURL+ KF2j3xAAmaY31j/CWp7Tm0u80W8mdwKqoVW3g5hD7B50bybkNJJmTkoBQhfeIqje eBHGpngAqG7/Qri0xLnE+kAQl+oyU5x0FLnbGDJwMVj5MrIJI+k/BHH3exLjoY1n tSBLYxxDmIY3kfwdkW3pT+c6aY/VDFpKTyi9kGNvHm2H/XKRgukleHLJJHx1G59v SuFIHUDW8rfq38/YLO50mcrkIZBkCmr9t3Pe2OC4YLy7IkyQymcZfkLWx/xPSMyl F7f5pHGauJ7ZOEObS+/7sTJQ8QtxahBH0tDHATEqs1+cparsPS3oQGqY0fJx1qFy bCFC4/+71luoWphNNTrhr6Hzb5l5fTba8QwqhpRhHH6jqezQr4/dziidqesAEPHo HQQLSA0dFdj2BlTv+6K5mX3H3nwcr5fNz/MMP/vmVvEn54LHikqLVA/KZMY/lUvC hlgrvZZ13ePyXdRX8Njf25znN4PucK2IAocVZ4qyuLc0hPEGz9BnwBfwQikv/7we ngTdrdqBcHvLL8UryrEWdOk9/hpC+ogsCIacotexsSkx/4s9i5ocfMz2szfETXR6 qblaylqWwzNRIg+IyxXyxQDrVP9+kP6AYE6AcJo11qMzDJ5YPmzYMQTE9YmOOPXf iOMOid4FNxLUW6EZqTvyD1Q2FAvEvD9CCeQyrMPlJq1Aq04etQI= =j8AK -----END PGP SIGNATURE----- --4wiyeb4m4bmacisy--