nextcloud / nextcloud/desktop

Use `fanotify` instead of `inotify` on Linux if available

Open
#9,030 0 comments 6 reactions 0 assignees View on GitHub
1. to develop os: :penguin: Linux Performance 🚀 Prio: normal
Dominant language
C++
Stars
3.9k
Forks
1k
Avg merge
1d 17h
Merged PRs (30d)
123

Description

### How to use GitHub

* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are interested into the same feature.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.

---

## Feature request

**Which Nextcloud Version are you currently using:** 31.0.10 (desktop client: 3.16.4)

**Is your feature request related to a problem? Please describe.**
I ran into the default inotify limit on my Linux system, and had to bump the limit to compensate. See https://blog.mynacol.xyz/en/nextcloud-inotify/. While inotify was blocked due to the limit, the Nextcloud client only synchronized changes after ~1 hour, which was unexpected and interrupting.

**Describe the solution you'd like**
Today I learned that Linux has a newer file/directory monitoring API called [fanotify](https://man7.org/linux/man-pages/man7/fanotify.7.html) that can recursively monitor directories with one monitor. It even supports an ignore mask to exclude some subfolders that are exempted from synchronization.
This can massively decrease memory usage and elegantly prevent the inotify limit issue I faced.

**Describe alternatives you've considered**
Continuing with inotify and bumping the limit when required.

**Additional context**
The fanotify API is only really usable since Linux 5.1. This shouldn't be a major issue, as that version was released in May 2019, and all upstream supported LTS kernels are newer already.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.