Cloud personnel
Find a file
MichaIng 7e7822fbed feat(settings): simplify OPcache checks
For the overall OPcache size check, we currently compare used memory with free memory. However, `opcache.memory_consumption` is split into `used_memory`, `free_memory` and `wasted_memory`. When cached files change on disk, old entries are not replaced or removed, but remain as wasted memory, until the cache is actually full, and if their percentage is above `opcache.max_wasted_percentage`, which is 5% by default. When this happens, the engine is restarted, resetting the cache completely, like a `opcache_reset()` call.

As long as we do not consider wasted cache, recommendations based on free memory can be false. To solve this, we could count wasted memory as free memory, if it is above `opcache.max_wasted_percentage`, as the engine will be restarted as soon as needed, freeing up this wasted space. On the other hand, wasted memory below the threshold permanently blocks the OPcache, which supports counting it as used memory. Depending on the situation, instead of raising OPcache size, it could be also advised to reduce `opcache.max_wasted_percentage`. But too frequent cache resets break its purpose as well.

In my opinion, the matter is too complex to consider wasted cache correctly, and do precise recommendations, but we should focus on reducing false positives instead. What we know for sure is: if the cache is full (`$status['cache_full'] === true`), and the limit for cached keys has not been reached, the OPcache was too small to maintain free space, with wasted memory below the configured threshold, where it consumes memory permanently. Recommending to raise the OPcache size in this case, is hence as accurate as it gets. Even if 5% wasted cache could be freed, 95% used memory is still above the previous threshold for the setup check warning. And if `opcache.max_wasted_percentage` is above 5%, then the admin must have decided to change the default, deciding that system memory consumption has lower priority than preventing OPcache engine restarts.

`cache_full` can be true as well if the limit for cached keys has been reached, hence we need to merge both checks. In this case `num_cached_keys` equals `max_cached_keys` exactly, hence it is easy to differentiale whether `opcache.max_accelerated_files` or `opcache.memory_consumption` needs to be raised to address the `cache_full` state.

In practice, this change relaxes the checks: the respective limit needs to be reached 100% instead of 90%, to trigger a warning, eliminating also false alarms if a large share of the cache is consumed by wasted memory, which would be automatically freed once cache is 100% full.

Additionally, the recommendation for raising `opcache.max_accelerated_files` now says "a value higher than `max_cached_keys`", instead of "higher than `opcache.max_accelerated_files`". The actual limit, reflected by `max_cached_keys` from `opcache_get_status()`, [is a next higher value from a set of prime numbers](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files). E.g. if `opcache.max_accelerated_files` is set to 10,000 (PHP default), the effective limit is 16,229 OPcache keys. Recommending "higher than 10000" could hence lead to a settings change without effect. For an effective change, the new value needs to be "higher than 16229" instead, which is what the setup check will show in this situation, with this change applied.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-08-01 09:34:41 +02:00
.devcontainer Increase PHP memory limit for DevContainer to 512mb 2024-06-23 20:27:23 +02:00
.github chore(codeowners): add codeowners for calendar and contacts impl 2025-07-21 14:35:24 +02:00
.idea chore: Add SPDX header 2024-05-31 10:38:47 +02:00
.reuse fix: unbloc ffmpeg on some broken videos 2025-07-03 10:47:19 +02:00
.tx chore: Add webhook_listeners to list of shipped apps 2024-08-20 20:54:34 +00:00
3rdparty@29915695b6 chore(3rdparty): Bump pear/pear-core-minimal from 1.10.15 to 1.10.16 2025-06-19 23:12:41 +02:00
__mocks__ fix(files): always ask for confirmation if trashbin app is disabled 2024-07-27 07:13:39 +00:00
__tests__ fix(OC): validate request token and move logic to one place 2025-06-17 00:17:55 +02:00
apps feat(settings): simplify OPcache checks 2025-08-01 09:34:41 +02:00
build fix(security): Update CA certificate bundle 2025-07-16 02:44:58 +00:00
config fix: Hide "Create templates folder" option if templates are disabled in configuration 2025-05-20 13:47:24 +00:00
contribute chore: Add SPDX header 2024-05-27 14:53:40 +02:00
core fix(l10n): Update translations from Transifex 2025-08-01 00:12:27 +00:00
cypress fix(files): add plural form for selected nodes 2025-06-20 12:38:12 +02:00
dist chore(assets): Recompile assets 2025-07-29 10:51:51 +00:00
lib Merge pull request #54116 from nextcloud/backport/52778/stable30 2025-07-31 18:55:54 +02:00
LICENSES fix: correct link to trademark 2024-09-15 17:53:41 +00:00
ocs chore: apply code style 2025-04-30 19:04:59 +02:00
ocs-provider chore: apply code style 2025-04-30 19:04:59 +02:00
resources fix(security): Update CA certificate bundle 2025-07-16 02:44:58 +00:00
tests fix: check if properties exist before using them 2025-07-28 12:03:50 -04:00
themes chore: apply code style 2025-04-30 19:04:59 +02:00
vendor-bin build(deps): bump phpunit/phpunit in /vendor-bin/phpunit 2025-05-03 02:20:26 +00:00
.editorconfig chore: Add SPDX header 2024-05-26 20:05:04 +02:00
.envrc chore: Add nix flake with development shell 2025-05-19 12:01:40 +02:00
.eslintignore chore: Add SPDX header 2024-05-13 17:41:36 +02:00
.eslintrc.js chore: Enable ESLint for apps and fix all errors 2024-07-09 17:13:30 +02:00
.git-blame-ignore-revs chore: ignore coding-standard PRs from git blame 2025-04-30 19:24:52 +02:00
.gitattributes chore: Add SPDX header 2024-05-26 20:05:04 +02:00
.gitignore chore: Add nix flake with development shell 2025-05-19 12:01:40 +02:00
.gitmodules chore: Add SPDX header 2024-05-26 20:05:04 +02:00
.htaccess FIX WebDav MacOS failed uploads php-fpm and big files (-36 error) 2024-12-05 15:34:45 +01:00
.jshintrc chore: update .jshintrc 2024-05-27 07:53:01 +02:00
.mailmap Merge pull request #29245 from nextcloud/artonge-patch-1 2021-10-14 19:27:28 +02:00
.npmignore
.php-cs-fixer.dist.php fix(cs-fixer): Correctly ignore files ignored by git 2025-03-28 11:02:51 +00:00
.pre-commit-config.yaml chore: Add SPDX header 2024-05-13 17:41:36 +02:00
.scrutinizer.yml chore: Add SPDX header 2024-05-13 17:41:36 +02:00
.tag
.user.ini chore: Add SPDX header 2024-05-26 20:05:04 +02:00
AUTHORS fix(settings): change Mastodon only URI to webfinger 2025-07-07 10:02:23 +00:00
autotest-checkers.sh chore: Add SPDX header 2024-05-26 20:05:04 +02:00
autotest-external.sh chore: Add SPDX header 2024-05-26 20:05:04 +02:00
autotest.sh chore: Add SPDX header 2024-05-26 20:05:04 +02:00
babel.config.js fix: jest transform private methods 2024-08-03 09:44:12 +02:00
CHANGELOG.md chore: Add SPDX header 2024-05-10 11:07:50 +02:00
CODE_OF_CONDUCT.md chore: Add SPDX header 2024-05-10 11:07:50 +02:00
codecov.yml chore(branchoff): Test against stable30 branches 2024-08-14 13:53:22 +02:00
composer.json feat: drop support for php 8.0 2024-04-08 11:28:54 +02:00
composer.lock fix(CI): Update PHP requirement in dev dependencies 2024-06-11 10:52:24 +02:00
console.php chore: apply code style 2025-04-30 19:04:59 +02:00
COPYING
COPYING-README docs: Reference 3rd party licenses via SPDX 2024-06-26 23:55:19 +02:00
cron.php chore: apply code style 2025-04-30 19:04:59 +02:00
custom.d.ts chore: Add SPDX header 2024-05-10 11:07:50 +02:00
cypress.config.ts test: Expose set and getVariable in Cypress tests 2025-03-05 13:45:23 +01:00
cypress.d.ts chore: fix some comments 2024-07-29 14:43:27 +08:00
DESIGN.md chore: Add SPDX header 2024-05-10 11:07:50 +02:00
flake.lock chore: Add nix flake with development shell 2025-05-19 12:01:40 +02:00
flake.nix chore: Add nix flake with development shell 2025-05-19 12:01:40 +02:00
index.html chore: Add SPDX header 2024-05-26 20:05:04 +02:00
index.php chore: Add SPDX header 2024-05-26 20:05:04 +02:00
jest.config.ts fix: adjust code 2025-06-17 00:28:19 +02:00
Makefile chore: Add SPDX header 2024-05-26 20:05:04 +02:00
occ fix(occ): Suppress errors when checking config.php fileowner 2025-03-26 09:14:32 +00:00
package-lock.json chore(deps): update @nextcloud/vue to v8.28.0 2025-07-14 20:55:44 +02:00
package.json chore(deps): update @nextcloud/vue to v8.28.0 2025-07-14 20:55:44 +02:00
psalm-ocp.xml chore: Add SPDX header 2024-05-10 11:07:50 +02:00
psalm.xml chore: lint files_reminders using psalm 2025-04-07 09:39:15 +00:00
public.php fix(dav): drop unwanted RemoteException class 2024-07-30 12:12:32 +02:00
README.md chore(branchoff): Test against stable30 branches 2024-08-14 13:53:22 +02:00
remote.php fix(dav): drop unwanted RemoteException class 2024-07-30 12:12:32 +02:00
robots.txt
SECURITY.md chore: Add SPDX header 2024-05-10 11:07:50 +02:00
status.php chore: Add SPDX header 2024-05-26 20:05:04 +02:00
tsconfig.json fix(OC): validate request token and move logic to one place 2025-06-17 00:17:55 +02:00
version.php build(hub): 30.0.13 2025-07-09 13:40:31 +00:00
webpack.common.js fix(files): do nothing if view local dialog was just closed 2025-06-02 16:56:07 +02:00
webpack.config.js chore: Add SPDX header 2024-05-10 11:07:50 +02:00
webpack.modules.js fix: update request token on two-factor pages 2025-06-23 16:00:34 +02:00

Nextcloud Server ☁

REUSE status Scrutinizer Code Quality codecov CII Best Practices Design

A safe home for all your data.

Why is this so awesome? 🤩

  • 📁 Access your Data You can store your files, contacts, calendars, and more on a server of your choosing.
  • 🔄 Sync your Data You keep your files, contacts, calendars, and more synchronized amongst your devices.
  • 🙌 Share your Data …by giving others access to the stuff you want them to see or to collaborate with.
  • 🚀 Expandable with hundreds of Apps ...like Calendar, Contacts, Mail, Video Chat and all those you can discover in our App Store
  • 🔒 Security with our encryption mechanisms, HackerOne bounty program and two-factor authentication.

Do you want to learn more about how you can use Nextcloud to access, share, and protect your files, calendars, contacts, communication & more at home and in your organization? Learn about all our Features.

Get your Nextcloud 🚚

Enterprise? Public Sector or Education user? You may want to have a look into Nextcloud Enterprise provided by Nextcloud GmbH.

Get in touch 💬

You can also get support for Nextcloud!

Join the team 👪

There are many ways to contribute, of which development is only one! Find out how to get involved, including as a translator, designer, tester, helping others, and much more! 😍

Development setup 👩‍💻

  1. 🚀 Set up your local development environment
  2. 🐛 Pick a good first issue
  3. 👩‍🔧 Create a branch and make your changes. Remember to sign off your commits using git commit -sm "Your commit message"
  4. ⬆ Create a pull request and @mention the people from the issue to review
  5. 👍 Fix things that come up during a review
  6. 🎉 Wait for it to get merged!

Third-party components are handled as git submodules which have to be initialized first. So aside from the regular git checkout invoking git submodule update --init or a similar command is needed, for details see Git documentation.

Several apps that are included by default in regular releases such as First run wizard or Activity are missing in master and have to be installed manually by cloning them into the apps subfolder.

Otherwise, git checkouts can be handled the same as release archives, by using the stable* branches. Note they should never be used on production systems.

Tools we use 🛠

Helpful bots at GitHub 🤖

  • Comment on a pull request with /update-3rdparty to update the 3rd party submodule. It will update to the last commit of the 3rd party branch named like the PR target.

Contribution guidelines 📜

All contributions to this repository from June 16, 2016, and onward are considered to be licensed under the AGPLv3 or any later version.

Nextcloud doesn't require a CLA (Contributor License Agreement). The copyright belongs to all the individual contributors. Therefore we recommend that every contributor adds the following line to the AUTHORS file if they made substantial changes to the code:

- <your name> <your email address>

Please read the Code of Conduct. This document offers some guidance to ensure Nextcloud participants can cooperate effectively in a positive and inspiring atmosphere and to explain how together we can strengthen and support each other.

Please review the guidelines for contributing to this repository.

More information on how to contribute: https://nextcloud.com/contribute/