Nextcloud Database Checks in 35.0.1

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 35.0.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Linux 6.12.75+rpt-rpi-2712 Bookworm
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.68 Debían
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • none
  • PHP version (e.g, 8.3):
    • PHP 8.4.26
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • when upgrading to Nextcloud 35
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare metal
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

In the System section of the Administration settings, there is a new section for Database checks (which is a. great addition!) but the checks are showing issues with indexing and sorts that are not customizable from the nextcloud settings but instead need some DB programming and changes in code that are not available to the administrator or end user.

Steps to replicate it (hint: details matter!):

  1. Go to Administration Settings

  2. Select System

  3. Then Database

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

Joins without indexes

Warning ·Select_full_join

Failing

Some joins are scanning entire tables because no usable index exists on the join column.

3.3997% of queries did a full join without an index.

Identify the offending queries (set log_queries_not_using_indexes) and add the missing indexes.

Value

3.40

Table open cache hit rate

Notice ·Table_open_cache

Failing

The table open cache is too small; tables are being opened from disk frequently.

1.2661% of table opens missed the cache.

Increase table_open_cache (and table_definition_cache) until the miss rate drops below 1%.

Value

1.27

Setting

table_open_cache→8000

 Show config snippet

High sorted-row rate

Notice ·Sort_rows

Failing

Many rows are being sorted server-side.

Sorted rows average: 40985 per hour.

Make sure ORDER BY columns are indexed so sorts use indexes instead of merge passes.

Value

11.38

Join-without-index rate

Warning ·Join_without_index_rate

Failing

Many SELECTs are doing full table scans or joins without indexes.

Index-less join+scan rate: 2531 per hour; aim for less than 1.

Add indexes for the columns used in JOIN conditions and WHERE filters.

Value

0.70

Full-index-scan rate

Notice ·Handler_read_first_rate

Failing

Many queries are reading the first index entry, suggesting frequent full-index scans.

Full-index-scan rate: 494 per hour; aim for less than 1.

Investigate whether the indexes match query predicates; rewrite queries that scan the whole index.

Value

0.14

Fixed-position read rate

Notice ·Handler_read_rnd_rate

Failing

Many queries are reading rows by fixed position — usually a sign of full table scans + sorts.

Fixed-position read rate: 40693 per hour; aim for less than 1.

Add indexes that match the queries' ORDER BY / JOIN columns.

Value

11.30

Sequential-row read rate

Notice ·Handler_read_rnd_next_rate

Failing

Many queries are scanning tables sequentially.

Sequential-row read rate: 1209530 per hour; aim for less than 1.

Add indexes that match common WHERE / JOIN predicates.

Value

335.98

Replication 1 failing

Replica lag

Alert ·Slave_lag

Failing

A configured replica is not running.

Slave_running is reporting OFF.

Check the replica with SHOW REPLICA STATUS; resolve any IO/SQL errors and restart replication.

Value

0

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

PASTE HERE

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Same here. I get warnings for:

Memory: On-disk temp tables

Warnung·Created_tmp_disk_tables

Fehlgeschlagen

A large share of temporary tables are being created on disk instead of in memory.

29.5209% of temp tables ended up on disk.

Increase tmp_table_size and max_heap_table_size to keep more temp tables in memory.

InnoDB: InnoDB log file size

Warnung·Innodb_log_file_size

Fehlgeschlagen

innodb_log_file_size is small; a small log forces frequent checkpoints and limits write throughput.

innodb_log_file_size is 100663296 bytes; a value of at least 128 MB is recommended.

Increase innodb_log_file_size to at least 128 MB on busy servers.

Problem is that the code snippets provided to solve these problems are to be inserted in my.cnf, which is a MariaDB configuration file that I can’t access (let alone modify) in my shared hosting environment.

So it seems that have to live with the new warning messages. But as long as my cloud works fine from a user’s perspective, I think I shouldn’t be to nitpicky myself… :wink:

Many have full access to their system and were in the past looking for improvements of their overall performance of Nextcloud. The speed of the database plays a major role and this often requires a configuration different from the default settings. For these users, that kind of information is extremely helpful.

If you are on hosted environments, you cannot change this but you might have many more restrictions as well.

Am I right in assuming that I can’t do any configuration changes using phpMyAdmin?

You can just edit the tables, change the indices or do something like that. But you cannot change the database-server configuration (would also require a restart/reload).

I don’t know if the provider has some options to change the database parameters, but normally if you need something different, you better use at least a virtual server.

For what it’s worth, I updated to 35.0.2 and it seems to have gone away, after I did the usual missing indices housekeeping.

Self-hosting Nextcloud gives you control over your data, your infrastructure and your digital independence, but that control comes with responsibilities.

Nextcloud is an application, not a substitute for system administration; so, if you decide to run your own cloud, you are also taking responsibility for the operating system, web server, PHP, database, networking, security, backups, updates and disaster recovery.

You don’t need to be a professional DBA, but you absolutely need to understand the database you’re running, how to diagnose problems, how to maintain it and, most importantly, how to recover it when something goes wrong.

A database performance warning is not an invitation to blindly change settings. It’s an invitation to investigate, understand the metrics and determine whether intervention is actually necessary.

Of course, Nextcloud should provide accurate diagnostics and meaningful documentation. But expecting a self-hosted platform to eliminate the need for system administration is fundamentally misunderstanding what self-hosting means.

If you want full control, you must accept full responsibility; if you don’t want to deal with databases, servers, security and maintenance, there’s nothing wrong with choosing a managed Nextcloud provider.

That’s precisely what managed hosting is for.

Digital sovereignty isn’t free: you pay for it with knowledge, time and responsibility, not just hardware.

With great power comes great responsibility… and root access is a pretty good example :wink:

You’re not necessarily wrong about what you’re saying, but it doesn’t really fit the context of this thread. Or, to put it another way, there’s no need to bring out the big guns when people here are simply posting specific warnings and asking whether and how they can fix them. Instead, you could have shared your knowledge with the people asking the questions and explained what those warnings actually mean. Just a thought. :wink:

Well, sometimes it sure does feel like one, when you look at the Maintenance page and see all the “tips” about things you could or should optimize. :wink:

It certainly wouldn’t hurt to have some general guidelines in the documentation, along the lines of: for this many users, you should have this much RAM and use these recommended PHP and database settings. :wink:

Exactly! :wink:

I don’t think anyone in this thread is disputing the first part of that. But, of course, there are many good reasons why someone might not want to use a managed Nextcloud provider. :wink:

For others you might come across this thread: I’m no database expert either, and I only have a superficial understanding of what most of these settings actually mean, but I had good experiences with Carsten Rieger’s database configuration: Nextcloud Installationsanleitung (Ubuntu 26.04 LTS) - Carsten Rieger I’m using his configuration on my home server in a VM with a manually installed Nextcloud instance, and I don’t see any warnings from Nextcloud’s database check.

However, with many of these settings, the optimal values depend on how much RAM you have, the storage type, how many users you have, which apps you’re running, and generally how much is going on in your Nextcloud instance. There’s no one-size-fits-all solution. For a typical home-user setup, and probably even for smaller businesses, though, I think Carsten Rieger’s configuration should work well.

By the way, if you want to self-host Nextcloud without having to worry about all these things, there’s always Nextcloud AIO. It comes with sensible default settings and is already preconfigured and tuned, so you don’t have to. Of course, shared web hosting isn’t an option here; for AIO, you’ll need a system that can run Docker, preferably a Linux server, VM, or VPS.

For those using shared hosting platforms: The underlying infrastructure is usually designed and optimized for traditional websites and CMS platforms like WordPress. That means you probably have to live with most of those warnings and potential performance limitations. However, those limitations have always been there. Nextcloud is simply making them more visible to you now.

You’re right, @bb77. Looking back at my previous comment, I realize I was too harsh and, more importantly, that I missed the actual point of this discussion. People were asking for help understanding specific warnings, not questioning whether self-hosting comes with responsibilities.

I still believe in what I said about the responsibilities of running your own infrastructure, but there’s something I should have considered: system administration is often invisible work, and after years of experience, it’s surprisingly easy to forget how much time and effort it took to learn things that now seem obvious.

Perhaps part of my reaction comes from the fact that I learned my way around computers and system administration back in the days when the first answer you were likely to get after asking a technical question was simply “RTFM”. :joy: That was the culture I grew up with, and apparently some old habits are harder to get rid of than others. It certainly explains my reaction, although it doesn’t excuse it.

There’s an old story about an engineer who charges €1,000 for tightening a single screw. When the customer questions the bill, the engineer explains: €1 for tightening the screw, €999 for knowing which screw to tighten and exactly how much.

I’ve always liked that story because it illustrates the value of experience, but your reply reminded me of something equally important: knowing which screw to tighten doesn’t mean everyone else should already know it, and sharing that knowledge is often far more useful than reminding people of their responsibilities.

You also made a good point about documentation and the fact that there’s no universal configuration for every Nextcloud installation. A warning is only really helpful when people can understand what it means, how serious it is and whether they actually need to do anything about it.

So, thank you for pointing this out. My previous comment was unnecessarily severe and didn’t contribute much to solving the problems being discussed. I should have offered some guidance instead of a lecture.

And I suppose knowing when to keep the screwdriver in the toolbox is part of the experience too. :wink:

upgraded do 35.0.2, still showing indexeses problems

I’ve upgraded, done the missing indices, still showing issues.

I am self hosting, but I wouldn’t just go around adding indices that might be dropped in the next upgrade. This should be brought to the devs attention so they look if this is something they can fix from the root.

That doesn’t mean that I need to fix the indices if this is going to be affecting future upgrades. Reporting these issues gives the nextcloud devs visibility on things that might have been overlooked and that may help bring stability to all other users of the platform.

So it’s not a matter of self-hosting and fix it yourself, but reporting things that may improve the overall efficiency and performance of the platform.

I take it you’re not very familiar with the acronyms BOFH and RTFM. :wink:

I am reporting an issue, not posting in a social network.

ahh Sorry, I really have no further information to give you..I hope you sort the problem out quickly.

These hints can be tricky. I don’t know the meaning of each of them out of the top of my head, it is more meant like, that is perhaps something you should look into. And the databases and their communities have quite some documentation to explain more details. And not all have to mean that there is a serious problem.

So before you report such an error, try to understand it and check if it is really an error. And fix other warnings first (in case problems are related). If you have problematic queries, I don’t know if it logs them or if you can enable their logging, so you can identify e.g. the related app.

Worst case: You develop some code, or run some other app that causes these messages.