henrywhitaker3 / Speedtest-Tracker

Continuously track your internet speed
GNU General Public License v3.0
1.53k stars 121 forks source link

Copying site files each time is inefficient #641

Open agneevX opened 3 years ago

agneevX commented 3 years ago

Hello.

I'm running Speedtest-tracker on my Raspberry Pi, which has a SD card.

When the container is started, it copies tens of thousands of files to the mapped config folder (www).

This causes the server to severely freeze and system load to balloon to over 12.

Not only that, heavy I/O of this kind also causes issues with the SD card.

Context

agneevX commented 3 years ago

Resorted to storing the data in-memory

speedtest-tracker:
  container_name: speedtest-tracker
  image: henrywhitaker3/speedtest-tracker:latest-arm
  restart: unless-stopped
  ports:
    - 8700:80
  healthcheck:
    test: ["CMD", "curl", "localhost", "-fso", "/dev/null"]
  environment:
    - PUID=1001
    - PGID=1001
    - UMASK=002
    - TZ=
    - OOKLA_EULA_GDPR=true
  volumes:
    - /opt/appdata/speedtest-tracker:/config
    - type: tmpfs
      target: /config/log
      tmpfs:
        size: 32mb
    - type: tmpfs
      target: /config/www/node_modules
      tmpfs:
        size: 400mb
    - type: tmpfs
      target: /config/www/vendor
      tmpfs:
        size: 100mb
    - type: tmpfs
      target: /config/www/public
      tmpfs:
        size: 50mb
kzaoaai commented 3 years ago

I rsync or robocopy to a remote server and I can relate. This helps but it would be nice for the config folder to only have config files and the database.

pro4tlzz commented 2 years ago

Why is the www folder so big?

agneevX commented 2 years ago

This is typical of Node dependencies. It should however read from the Docker image.