Re: Too many open files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 8/10/2012 12:02 PM, Daniel Brown wrote:
On Fri, Aug 10, 2012 at 10:22 AM, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
On 12-08-09 08:01 PM, Al wrote:
I can't find a way to see what files could be open or what the limit is.

Site is on a shared server, cPanel.

                ^^^^^^^^^^^^^
THIS is probably your problem. Too many open files indicates that either the
user OR the OS has reached its limit of allowed open file handles. Open
files are those used by the OS and every user on the shared server. The
setting can be changed but you'll need an administrator to increase the
number of allowed open files. I suspect it's at the OS level if indeed you
only have 100 files open (though you likely have more due to files opened
for you by the OS or whatnot.

     Rob is exactly right.  This is managed via the kernel and ulimit,
to prevent excessive resource usage.  Often it's a temporary problem,
but if it consistently occurs, your host may either be improperly
configured or, more likely, overselling resources.


I've checked carefully and my code does not have any open files, I obviously can't check the OS, etc.

I'm using Pear Mail_mime()to batch send emails. The problem is created when my batch exceeds about 36 sends. I have several mail functions which all iterate this function for each recipient.
emailPearSend($mime, $headers, $bodyText, $attachedFile = null, $imgFile = null)

I did have the $mime = new Mail_mime("\r\n"); in emailPearSend(), which meant it was called for every recipient. I tried moving it out of the calling function so it would only be called one time for each batch, and I send the $mime as a function arg. Didn't help.

I'm off to get the host to check and fix the open files limit.

Off the subject a bit. What does PHP do with repeated new classes, e.g.
$mime = new Mail_mime Are they simply ignored or are additional new instances created. PHP won't let you duplicate function names.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux