Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57363 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81017 invoked from network); 13 Jan 2012 23:06:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2012 23:06:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.210.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:42848] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/05-50267-4F8B01F4 for ; Fri, 13 Jan 2012 18:06:28 -0500 Received: by iagk10 with SMTP id k10so2656825iag.29 for ; Fri, 13 Jan 2012 15:06:26 -0800 (PST) Received: by 10.50.193.229 with SMTP id hr5mr2718931igc.15.1326495982959; Fri, 13 Jan 2012 15:06:22 -0800 (PST) Received: from [192.168.200.5] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPS id h9sm33627681ibh.11.2012.01.13.15.06.22 (version=SSLv3 cipher=OTHER); Fri, 13 Jan 2012 15:06:22 -0800 (PST) Message-ID: <4F10B8ED.4080008@lerdorf.com> Date: Fri, 13 Jan 2012 15:06:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: Reindl Harald CC: internals@lists.php.net References: <4F105D9D.3010704@lerdorf.com> <4F10B372.3040002@thelounge.net> In-Reply-To: <4F10B372.3040002@thelounge.net> X-Enigmail-Version: 1.4a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] FD_SETSIZE warning? From: rasmus@lerdorf.com (Rasmus Lerdorf) On 01/13/2012 02:42 PM, Reindl Harald wrote: > > Am 13.01.2012 17:36, schrieb Rasmus Lerdorf: >> FD_SETSIZE is a system limit on the number of open files a >> single process can have. From a bash shell type: ulimit -n and >> you will probably see this magical 1024 number pop up. This >> means that the default is 1024 on your system, so raising it in >> PHP won't actually do anything unless you also raise it on your >> system. We try to match the limit in order to give you a sensible >> error message instead of your program just breaking quietly, or >> with a warning that doesn't tell you that it is due to hitting a >> system limit. >> >> So, in order to raise this you have to both tell your operating >> system that you want to allow individual processes to open more >> than 1024 files each and you have to recompile PHP with this >> higher limit. >> >> Now, having said that, I don't quite understand why a single PHP >> cgi process would ever need more than 1024 open files at the same >> time. What exactly are you doing that needs this many >> descriptors? Sounds like you have a descriptor leak there >> somehow. > > on "old" sysv-systems it was easy to raise this number with > "modern" systemd-units "LimitNOFILE=30000" as example is ONE simple > line to raise this limit > > it is not the job of PHP try to GUESS system-limits and define them > on compile-time It isn't a guess. FD_SETSIZE isn't set by PHP, but all sorts of underlying things need to know what FD_SETSIZE is in order to work correctly so unfortunately when you increase it you are going to need to recompile. This isn't unique to PHP. There are some ways to hack around this, but they are all ugly. -Rasmus