Intense CPU usage by apache2 -DFOREGROUND

docker

#1

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

#2

This is an example lighthouse report:


#3

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.


#4

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.


#5

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


#6

I’m not using any plugin at all.

The issue persists with a normal Vanilla Version


#7

Because updating AudioPlayer don’t solve this problem I opened an issue on Github:

If you have further informations, please comment :slight_smile:


#8

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


#9

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.


#10

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