I am currently trying to measure ipfs’ performances to write / read single block files (not in a folder) in an ipfs cluster of 15 nodes in raft mode. To write a file to a cluster, I use the
Add function from ipfs-cluster API, to read a file, I use the
cat function from ipfs API.
I am able to change the RTT between nodes, and noticed that the time needed on average to write a file is ~5-6 x maxRTT in the cluster, and reading ~3 x maxRTT in the cluster. Does it make sense ? I made experiments with maxRTT up to 2sec.
As I understand, when writing in Raft mode, the following packets are exchanged:
- Writing node updates the cluster leader (1/2 RTT)
- Leader broadcasts update to all peers and they ack (1 RTT)
- Leader waits for a majority of peers’ acks and broadcast the accepted update, returns to Writing node (~1/2 RTT)
Total: 2RTT, I got: 5RTT
When reading from IPFS, the following packets are exchanged:
I guess 1RTT for step 1.
1 RTT to establish the session in 2. ?
As the file has a single block, I am guessing step 3. takes 1RTT
Total: 3RTT, I got: 3RTT
Are operations performed locally (pinning) negligible compared with network delay ? If not what is the average time it takes for the longest local operations when writing and reading?
Thank you for your help