Write-buffer-size and write-prealloc-size explained

Can you explain a little bit what each of this lines does, and what affects each one? RAM, HDD, etc.

--filestore.write-buffer-size 4MiB \
--pieces.write-prealloc-size 4MiB \

Is there a dependency between them, between the values? I understand that buffer affects RAM, what about the other parameter?
I have a machine with small RAM and I’m afraid of setting 4MiB. If I set 1 or 2MiB for buffer and 4MiB for prealloc, is there a problem?
Thanks!

This post and thread should get you started until someone is here who can specifically answer

If I set 1 or 2MiB for buffer and 4MiB for prealloc , is there a problem?

3 Likes

This option will eat space like hell, at one point you will have half disk but you will not be able to write there, because you will be out of 4MB space at one piece. because if file even 1 kb it will reserve 4MB there. and you will not be able to write there any more next 1kb because left space will be less that 4MB

@Vadim
This is the default setting. I use it in Docker run command, just to be aware of it, but it’s the default setting in the newest config.yaml.
Even if I don’t use it in docker run, it will still be used with 4MiB. Untill Storj team dosen’t change it, I won’t as well, because I don’t understand what value is better and what problems can create.
What value are you using?
From what I read in linked threads, the space is freed after the piece is written on disk, so it will be full of data, not half empty blocks.
The code looks like this:

I have a question if Filestore.write-buffer-size: 4 MiB but .partial files are stiil accrue in temp folder why? why it not write directly to folder, where it intend to be?

because there should be only whole pieces.

but there is whole piece in the ram already, just write it there. it is the same, you write it to temp then copy to new location, but if buffer is 4mb whole piece can be in buffer. If buffer is only 128k then yes you need make it part by part.

actually we use move not copy in this case if I’m not mistaken.
Why to implement two mechanisms to write a piece, if one is working for both cases?

additional IO usage? but yes if it move then it wont take so much resources.

10 posts were merged into an existing topic: Large temporary folder