I am trying to build a private network on AWS (Amazon Web Service). Now the network is successfully built, but still remains some issue. Here is how I build the private network:
Start a EC2 instance:
- sudo yum install golang
- adding these to .bashrc:
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/Go
export PATH=$PATH:$GOPATH/bin - source .barshrc
- go get -u -d github.com/ipfs/go-ipfs
- cd $GOPATH/src/github.com/ipfs/go-ipfs
- make install
IPFS private network:
- ipfs init
- go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
- ipfs-swarm-key-gen > ~/.ipfs/swarm.key
Servers share the same key
- ipfs bootstrap rm --all
ipfs daemon - ipfs id
- ipfs bootstrap add -----------------
- (ipfs swarm peers)
However, here is the problem: the file transmitting speed is about two times slower than on local machines.
When I say “slower” I am comparing it with performance of rsync in same environments. The private network I am building contains only two servers, so it should be a simple one-to-one transmitting, and the speed should be about the same as “rsync ssh”.
Here are some stats transmitting 1GB file from private network I build on my local machines, you could see from it that the real time is almost the same:
Local machine: rsync -avzhe ssh:
real 0m12.219s
user 0m4.976s
sys 0m3.720s
Local machine: ipfs pin add (a faster version of “ipfs get”, this will automatically pin the blocks you retrieve):
real 0m12.001s
user 0m0.036s
sys 0m0.008s
But when using AWS EC2, I tried both dedicated and shared tenancy, the speed of ipfs would be much slower than that of rsync:
AWS: rsync -avzhe ssh:
real 0m23.613s
user 0m8.629s
sys 0m5.245s
AWS: ipfs pin add:
real 0m50.343s
user 0m1.664s
sys 0m3.883s
As we could see, ipfs takes about double time to transmit the file.
I am currently working on this and trying to find out what makes the difference. I have already emailed AWS support, and was informed that they did not block ipfs intentionally, so there should not be such difference.
I wonder is there anyone who has experience with it, and maybe could let me know what is the cause of the situation. Below I attached info about the EC2 instance I created.