Restic Mount memory usage

Hi,

To add a some context, I am using restic 0.9.3 compiled with go1.11.1 on linux/amd64, HTTP rest server as backend. I created a systemd file to start the restic mount. The repo I am testing on has less than 500k files and about 2GB in size. I have created a few scenarios below to test the memory usage of the mount command:

  • Restic mount resource usage when it is started:
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:46:45 UTC; 6s ago
 Main PID: 19473 (restic)
    Tasks: 13
   Memory: 339.2M
      CPU: 6.530s
  • Restic mount resource usage when running ls -la backups on the mountpoint:
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:46:45 UTC; 2min 20s ago
 Main PID: 19473 (restic)
    Tasks: 13
   Memory: 589.7M
      CPU: 11.246s
  • Restic mount resource usage after a new backup is created:
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:46:45 UTC; 4min 55s ago
 Main PID: 19473 (restic)
    Tasks: 13
   Memory: 588.5M
      CPU: 11.302s
  • Restic mount resource usage after running ls -la backups
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:46:45 UTC; 6min ago
 Main PID: 19473 (restic)
    Tasks: 13
   Memory: 806.7M
      CPU: 16.181s
  • Restic mount resource usage after another new backup is created
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:46:45 UTC; 8min ago
 Main PID: 19473 (restic)
    Tasks: 13
   Memory: 797.2M
      CPU: 16.440s
  • Restic mount resource usage after running ls -la backups
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:46:45 UTC; 10min ago
 Main PID: 19473 (restic)
    Tasks: 13
   Memory: 934.5M
      CPU: 21.207s
  • Restic mount resource usage when restic mount restarted
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:57:26 UTC; 8s ago
 Main PID: 21078 (restic)
    Tasks: 11
   Memory: 331.5M
      CPU: 6.480s
  • Restic mount resource usage when running ls -la backups:
systemctl status restic
● restic.service - Start restic mount
   Loaded: loaded (/etc/systemd/system/restic.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-05-23 02:57:26 UTC; 1min 34s ago
 Main PID: 21078 (restic)
    Tasks: 12
   Memory: 628.9M
      CPU: 11.277s

As you can see, the memory usage after each backup increase by the size of the repo’s cache and only release when it is restarted. Is this expected behavior?

I searched for the issue on github and found a similar ticket: https://github.com/restic/restic/issues/1680.

Unfortunately, I can’t restart the restic mount often because I mount the restic mount to a docker container so if I restart the restic mount, I would receive this message: Transport endpoint is not connected.

1 Like

Can you explain your use case for automatically running restic mount? It seems odd to me to have the repository mounted 24/7.

Hi Chris,

We mount our restic mounts into docker containers so that our customers can have access to the backups anytime without the need of knowing restic.

Tommy