Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic inode cache #17324

Open
wants to merge 8 commits into
base: master-2.x
Choose a base branch
from
Open

Add basic inode cache #17324

wants to merge 8 commits into from

Conversation

tcrain
Copy link
Contributor

@tcrain tcrain commented Apr 25, 2023

This adds an alternative inode/edge cache that only stores inodes.

It can be enabled using
alluxio.master.metastore.inode.cache.basic

It is recommended to be used when the master has either limited memory or when directories have large number of files, as the current inode cache must load all edges for a directory in memory.

Caching the inodes is advantageous as they are large objects with expensive serialization/ deserialization, while the edges are only made up of a string (the name) and a long (the id) and are thus faster to load from RocksDB.

Using this cache appears to have a 5-10% slowdown in performing GetStatus operations, but can also improve the performance greatly when the system is under load as there will be less cache thrashing on directories and less long GC pauses.

@alluxio-bot alluxio-bot added API Change Changes covering public API POM Change labels Apr 25, 2023
@@ -90,7 +91,11 @@ public static InodeStore.Factory getInodeStoreFactory(String baseDir) {
if (Configuration.getInt(PropertyKey.MASTER_METASTORE_INODE_CACHE_MAX_SIZE) == 0) {
return lockManager -> new RocksInodeStore(baseDir);
} else {
return lockManager -> new CachingInodeStore(new RocksInodeStore(baseDir), lockManager);
if (Configuration.getBoolean(PropertyKey.MASTER_METASTORE_INODE_CACHE_BASIC)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: using "else if"

+ "or when individual directories contain large numbers of files.")
.setConsistencyCheckLevel(ConsistencyCheckLevel.ENFORCE)
.setScope(Scope.MASTER)
.build();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also update line 2689 correspondingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Change Changes covering public API POM Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants