Comments (6)
And it's killed with an out-of-memory error? Are these a few huge files, or many small files?
You can confirm that you're using the file buffer by examining the directory that corresponds to os.TempDir() (or whatever you've set explicitly on the writer). For example, in Linux: inotifywait -m -e create -e delete /tmp
should show you many files of the form /tmp/blazer1234345
, which are created and destroyed.
I would like to get a full stack dump if you can capture one. Given that you're getting OOM errors (a) more quickly with smaller chunksizes, and (b) with the file buffer, I suspect that there is a goroutine leak somewhere, but I can't tell if it's in restic or blazer.
from blazer.
It's mostly small WordPress website files with an occasional large file here and there scattered in the upload directories. Correct it's getting killed due to out of memory Killed47] 8.25% 2.964 MiB/s 51.722 GiB / 627.106 GiB 448984 / 8804986 items 0 errors ETA 55:12:41
with the following viewable using dmesg
.
[1699096.104747] Out of memory: Kill process 26902 (restic) score 638 or sacrifice child
[1699096.105290] Killed process 26902 (restic) total-vm:2118824kB, anon-rss:860564kB, file-rss:0kB
I see lots of timeouts in the logs and also noticing the transfer speed is significantly slower then S3. With S3 I can get 20MiB/s however B2 is getting around 2MiB/s.
Ok I upgraded to latest commit of Restic and enabled file buffering. Everything else is default code. Looks like it might be file buffering as I see the following with inotifywait. Still it's not continuously making new tmp files like I would expect and the memory usage is much higher thing if I backup to S3.
/tmp/ CREATE blazer502882299
/tmp/ DELETE blazer502882299
/tmp/ CREATE blazer945928478
/tmp/ DELETE blazer945928478
/tmp/ CREATE restic-temp-pack-696469989
/tmp/ DELETE restic-temp-pack-696469989
/tmp/ CREATE blazer279276032
/tmp/ DELETE blazer279276032
/tmp/ CREATE blazer295254367
/tmp/ DELETE blazer295254367
As far as the full stack dump would using strace work? If so I'll email you the results.
from blazer.
Looking quickly at these debug logs, your process was killed around 8:04:30, but the most recent HTTP interaction was over two minutes earlier. I'll take a closer look later, but I suspect the memory blowup is in restic and not blazer.
However, the upload speed is probably B2 and blazer. Backblaze recommends that users establish multiple connections, because apparently they don't have load balancers or something. blazer can do this automatically for large files that get split into many chunks, which can be uploaded sequentially, but if you're uploading smaller files serially, you're only going to be talking to one endpoint at a time.
from blazer.
Do you still see memory pressure if you don't build a debug binary?
from blazer.
Yes I do. How far it gets is somewhat random but it does consistently fail. Just tried without a debug build and ended with Killed03] 5.59% 3.717 MiB/s 35.073 GiB / 627.105 GiB 382535 / 8804947 items 0 errors ETA 45:18:30
from blazer.
Yes so think the root issue is Restic. Just confirmed I'm having similar memory issues backing up locally. Looks like it's already an issue. Until that's resolved attempting to improve Blazer probably isn't worth it.
from blazer.
Related Issues (20)
- Add an option to turn off error handling
- Unable to create an empty file HOT 7
- EOF issue with zfsbackup-go HOT 24
- There is a race condition when a writer is cancelled. HOT 1
- No docs on creating Bucket object
- Slightly extend `base` interface for stateless programs HOT 4
- How to set custom info headers
- Get a file at a specific version (ID) HOT 3
- How to perform Delete operation on sequence of .JPEG files? HOT 2
- Error while trying to create *b2.Bucket object - bucket not found HOT 3
- Generating Auth Token and re-using it for list of image files stored on B2 bucket
- Question about the state of this library. HOT 1
- Operations on 0-byte-files fail with 416: out of content HOT 6
- Is bonfire able to be used as a local emulator? HOT 3
- Possible crashing bug HOT 2
- Infinite loop in NewClient() if system certificates are not installed HOT 1
- Supply optional bucketName parameter to listBuckets HOT 1
- Deleting a file downloads it first HOT 2
- go-fuzz is deprecated with Go 1.18
- Upload file with custom content type? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazer.