Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Aug 1997 12:26:43 -0700
From:      "Jordan K. Hubbard" <jkh@time.cdrom.com>
To:        Cliff Addy <fbsdlist@federation.addy.com>
Cc:        "Andrew N. Edmond" <edmond@shaman.lycaeum.org>, hackers@FreeBSD.ORG
Subject:   Re: Too many open files in System! 
Message-ID:  <3101.870636403@time.cdrom.com>
In-Reply-To: Your message of "Sun, 03 Aug 1997 11:47:44 EDT." <Pine.BSF.3.95q.970803114414.5334B-100000@federation.addy.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> seems to seems to also be a NAQ (Never Answered Question).  I myself have
> asked it several times and the answers, involving CHILD_MAX and OPEN_MAX
> and limits, never work.  Apparently, FreeBSD is too primitive to handle
> more than a few files at once. 

You simply need to implement file swapping.  Keep a cache of file
descriptors you've opened and implement a simple LRU algorithm to
close those which haven't been used for awhile - in your code which
handles the failure cases for reads/writes, you then add an extra bit
of glue to handle the failure case (e.g. the handle was closed) which
jumps back to the cache code and asks that the file be reopened again
(you'll also need to save the current file position before you close
files, of course, so that you can seek back to where you left off when
you "reinstate" a cache entry).  Easy.

> (please realize the above is an intentional goad to get SOMEONE to finally
> answer this.  I love FreeBSD :) )

(please realize that the above is a parody answer in response to an
intentional goad to get SOMEONE to realize that we don't rise to such
bait :-)

					Jordan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3101.870636403>