Skip to content

Server Optimization: cache of fd's

Each time we have a read or write request, we need to compute the chunkpath, and then open the fd.

With a microbenchmarks that issues 128k read requests to different files/offsets we reduce from 5:30 to 5:25 doing the aforementioned cache (a simple map [ < path, chunk-id >, fd ], implemented directly in the chunk_storage.cpp

There are missing issues, like that fd's should have a limit and they should be closed, but the benefits are high given the simple benchmark.

Write should have similar benefits.

If instead of this cache we do a cache of chunkpath, the benefits are not important.