~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Tables' files open at once: 64 whatever the process may hold, which costs a cold read 9 µs

Open
Open chadtmiller.com opened this issue 0 comments

pds_store::table::OPEN is 64: at most 64 accounts' tables are open at once, so that the server serves under a limit of 256 file descriptors (spec/LIMITS.md, "Open files and threads"). Of many accounts read at random most are then opened again at each read.

The store benchmark's reads, 2000 accounts, a record not in the cache (bench/store/RESULTS.md):

64 open at mostevery file open
the runner, Linux, p50 µs21.512.2
the same on 16 threads, per s153 thousand214 thousand
a Mac, p50 µs27.610.4
the same on 16 threads, per s98 thousand422 thousand

RocksDB, every file open, takes 12.6 µs on the runner.

What might be done

The bound taken from the process's own limit as it starts (getrlimit): a share of it, 64 at the least, some thousands at the most; the same for the logs held open (OPEN_LOGS, 64). The spec's sentence then says a share, and its check under ulimit -n 256 holds as it does. BlockCache::with_open takes the count already.