Seeking guidance on keeping the number of file descriptors low. #82
-
In my application, I am currently using Fjall to store a number of data sets together with axum to provide a REST API around those. The application is structured such that it opens all the partitions on start up, and then keeps them open indefinitely as part of a Would it make sense to restructure the application to only keep partitions opened for a limited time for as long as they are needed and then simply drop the partition handle (with the necessary synchronization to ensure the partition is only opened at most once) to reduce the pressure on the number of open file descriptors? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is caused by caching of file descriptors for read operations in the DescriptorTable (akin to the TableCache in RocksDB). The default depends on the OS: Lines 57 to 66 in d00876b This does not scale with partitions. Partitions themselves do not open a file descriptor permanently. Instead these are file descriptors for the segment files in the LSM-tree (each partition being one LSM-tree). That also means that dropping a PartitionHandle does nothing. It's just a handle. It's still kept in the keyspace. You should be able to reduce the limit at the cost of potentially more fopen calls. Are your keys monotonic (something like ULID or timestamps)? |
Beta Was this translation helpful? Give feedback.
This is caused by caching of file descriptors for read operations in the DescriptorTable (akin to the TableCache in RocksDB). The default depends on the OS:
fjall/src/config.rs
Lines 57 to 66 in d00876b
This does not scale with partitions. Partitions themselves do not open a file descriptor permanently. Instead these are file descriptors for the segment files in the LSM-tree (each partition being one LSM-tree). That also means that dropp…