nextcloud / nextcloud/notify_push

Prevent high request load after notification

Open
#192 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Performance 🚀
Dominant language
Rust
Stars
344
Forks
64
Avg merge
2d 10h
Merged PRs (30d)
5

Description

First and foremost, thanks for having created this project! It's greatly helping our instance's runtime.

I'd like to focus on a particularly nasty side-effect of the reaction to a notification, when there are many clients (>20) and big folders in sync:

  1. A client updates a file / folder;
  2. A push notification is sent to all connected NC clients;
  3. Immediately after, all clients issue a number of PROPFIND requests to get more info and decide what to do;
  4. The server load easily spikes to 80-95% of all available cores;
  5. Just a few seconds after the first push, another user changes a different file/folder;
  6. go to number 2.

The above is going to pile up easily and use up all the available cores when many users are working on a big share.
As a result of that, on a user perspective the clients tend to stay in "synchronizing" state for most of the time and appear very slowly responsive, even if only few small changes really happened in the shares.

A solution to highly mitigate the above side effects would be to:

  • Add more information to the push notification message so that the clients don't always need to ask back additional info
  • Change the NC client push notification code to make use of the additional info and avoid issuing a bunch of requests.

Hope this helps, thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the push notification payload and the client reaction that triggers follow-up PROPFIND requests; the issue does not name specific files or tests. Define the additional information and update both server and client behavior so notifications avoid unnecessary requests and the resulting load spike is reduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.