Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: How to debug "Too Many Open Files" Error

by tonyb48 (Novice)
on Sep 16, 2008 at 22:40 UTC ( [id://711819]=note: print w/replies, xml ) Need Help??


in reply to Re: How to debug "Too Many Open Files" Error
in thread How to debug "Too Many Open Files" Error

Thanks so much for your quick response. I'm not familiar with the use of "technologies" as you have used it. I have the following "use" statements:
use strict; use CGI qw(:standard escape escapeHTML); use Authen::Captcha; use Image::Magick; use Data::FormValidator (qw/filter_ucfirst/); use Data::FormValidator (qw/valid_email/); use CGI ':cgi-lib'; use Regexp::Common (qw/profanity/); use lib qw(/var/www/vhosts/cfhs69.com/cgi-bin); use CGI::Carp qw(fatalsToBrowser);
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. Tony

Replies are listed 'Best First'.
Re^3: How to debug "Too Many Open Files" Error
by betterworld (Curate) on Sep 16, 2008 at 22:57 UTC
    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.

      Thanks! When I have observed the failure, I have noted a couple of processes where failure seems more frequent. I can put this into those modules. Does the output go to the logs only? Or will the user see something? My script still includes the line:
      use CGI::Carp qw(fatalsToBrowser);
      Will that affect what the user sees when the script encounters the warn statement? Thanks, Tony

        See "Making warnings appear as HTML comments" in CGI::Carp.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://711819]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-26 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found