19872: Set max_slots lower because mmap uses another FD
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 13 Dec 2022 22:35:44 +0000 (22:35 +0000)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 13 Dec 2022 22:43:32 +0000 (22:43 +0000)
commit9f7c39451c16003c6c6e0fb8de5a990781cb300f
tree56fbbf81a1fd8909309807e3c393bdb59f7b6697
parenta46c78bdc3c2136236e6fff2e17b32d3c78ca772
19872: Set max_slots lower because mmap uses another FD

- Reduce max slots to 3/8 max fds instead of 1/2 because mmap() uses a
second file descriptor, and we keep the original file descriptor open
for flock()

- Rework how cache slots are allocated to try evicting things _before_
allocating a new cache slot, so the cache should be somewhat better
behaved about staying within its configured limits.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
sdk/python/arvados/diskcache.py
sdk/python/arvados/keep.py