High CPU load on Nextcloud instance

Hello Nextcloud community,

I’m recently installed Nextcloud in a AWS EC2 instance for my company. We are thinking about moving all of our files to this great application.
So far we have been testing it for a month and it has been working very nicely, but just last week we started getting performance issues. Login into the Nextcloud was very slow, and opening files or switching between applications was also extremely slow.

I notice that my CPU load in the admin “monitoring” tab was averaging 1.2 constantly, which was quite high for how we where using nextcloud. So what i did was to reboot Apache, by doing this Nextcloud returned to its usual performance, and the CPU load indicator displayed an average of 0.02 indicating that the web server was the component generating so much work on my server.

The thing is that i don’t know why the apache web server was generating so much cpu load.

Has someone experienced a similar issue? Does someone know why this is happening?

Thanks in advance Pablo.

Hi, i have the same Problem.

  • debian 4.9.30-2+deb9u5
  • nexcloud 12.0.3
  • Apache2 2.4.25 with special user inside a vhost
  • cron every 15 minutes

The apache uses 100% of all CPU cores with the nextcloud user.
Is this mybe a bug in the cron.php file?

I hope this bug will be fixed, because in this case i am thinking about to change back to owncloud.

It is the same with deactivated cron job.

Is Nextcloud used by many users when you have this CPU load? Is it one apache process at 100% or several ones? Anything in your logfiles?

Do you use caching modules (redis, apcu)? Real database or just sqlite? For the real database, did you do some cache optimizations, if not it can be very slow, however the load should be on the database.

  • I have only three users in my nextcloud with calendar sync.
  • multiple apache processes see picture below
  • Mariadb as database with no optimizations
  • APCu memory caching
  • enbaled services: files, picture galerie, calendar, contacts
  • no encryption module

Only restarting the apache service can stop the cpu load for some hours.

owncloud is the user which runs the nextcloud apache vhost.

The problem is with the calendar synchronisation. Every calendar synchronization on my smartphone starts the high cpu load.

I found a topic about caldav and high cpu load on the bug tracker:

Check if you have similar entries and there was also a fix you could try:

Same problem here.
Still existing in nextcloud 13.0.0.
Will this be fixed in future releases?

It is hard to tell what is wrong here. @pgollor has a lot of apache processes running for only three users. I’d try to reducce them a bit. Also it is strange that these apache processes run for a very long time, are you using system cronjobs (if not cronjobs are run by apache as well and increase the load). If possible use apcu and redis caches. When processes run too long, and logfiles don’t give any hint, you could suppose it is the sql-database. Enable slow-queries logging to get an idea.

Looks like the problem with the calendar app does not cause my high CPU usage.
The workaround posted in the link above does not help. I have the same problem again.
Apache server status shows about 150 processes coming from external heading for /status.php.
Most of them from the same v6 ip. I use calendar sync, desktop sync client and some tests with talk.

Then please open a new topic.

If possible, try to find the client with so many open connections (especially if it is your own). Can you disable certain services temporarily, so you can find out which clients creates so many connections? Also check on your browser if status.php returns a result immediately or if it takes a while.