in reply to How to debug "Too Many Open Files" Error

From some searching around the interweb, may I suggest you log into your web server and type echo 8192 > /proc/sys/fs/file-maxecho && 32768 > /proc/sys/fs/inode-max into the terminal?

That is, of course, assuming your hosting company uses linux. And that you have full access to the box.

Take the suggestion with a grain of sugar - it is hard to deduce the problem without more information.

Update: Take the suggestion even less than a grain of sugar (see moritz's post in reply to this one)

I'm so adjective, I verb nouns!

chomp; # nom nom nom

Replies are listed 'Best First'.
Re^2: How to debug "Too Many Open Files" Error
by moritz (Cardinal) on Sep 16, 2008 at 19:45 UTC
    I'm quite sure that no sane hosting company will offer write access to /proc/sys/fs/* (unless on a "root server"), and if it does you don't want to use that hosting company anyway.

      Haha wow - good call.

      I'm so adjective, I verb nouns!

      chomp; # nom nom nom

Re^2: How to debug "Too Many Open Files" Error
by betterworld (Curate) on Sep 16, 2008 at 20:23 UTC
    Take the suggestion even less than a grain of sugar

    Actually it's a good idea to look what's in that file (reading it should be possible for ordinary users), and what "ulimit -n" prints. This should be possible from a CGI script, without ssh access.

    If the number is something like 1024, we can be almost sure that there is a programming mistake in the OP's scripts. However, if the provider chose to lower that number to something like 10 (to prevent excessive use of resources), the web software might need some restructuring to make sure that file handles (including sockets) are never open longer than necessary.

Re^2: How to debug "Too Many Open Files" Error
by tonyb48 (Novice) on Sep 16, 2008 at 23:05 UTC
    Thanks for the response. I assume there is no way I can run this command from inside my PERL script. However, my hosting service is very responsive. I will ask them to run the code. What would they expect to see as a result? What are they likely to tell me; or whay might we do to fix the problem? Thanks Tony