Nextcloud 18 - MariaDB 10.1.44 - Database at 300GB

MariaDB Database Size at 300GB+

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 18.3
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.4.4

The issue you are facing: The Database size unusually large. Is this normal?

I have data over 5TB (and growing) with 500+ users accessing (via LDAP Authentication). The database size was 50GB two weeks ago and its now oever 300GB. The server is almost 4 weeks old. The data volume of 5TB was synced via the nextcloud client from a regular Windows File Server.

The server started freezing, so I have bumped the server on to 16 Core, 64GB RAM. I have taken all optimization steps for DB, and NGINX optimization. The server is currently utilizing 57 GB of RAM and 2% CPU. Nextcloud is currently operating very smoothly and flawlessly, except for some PHP based errors from LDAP. My worry is the size of the database and the speed its growing.

I just want to know if this is normal? Please advise.

How many files?

What you’re experiencing is likely this -

I have not experienced this with postgresql. The table is 12MB with 8000 files, meaning I can support close to three million files per 4GB of storage on the oc_cache table.

This does not account for previews. You might want to limit previews significantly with 500 users if not outright disable them.

Did you check which tables where big ? oc_filecache and oc_activity are usually the only one that grow fast.

To reduce oc_activity -> How to reduce OC_Activitiy table
To reduce oc_filecache -> (like posted by @Paradox551)

hey,man. My server is 8cpu 32memory in ESXI. when I use JMETER to test login or reload url.CPU is too high by php-fpm.only can 15/sec concurrent,CPU is all use 90%.