too-may-open-files log file entries when vauuming under solaris

From: "Raschick, Hartmut" <Hartmut(dot)Raschick(at)keymile(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: too-may-open-files log file entries when vauuming under solaris
Date: 2014-03-05 10:15:27
Message-ID: E92455D61233364C88CCD4A6DAB2E28511EBA9034B@SRVDEHAN1MX1.keymile.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear all,
recently we have seen a lot of occurrences of "out of file descriptors: Too many open files; release and retry" in our postgres log files, every night when a "vacuum full analyze" is run. After some digging into the code we found that postgres potentially tries to open as many as a pre-determined maximum number of file descriptors when vacuuming. That number is the lesser of the one from the configuration file (max_files_per_process) and the one determined at start-up by "src/backend/storage/file/fd.c::count_usable_fds()". Under Solaris now, it would seem, finding out that number via dup(0) is not sufficient, as the actual number of interest might be/is the number of usable stream file descriptors (up until Solaris 10, at least). Also, closing the last recently used file descriptor might therefore not solve a temporary problem (as something below 256 is needed). Now, this can be fixed by setting/leaving the descriptor limit at 256 or changing the postgresql.conf setting accordingly. Still, the function for determining the max number is not working as intended under Solaris, it would appear. One might try using fopen() instead of dup() or have a different handling for stream and normal file descriptors (including moving standard file descriptors to above 255 to leave room for stream ones). Maybe though, all this is not worth the effort; then it might perhaps be a good idea to mention the limitations/specialties in the platform specific notes (e.g. have u/limit at 256 maximum).

cheers
hardy

Hartmut Raschick
Network Management Solutions
-----------------------------------
KEYMILE GmbH
Wohlenbergstr. 3
D-30175 Hannover, Germany

Phone: +49 (0)511 6747-564
Fax: +49 (0)511 6747-777
mailto:Hartmut(dot)Raschick(at)keymile(dot)com
http://www.keymile.com

<< KEYMILE - because connectivity matters >>

Geschäftsführer/Managing Directors: Björn Claaßen, Michael Breyer, Axel Föry - Rechtsform der Gesellschaft/Legal structure: GmbH, Sitz/Registered office: Hannover HRB 61069, Amtsgericht/Local court Hannover, USt-Id. Nr./VAT-Reg.-No.: DE 812282795, WEEE-Reg.-No.: DE 59336750

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Victor Yegorov 2014-03-05 10:23:36 Re: Join Bad Performance on different data types
Previous Message Venkata Balaji Nagothi 2014-03-05 03:39:23 Re: How to recovery failed master after failover