I am using libtorrent to transfer data to 10k+ nodes. Here the data I am transferring is very small in size(size of 10-50 mb). I want all the nodes to keep data in memory until all the other nodes finish downloading to avoid more disk io usage, and then flush the data to disk when the download is complete in all the host. Is there any way to do that ?
1 Answers
1
votes
If you set the disk cache (in libtorrent) large enough to fit all of your payload, it will be kept in RAM.
There is no way to prevent data from being flushed as you go though. However, flushing will happen in background threads, never blocking cache hit requests.
Whenever a piece is completed, it is flushed to disk.