Skip to content

Add basic inode cache#17324

Open
tcrain wants to merge 8 commits intoAlluxio:master-2.xfrom
tcrain:inodecache
Open

Add basic inode cache#17324
tcrain wants to merge 8 commits intoAlluxio:master-2.xfrom
tcrain:inodecache

Conversation

@tcrain
Copy link
Copy Markdown
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
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
Copy Markdown
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
Copy Markdown
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

4 participants