The Aether opens too many files on the disk
bconlon1 opened this issue ยท 1 comments
Currently, the Aether reads and writes to many small files very frequently for areas loaded by players. These reads and writes are often very tiny (~20 bytes), frequent, and completely random, occurring over multiple files at once. We're typically seeing severe performance penalties due to I/O and filesystem overhead with these requests, and have noted significant slowness on some systems, especially on those with mechanical hard drives or heavy page file access.
This issue is only magnified on multiplayer servers when multiple areas are loaded. Additionally, the time spent backing up or deleting world files is drastically affected by the number of small files we create for each dimension, causing more slowness for server administrators.
As such, an alternative solution is needed for storing variable-sized data on the disk that would reduce filesystem overhead and increase performance. While this issue isn't urgent, it's something I'd personally like to work towards in the upcoming weeks.
LMDB was previously implemented in OrbisAPI 1.1.0 as an experimental feature, but due to issues with 32-bit Java support and the lack of sparse file support on Windows (multiple GBs of data being allocated at world creation is not something we can tolerate), we're unable to continue moving forward with it. However, quite noticeable gains were achieved with our basic implementation on the Linux platform, and it's definitely a step in the right direction.
LevelDB is another interesting option that doesn't suffer from the platform limitations of LMDB, but we haven't had much time to test its effectiveness or weigh the pros and cons. It currently looks very comparable to LMDB, but isn't copy-on-write like LMDB's B-Tree implementation and instead log-based. However, it has bonus points as Mojang uses this very library for the Pocket Edition of Minecraft.