Skip to content

Reduce CPU and memory usage - #490

Merged
aduffeck merged 5 commits into
opencloud-eu:mainfrom
aduffeck:reduce-id-cache-load
Jan 14, 2026
Merged

aduffeck merged 5 commits into
opencloud-eu:mainfrom
aduffeck:reduce-id-cache-load

Conversation

@aduffeck

@aduffeck aduffeck commented Jan 12, 2026 •

Copy link
Copy Markdown
Member

This PR improves and extends internal caches to reduce the number of ID cache lookups needed. For directory listings the number of lookups was reduced from 3 lookups per item in the directory to 0.

It also changes the walker to not list directories that are being skipped anymore.

Depending on the space layout the reduction of CPU and memory usage when reindexing a space can be substantial:

Before:
before

After:
after

Fixes opencloud-eu/opencloud#2055
Fixes opencloud-eu/opencloud#2128

That way we can make use of the cached internal path on the node and
don't have to look it up again.
Space root paths don't change, so we can keep a list in memory and spare
a lot of id cache lookups.
In cases like dir listings we already know the internal path of the
node and don't have to retrieve it from the id cache again.
This tremendously reduces the load on the system when directories are
being skipped, e.g. when reindexing a space. Without this change all
directories in the space root were listed, even if only one of them or
one file needed to be scanned.
@aduffeck aduffeck changed the title Reduce ID cache lookups in posixfs Reduce CPU and memory usage Jan 13, 2026
@aduffeck
aduffeck merged commit 90ffddc into opencloud-eu:main Jan 14, 2026
@openclouders openclouders mentioned this pull request Jan 13, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenCloud Memory Usage Performance Issues Deleting Files

2 participants