datarhei / restreamer-ui

The user interface of the Restreamer for the connection to the Core application.
https://datarhei.com
Apache License 2.0
46 stars 38 forks source link

Restreamer-UI takes way too much resources - crashes #12

Closed royvandongen closed 1 year ago

royvandongen commented 2 years ago

While running Restreamer-UI i have noticed the process taking up upto 100% cpu and 2gigs of memory (just the UI). while using the composefile below:

When adding mem_limit: 500m and cpus:0.50, the ui wont even start anymore. indicating something might be wrong with the ui (process node /ui/node_modules/react-scripts/start.js is running at max cpu). 500Megabyte of memory and 1.5Ghz should be plenty to run a basic gui under normal circumstances.

Also the documentation lacks explanaition about the current state of restreamer-ui and the posibility to connect to the core at the correct methods.

docker logs output:

> react-scripts start

ℹ 「wds」: Project is running at http://172.20.0.3/
ℹ 「wds」: webpack output is served from 
ℹ 「wds」: Content not from webpack is served from /ui/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...

The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
npm WARN config cache-min This option has been deprecated in favor of `--prefer-offline`.

docker-compose.yml:


services:
  restreamer:
    image: datarhei/core:latest
    container_name: restreamer
    restart: always
    ports:
      - 8080:8080
      - 1935:1935
    volumes:
      - /opt/datarhei/data/core/config:/core/config
      - /opt/datarhei/data/core/data:/core/data
    environment:
      - CORE_API_AUTH_USERNAME=${API_USERNAME}
      - CORE_API_AUTH_PASSWORD=${API_PASSWORD}
      - CORE_RTMP_ENABLE=true
      - CORE_RTMP_ADDRESS=:1935
      - CORE_RTMP_APP=/live
      - CORE_METRICS_ENABLE=true
      - CORE_METRICS_ENABLE_PROMETHEUS=true
  restreamer-gui:
    image: datarhei/restreamer-ui:latest
    container_name: restreamer-gui
    restart: always
    depends_on:
      - restreamer
    ports:
      - 3000:3000```
ioppermann commented 2 years ago

The Docker image starts the development server for the UI which runs the unoptimized code. We checked in changes, that will start the Caddy webserver serving the static optimized build of the UI. This will result in a smaller image size and less CPU and memory usage.

ioppermann commented 1 year ago

Has already been resolved with the latest releases.