Intense CPU usage by apache2 -DFOREGROUND

So Iā€™m running a NextCloud Instance in a docker-compose script using a nginx server to proxy all requests.
Everything worked fine for some days now, but today I can see very bad connection times. (NextClouds takes 50s to load in my browser. Every action I make takes another 20s).
The Uplink of my vServer is fine. But the CPU usage peeks some times at 100% all munched up by the ā€˜apache2 -DFOREGROUNDā€™ process.
I donā€™t know what I should do to fix the problemā€¦ Do you have any advice?
Fyi: Iā€™m running the latest version of docker ce, also the latest nextcloud instance, with no additional plugins.

My docker-compose.yml

version: '2'

networks:
  proxy:
    external:
      name: proxy
  nextcloud:
    external: false

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    container_name: nextcloud_db
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    networks:
      - nextcloud
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD={{removed}}
      - MYSQL_PASSWORD={{removed}}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    container_name: nextcloud
    networks:
      - nextcloud
      - proxy
    expose:
      - 80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    restart: always
    environment:
      - LC_CTYPE=de_DE.UTF-8
      - TZ=Europe/Berlin
1 Like

This is an example lighthouse report:

Same setup with same problems here. Today user reported unresponsive system to me. CPU was 100%, swap was blown up.

There were a lot of ā€˜apache2 -DFOREGROUNDā€™ processes in top. After killing apache root process, system got responsive again.

In my case two errors happened before the huge load starts. Found this in Logs:

The first one is from AudioPlayer App which canā€™t access a file in shared folder. Iā€™m not sure what the second one means, I canā€™t see any database outages.

My database is on Postgres.

For me itā€™s reproduceable:

  1. Install AudioPlayer
  2. Upload mp3 File to shared Folder
  3. Try to play the file

On my server many apache processes spawn and server gets taken down by load.

Setup:
Image: nextcloud:14.0.4-apache
Db: Postgres 9.6.8
Host: Debian 9

Iā€™m not using any plugin at all.

The issue persists with a normal Vanilla Version

Because updating AudioPlayer donā€™t solve this problem I opened an issue on Github:

If you have further informations, please comment :slight_smile:

Oh OK, sorry for my spam. Can you reproduce this? Are there any errors in your nextcloud.log?

My AudioPlayer app is working fine after reinstall. Server load gets still high. I can trigger it by accessing a shared folder with my browser.

Do you have shared folders, too?

Edit:
Tried updating my instance to 15.0.4. Error is still around.

Yes I have shared folders.
But the load is high on any connection. (Initial load to root directory too)

same issue for me! No AudioPlayer installed!
I use Nextcloud Android app and I sync contacts and notes by using the DAVxāµ app

The issue disappeared for me after moving to faster discs.