New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage backend: SMB #4185
Comments
By what metrics? |
Memory and CPU overhead for http processing due the local webserver required with rclone. |
Can you quantify that a bit more? Yes, obviously an additional process adds some overhead, but adding 1k+ lines of code to restic is not free either. So we have to weigh a possible performance benefit (that's all it is up to now) against the added complexity and maintenance overhead. Reviewing such a large PR is also a significant time investment which competes with other features that provide larger benefits for restic (e.g. features which cannot be properly implemented outside of restic, e.g. a restore progress bar). Additional backends increase the work necessary to maintain them and to e.g. evolve the internal interfaces. It also adds even more new dependencies, which is also somewhat problematic (see e.g, #4119 ). So, in general we are very reluctant to add new backends. Even more so if those are already available via rclone. |
Thank you for the insights. I can run some benchmarks and try to provide some more details and speed comparisons in a couple of days. Some other minor considerations -
But I do understand that this needs to be weighed against the big picture for restic. |
Here are the benchmarks: Test data used: Note: All tests were performed on the same environment. Test Environment: Destination: SMB server (SMB3) on an Asustor NAS device. Restic version: Build from #4186 commit - d062a82 Performance Monitor was used to capture Memory (in Bytes converted to MBs) and CPU usage (in % Processor time) for restic and rclone processes every 5 seconds. The Average CPU and Memory gives an idea about the average resource usage at a given instant.
Benchmarks - ResticSMBBenchmarkC5-1.xlsx Summary - So the SMB backend is 10% faster than the Rclone backend when same max connections are used and it saves 11% total CPU usage, 26% average memory usage and 40% total memory usage. Besides this, the SMB backend makes Sync calls on files like the local backend and has ability to mark files as read-only to avoid accidental modifications like the local backend, which would not happen with the rclone+SMB backend. SMB backend also supports atomic replace during save. |
The test results below indicate the pattern for performance characteristics with increasing data: Test data used:
Benchmarks: ResticSMBRcloneBenchmark-1TB .xlsx Summary: For 1.24 TiB, the SMB backend is 18% faster than the Rclone SMB backend and it saves 8% total CPU usage, 20% average memory usage and 34% total memory usage. |
I know that adding backends adds to the maintenance burden, but SMB is apparently very popular, judging by the number of bug reports about the Linux CIFS driver. The speedup is also impressive. |
I agree with SMB being very popular. In our environment, we would benefit with SMB support. I had many problems with cifs. Also it adds complexity with mount, or with rclone, that I would like to avoid with backup solution. |
Output of
restic version
restic 0.15.0 compiled with go1.19.5 on windows/amd64
What should restic do differently? Which functionality do you think we should add?
Ability to configure SMB as a storage backend in restic.
What are you trying to do? What problem would this solve?
It would be useful to be able to configure SMB as a backend in restic. This way we will not have to mount smb on the OS and then back up to it. Also, this is implementation would be more cross-platform.
I propose to use the https://github.com/hirochachacha/go-smb2 library which is also used by rclone for its SMB integration.
While it is possible to use SMB as a backend through rclone, having an SMB backend directly on restic will have less overhead and will be cleaner.
I have created an implementation for this and can create a PR for review.
Did restic help you today? Did it make you happy in any way?
The text was updated successfully, but these errors were encountered: