Skip to content
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

web3.storage: don't load large files into memory #17

Open
makew0rld opened this issue May 30, 2024 · 1 comment
Open

web3.storage: don't load large files into memory #17

makew0rld opened this issue May 30, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@makew0rld
Copy link
Contributor

makew0rld commented May 30, 2024

Currently the upload tool creates CAR files when uploading to web3.storage. This is required to ensure the same CID is used. The library used to create CAR files loads the whole file into memory. This is usually fine, but will come back to bite us when we start ingesting large video files or something.

I have logged an upstream issue for this, although I expect to have to write the fix myself. photon-storage/go-ipfs-car#6

Also, there seems to be some compression in play, so testing future fixes for this should use random data (like from /dev/urandom) rather than a file full of zeros or something.

@makew0rld makew0rld added the enhancement New feature or request label May 30, 2024
@makew0rld makew0rld self-assigned this May 30, 2024
@makew0rld makew0rld changed the title Don't load files into memory to create CAR files web3.storage: don't load files into memory Jun 10, 2024
@makew0rld makew0rld changed the title web3.storage: don't load files into memory web3.storage: don't load large files into memory Jun 10, 2024
@makew0rld
Copy link
Contributor Author

makew0rld commented Jun 10, 2024

The library used to create CAR files loads the whole file into memory

This is fixed now, creating CAR files doesn't load files into memory when the file is over 1 GiB in size. That seems like a good default so it's what I have for now.

Unfortunately in practice the file still gets loaded into memory because that's what the w3 CLI does during the upload process. I've filed an issue for that: storacha/w3cli#193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant