Performance Testing IPFS Protocol Recently I stumbled upon IPFS project while browsing in GitHub. I read the documentation and was able to quickly spin up it in my Windows laptop and started sharing my files to my wife. In this blog post, I will share the details about what is IPFS, how to get started, and performance testing IPFS protocol in Apache JMeter.
What is IPFS?
I don’t want to rephrase any thing about IPFS; below is from Wikipedia.
The InterPlanetary File System (IPFS) is a protocol and peer-to-peer network for storing and sharing data in a distributed file system. IPFS uses content-addressing to uniquely identify each file in a global namespace connecting all computing devicesSource: Wikipedia
TLDR; A peer-to-peer hypermedia protocol designed to make the web faster, safer, and more open.
You can share your files and folders with anyone over IPFS, just like sharing a file in cloud, but IPFS works differently.
How it works?
Suppose, you have a file called hello-world.txt. The contents of your file is given a unique fingerprint called cryptographic hash. e.g. QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB
After you upload a file, IPFS will remove duplication across the network, meaning there will be only one hash exists.
IPFS is a network. When you spin IPFS in your local network, it will have only your files/folders that you are interested in and some information about the index.
When you search for a file, you ask IPFS network to look up for the hash. Hash might be gibberish, but file is a human-readable names using IPNS.
Please check the below video, if you are interested in learning more.
Install IPFS in Windows 10 and Launch IPFS WebUI
- Go to IPFS Distributions page, download the package.
- Extract the zip file.
- Open command prompt and navigate the extracted folder.
ipfs initand hit enter
- this will initialize IPFS for you
ipfs daemoncommand and hit enter
- In the console, you could see the WebUI URL e.g.
Launch the WebUI in your favorite browser. Below is the home page of IPFS. Each peer will have a unique ID.
IPFS is a protocol that defines a content-addressed file system, coordinates content delivery and combines ideas from Kademlia, BitTorrent, Git and more.
IPFS is a filesystem. It has directories and files and mountable filesystem via FUSE.
IPFS is a web. Files are accessible via HTTP gateways like
https://ipfs.io. Browsers can be extended to use the
ipfs://scheme directly, and hash-addressed content guarantees authenticity
IPFS is p2p. It supports worldwide peer-to-peer file transfers with a completely decentralized architecture and no central point of failure.
IPFS is a CDN. Add a file to your local repository, and it’s now available to the world with cache-friendly content-hash addressing and bittorrent-like bandwidth distribution.
Before you get started, you need to check the status of your node. You can manager your files/folders in the Files page.
Let us add the hash
QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB file to the node.
After uploading, you can see the share and view the content. This is the sample URL https://ipfs.io/ipfs/QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB
Performance Testing IPFS in Apache JMeter
As a performance tester, I attempted to test the IPFS protocol. As I mentioned in the example IPFS link https://ipfs.io/ipfs/QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB, you can clearly see that it is https protocol. You can simply visit this in the browser and view the contents.
When you create a test plan in JMeter, you are simply overloading ipfs.io domain which you are not authorized to conduct any form of performance testing.
Your IPFS gateway will be running in default port, in my case, I have changed the port to 8082 i.e. my node is
WebUI runs at 5001 port.
Ideally, you should be testing the 8082 port, not 5001.
Let us design the simple test plan with two variants.
- IPFS Hash
- GET https://ipfs.io/ipfs/QmaYCvZYU8pfGFrpUeuFPcFDHGyUvf7Vi9rF1Pus4xSfVS
- Localhost Hash
Both the requests are working fine. Please note that I have execute with just only one thread.
Now, it is time to analyze the latency. Below is the aggregate report.
When you observe the 95th percentile response time of IPFS Hash (194 ms) which is greater than Localhost Hash (21 ms).
The reason is you are accessing the hash which is in the IPFS network which will take more time to lookup. But you can retrieve the file from your node much faster.
You need to measure the performance of single node and baseline it. Based on your bandwidth, you can deploy private network of IPFS or you can implement IPFS in more nodes. You can check this link about IPFS Clusters.
IPFS is still evolving. You can check the roadmap in here.
Your take: how much are you interested in IPFS? Please let me know in the comments.