Druid relies on the page cache of Linux in order to have memory segments. However when loading segments from deep storage or rebalancing the page cache can get poisoned by segments that should not be in memory yet. This can significantly slow down Druid in case rebalancing happens as data that might not be queried often is suddenly in the page cache.
It is possible to advise the kernel what to do when writing and reading data and what the expectancy is of the app how the data should be treated. This is done by using posix_fadvise which has a JnA equivalent.
I suggest using this as it will speed up Druid under load.
- http://insights.oetiker.ch/linux/fadvise.html
- https://github.com/java-native-access/jna/blob/master/README.md
- https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/NativeIO.java
Druid relies on the page cache of Linux in order to have memory segments. However when loading segments from deep storage or rebalancing the page cache can get poisoned by segments that should not be in memory yet. This can significantly slow down Druid in case rebalancing happens as data that might not be queried often is suddenly in the page cache.
It is possible to advise the kernel what to do when writing and reading data and what the expectancy is of the app how the data should be treated. This is done by using posix_fadvise which has a JnA equivalent.
I suggest using this as it will speed up Druid under load.