Question about Restic backup suddenly running slow

Hi, I am running the Restic backup for several months and it works fine.
I have a backup that can be completed very fast normally. However, it suddenly run very slow today.

The backup information is as follow:

open repository
reading repository password from stdin
lock repository
load index files
using parent snapshot 3dbd27a7
start scan on [/mnt/xxxxxx/]
start backup on [/mnt/xxxxxx/]
scan finished in 712.801s: 1691 files, 705.143 GiB

Files:           1 new,  1689 changed,     1 unmodified
Dirs:            0 new,   541 changed,     0 unmodified
Data Blobs:      1 new
Tree Blobs:    524 new
Added to the repo: 21.398 MiB

processed 1691 files, 705.143 GiB in 4:02:49
snapshot 3f317d3d saved
The status code is : 0

The backup information of the previous backup is as follow:

open repository
reading repository password from stdin
lock repository
load index files
using parent snapshot 30ac8864
start scan on [/mnt/xxxxxx/]
start backup on [/mnt/xxxxxx/]
scan finished in 20.216s: 1690 files, 705.140 GiB

Files:           0 new,     1 changed,  1689 unmodified
Dirs:            0 new,     3 changed,   538 unmodified
Data Blobs:      0 new
Tree Blobs:      4 new
Added to the repo: 1.742 MiB

processed 1690 files, 705.140 GiB in 0:20
snapshot 3dbd27a7 saved
The status code is : 0

I did not add many files between the 2 backup, and when I compare the snapshots, the result is as follow:

comparing snapshot 3dbd27a7 to 3f317d3d:


Files:           1 new,     0 removed,     0 changed
Dirs:            0 new,     0 removed
Others:          0 new,     0 removed
Data Blobs:      1 new,     0 removed
Tree Blobs:    524 new,   524 removed
  Added:   21.398 MiB
  Removed: 21.165 MiB

The size of the newly added excel file is around 3.8M

I am running the backup to backup the file from Remote File System mounted with SSHFS. The Restic version is 0.13.1 and the operation system is CentOS7, and multiple Restic backup are run at the same time to backup different folder.

May I know why this backup suddenly take much longer than normal? Thanks.

Please start by including the complete restic commands you used to run these two backups (including any environment variables, etc).

I have created a shell script for the restic backup and set a cron job to run the shell script. The 2 backup are scheduled backup. After every backup, it runs the check command for checking integrity and consistency. I followed the guide (Examples — restic 0.13.1 documentation) to create a restic user.

I have multiple folders to backup and I set up multiple cron jobs as follow in the root user:

/usr/bin/bash /path_to_shell_script "/mnt/backup_item_path/" "/backup_repo_path" "/output_txt_path"

The shell script is as follow:

export RESTIC_PROGRESS_FPS=0.016666
echo 'password' | sudo -u restic /home/restic/bin/restic -r $backup_repo_path --verbose backup $backup_item_path >> $output_txt_filename 2>&1
echo "The status code is : $?" >> $output_txt_filename
echo 'password' | sudo -u restic /home/restic/bin/restic -r $backup_repo_path --verbose stats >> $output_txt_filename 2>&1
echo 'password' | sudo -u restic /home/restic/bin/restic -r $backup_repo_path check --read-data-subset=100% >> $output_txt_filename 2>&1

I checked the environment variable with the root user using printenv command and the result is as follow:

which_declare=declare -f
LESSOPEN=||/usr/bin/ %s
BASH_FUNC_which%%=() {  ( alias;
 eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@

Is there still a performance problem? The most likely explanation is that either reading from the sshfs mount took much longer or that there is a performance problem during the upload.

In the slow backup run, all files are reported as changed, which means that restic had to read all 700GB via sshfs. So either the metadata of all files was changed on the remote side, or restic saw different metadata while reading from the sshfs mount. On possible reason would be that the inodes in the sshfs mount have changed. AFAIR these are not stable and can change from time to time. If the problem shows up again, you could give restic backup --ignore-inode [...] a try.