Apache is using a lot of resources

Firstly, I seem to have this problem (*) too, although I’m using the out-of-the-box FreeBSD ports install, which uses MySQL and mod-php (5.6) on Apache 2.4, in mpm-worker configuration. Nextcloud is 13.0.2. FreeBSD is 12-CURRENT. System has 32G DRAM, 4-disk RAIDZ, 50G Swap.

(*) This problem being that httpd instances grow in size, seemingly without bound. Ultimately swap fills and shortly after the system crashes.

Now this seems really odd to me, because there ought to be no mechanism for an httpd instance to persist for long enough to exhibit a memory leak, right?

I wouldn’t say that I have large quantities of small files, either. Just documents and the like, for two users.

I do share contacts and calendar with clients on a couple of mac, iphone and android devices.

So: how is the discovery that lots of small files are implicated count as a “solution”? Still growing without bounds for me, and I have to keep an eye on it and restart apache every so often to avoid system instability and crashing.

This is a fairly new phenomenon. I don’t recall it happening under earlier versions of nextcloud. I can’t point to any particular change happening due to configuration changes, but there are many moving parts, and they all change and upgrade over time. If anyone has any suggestions about what I might do to tame the beastie, I’d appreciate it. I restarted apache half way through writing this message, and the four running instances of httpd are consuming a little less than 100M/minute…

It´s not a solution for YOUR problem, but for my question :slight_smile: .
Meaning that only at the beginning the nc instance or more specificly the mysqld instances were using massive amounts of RAM. And I could trace this back to the many small files. Once they were processed and stored in the cloud it was smooth sailing from there.

First a correction: my nextcloud is using SQLite, not MySQL: I have that in support of some other apps.

Secondly: I did some more poking around, and found in the settings that nextcloud’s self-diagnostics thought that I ought to have opcache configured differently (I had it off, to work-around a different problem from a couple of months ago.) After turning it on per the suggestion, my problem seems to have gone away. That is, all of my httpd instances seem to be sitting at a reasonable size and no longer growing. So there you go. Problem solved without the need for deeper understanding. Oh, well. Thanks all for listening.

I just split this off the original topic, since only the memory consumption was kind of a common symptom. Please note that it is recommended to use a real data base if possible. SQLite is only kept for users on hosting environment with very small setups (only one connected client). Especially if you have mysql already running.