Is there any way I can run the command you show from inside my script? If not, I can ask my hosting service to run it. Needless to say, they do not invite me to run commands directly on their server.

It's important that this command be run by your script a short time before it crashes. Otherwise the output might not be helpful.

As you have not posted code, I assume that you don't know where the error happens. This makes it difficult to run the command shortly before that, so I suggest putting something like

warn `ls -l /proc/$$/fd/` . ' ';

in various places in your code; you will probably see the output in your server log.

The appended whitespace ' ' ensures that the string does not end in a newline. warn() and die() append the source code line number in that case.


In reply to Re^3: How to debug "Too Many Open Files" Error by betterworld
in thread How to debug "Too Many Open Files" Error by tonyb48

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.