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

Is there any particular action or section of the site that seems most error-prone? Also, is there a particular time of day or day of the week that you've noticed these happening? Do you have a way to check usage and/or load to see if there's any correlation with the error occurring v. the number of users?

Would modifying the code to write to a log or send an email be a possibility? You may not notice a helpful pattern just based on user reports (as not every user will report every error) but a log of every occurrence might make the cause and/or solution more obvious.
  • Comment on Re: How to debug "Too Many Open Files" Error

Replies are listed 'Best First'.
Re^2: How to debug "Too Many Open Files" Error
by tonyb48 (Novice) on Sep 17, 2008 at 22:26 UTC
    Thanks for your thoughts on this problem. I have noticed no regular pattern to the problem. Although I had nearly no failures at nights and weekends. However, the host talked about migrating my site(s) to a new server with less traffic. So his work might have improved things as well. I have no way of checking for load on the server. I am quite sure the load on my ap is very low; I suspect there are never as many as 3 users. Within this thread I got a couple of suggestions to give to the host to check his load. Shortly, I plan to insert the following code into the 3 most popular modules in the application, based on suggestions in the thread above:
    warn `ls -l /proc/$$/fd/` . ' ';
    However, if I were a hosting service, I would not allow commands like this to run; so I wonder if it will be blocked. If so, I will ask the host to run it; but that is not as useful, because one would like to run it right before my app crashes. Tony