nextcloud / nextcloud/server

Lazy app config values may still be loaded on every request

Open
#52,074 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop 32-feedback bug performance 🚀
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

On setups with LDAP or other cases where getKeys is used the lazy app config is basically ignored and we fetch the full table

https://github.com/nextcloud/server/blob/c7037d7b38d794ad49c93cbc1dfb8721898bd191/lib/private/AppConfig.php#L99

This may lead to larger amount of data being transferred on every request from the database and being hold in memory for each request:

For the impact, on our instance we have a config value that is 8MB in size which is needed on every request. With 250 concurrent requests this is an additional demand of 2GB for the server.

Image

cc @ArtificialOwl @sorbaugh

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 reading lib/private/AppConfig.php around line 99 and apps/user_ldap/lib/Helper.php around line 110, then trace how getKeys accesses lazy app configuration. Reproduce the request-time configuration loading and verify that large lazy values are not fetched unnecessarily when getKeys is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.