EMFILE error - Unix

This is a discussion on EMFILE error - Unix ; I have a FastCGI app on Soalris 10 and after certain time I start getting EMFILE (errno 24 - "too many file descriptors opened") error. I open one file on disk using fopen and close it with fclose. I verified ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: EMFILE error

  1. EMFILE error

    I have a FastCGI app on Soalris 10 and after certain time I start
    getting EMFILE (errno 24 - "too many file descriptors opened") error.
    I open one file on disk using fopen and close it with fclose. I
    verified that fclose is called for each file handle opened with fopen.
    What can generate such error and how best to diagnose it? what means
    "file descriptors' or solaris? Disk file handles, sockets? Is there
    way to see from shell what file descriptors are opned by a process?

  2. Re: EMFILE error

    >I have a FastCGI app on Soalris 10 and after certain time I start
    >getting EMFILE (errno 24 - "too many file descriptors opened") error.


    EMFILE means "too many file descriptors opened" *IN YOUR PROCESS*.
    ENFILE means "too many file descriptors opened" system-wide.

    >I open one file on disk using fopen and close it with fclose. I
    >verified that fclose is called for each file handle opened with fopen.


    So how many files did you (try to) have open simultaneously?

    >What can generate such error


    Anything that opens a file or a file descriptor, including open(),
    socket(), dup(), etc.

    >and how best to diagnose it? what means
    >"file descriptors' or solaris? Disk file handles, sockets?


    Yes, and yes. Shared libraries might also occupy a file descriptor,
    as might mapped memory.

    >Is there
    >way to see from shell what file descriptors are opned by a process?


    'lsof' might prove useful. It's supposed to work on Solaris 9 and 10.


  3. Re: EMFILE error

    In article ,
    gordonb.3w5nq@burditt.org (Gordon Burditt) wrote:

    > >I have a FastCGI app on Soalris 10 and after certain time I start
    > >getting EMFILE (errno 24 - "too many file descriptors opened") error.

    ....
    > >Is there
    > >way to see from shell what file descriptors are opned by a process?

    >
    > 'lsof' might prove useful. It's supposed to work on Solaris 9 and 10.


    Truss would also be useful, you can see all the opens and closes, and
    ensure that they match up.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

+ Reply to Thread