nextcloud / nextcloud/server

[Bug]: Caching in background jobs (almost) worthless when instance uses APCu for local caching

Open
#40,800 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop feature: caching performance 🚀 technical debt
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

APCu cache memory is volatile. For web servers it lives as long as the webserver process. For CLI it lives as long as the cache.

We recommend APCu for local caching because it's faster than Redis and the TCP roundtrip.

Nextcloud uses a lot of background (cron) processes. When set up for performance, background jobs are triggered by a system cron. Within this cron, the APCu cache does work. Between two cron executions all cached values are lost. This severely limits the usefulness of caching.

Steps to reproduce
  1. Set up an instance with APCu as local cache
  2. Cache data in a background job
  3. Build on the cached value later on
Expected behavior

Cached value is there

Installation method

None

Nextcloud Server version

27

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

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

No source file, test, or entry point is named. Start by reproducing the APCu behavior across separate system-cron executions and trace the local-cache configuration and background-job cache access; done means values cached by one execution remain usable by a later execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.