On 15 June 2010 11:25, Shady <[email protected]> wrote: > Just a question about an issue I encountered last night: I've been > testing my website out locally and have been using only one WSGI > script, which utilizes matplotlib to draw a graph. After testing out > the graphing functionality for a bit over an hour (tons of page > refreshing took place), Apache returned the error message that there > were too many open files, which is obviously an indicator that the > image wsgi file is not clearing from the cache.
Not necessarily, although not 100% what you mean by that statement. > Here's the error > message: > > (24)Too many open files: mod_wsgi (pid=4820, process='', > application='.../apps/img.wsgi'): Call to fopen() failed for '.../ > img.wsgi'. > > Now, is this an issue I address with modwsgi? Or is it an issue with > matplotlib or just my coding inefficiency? Can a line of script be > inserted after return which essentially closes the file after the > output is delivered? > > Good thing I found this issue offline with only one WSGI file, before > I ported over and had it up on my server... It is likely an issue with matplotlib or the way you are using it. Shouldn't be anything to do with mod_wsgi. In short, you like are opening files from Python code and they aren't being closed explicitly when you are finished. Instead you may be relying on Python reference counting to see files closed, which may not occur immediately, or you may have object reference cycles which cant be garbage collected and so file descriptor never gets closed. What files do you open explicitly from your code, or which matplotlib may be opening? Do you close files explicitly that you open? Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
