Open mycognosist opened 3 years ago
All tests were run with the same fixtures consisting of 100,000 messages from 20 unique authors. Two identities were chosen: one is labelled as server
and the other as peer
. The alloffsets server
netsim command was used to ensure the server
starts with all 100000 messages. The peer
was connected to the server
and we measured how many messages were replicated from server
to peer
in 6 seconds. A mutual follow was established before connecting the peer
to the server
(hence the 10249 message count for peer
in the test output).
Each test was run three times and averages were calculated for run time and message counts. Replication rate is calculated as (the total peer
messages minus 10249) divided by the run time.
All values are calculated as an average across three test runs for each implementation.
server | peer | messages | time | messages / second | relative performance |
---|---|---|---|---|---|
go | go | 59754 | 6.513 | 9175 | 2.1x |
js (db2) | js (db2) | 42161 | 6.521 | 6465 | 1.5x |
js | js | 28394 | 6.545 | 4338 | 1.0x |
Sample output from a single test run:
Note: go-sbot
was run without the -enable-ebt
flag in this test.
# Total time: 32.75269056s
# Active time: 2.25269056s
# Puppet count: 2
# Puppet Total time Active time # messages
# server 34.151s 3.651s 100002
# peer 18.749s 249ms 69727
#
# Started timers & final elapsed time
# Label Time
# run 6.512s
Sample output from a single test run:
# Total time: 46.21878452s
# Active time: 25.71878452s
# Puppet count: 2
# Puppet Total time Active time # messages
# server 58.721s 38.221s 100001
# peer 19.376s 876ms 55613
#
# Started timers & final elapsed time
# Label Time
# run 6.529s
Sample output from a single test run:
# Total time: 57.427148477s
# Active time: 26.927148477s
# Puppet count: 2
# Puppet Total time Active time # messages
# server 1m11.849s 41.349s 100002
# peer 20.62s 2.12s 38779
#
# Started timers & final elapsed time
# Label Time
# run 6.514s
The only changes to this script between runs are the start server go-sbot
and start peer go-sbot
commands; go-sbot
is substituted for ssb-server
or ssb-server-db1
when required.
comment [ six second sync two js db2 ssb servers 100k msgs ]
comment [ configuring peer ]
enter peer
hops peer 3
load peer @sWJqvI4hdv96aRMk1pQOJo1frXRFr7oBB5/r/jBMcxw=.ed25519
comment [ configuring server ]
enter server
hops server 3
load server @NZpjhmgTaHOHFZI6G6dIuWwa3UqwSpfRpMbY5ue6vAI=.ed25519
alloffsets server
start server ssb-server
start peer ssb-server
follow server peer
follow peer server
wait 10000
timerstart run
connect peer server
wait 6000
timerstop run
Sharing the report here for discussion before I make a PR with test scripts etc.
Netsim Replication Benchmarks
Full Sync Two SSB Nodes
All tests were run with the same fixtures consisting of 100,000 messages from 20 unique authors. Two identities were chosen: one is labelled as
server
and the other aspeer
. Theskipoffset peer
netsim command was used to ensure thepeer
starts with0
messages. Thepeer
is connected to theserver
and we time how long it takes forpeer
to replicate the full feed ofserver
(4219 messages). A mutual follow is established before connecting thepeer
to theserver
(hence the 4220 message count in the test output). Replication rate is calculated as the totalpeer
messages divided by therun
time.See the bottom of the page for the full test script.
Summary
JS - JS (db)
Replication rate (msgs / second): 1592
JS - JS (db2)
Replication rate (msgs / second): 583
Go - Go
Replication rate (msgs / second): 8291
Go - JS (db)
server
: go ...peer
: jsReplication rate (msgs / second): 1491
server
: js ...peer
: goReplication rate (msgs / second): 0.5
Go - JS (db2)
server
: go ...peer
: jsReplication rate (msgs / second): 1069
server
: js ...peer
: goReplication rate (msgs / second): 0
Test Script
The only changes to this script between runs are the
start server go-sbot
andstart peer go-sbot
commands;go-sbot
is substituted forssb-server
orssb-server-db1
when required.