-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network Backend: libp2p is faster than litep2p #7183
Comments
@lexnv is this a blocker for litep2p deployment ? |
@AndreiEres can we re-run one of these benchmarks (perhaps the 64k and 256k ones) and measure:
|
Gathering more data from our Kusama Validators to see how this stacks in production Libp2p DataData obtained from one single kusama validator running libp2p: Have asked devops to reboot this node with Grafana Link: https://grafana.teleport.parity.io/goto/aKLWk8DNg?orgId=1 |
@lexnv @dmitry-markin |
@sandreim Avg throughput per second (higher is better)
Avg time per message (lower is better)
Raw data from benchmarks1k messages notifications_protocol/libp2p/with_backpressure/64KB: 44421256 ns/iter (+/- 309026) notifications_protocol/libp2p/with_backpressure/256KB: 359526580 ns/iter (+/- 2611825) notifications_protocol/litep2p/with_backpressure/64KB: 46879477 ns/iter (+/- 327248) notifications_protocol/litep2p/with_backpressure/256KB: 413041795 ns/iter (+/- 4181491) 5k messages notifications_protocol/libp2p/with_backpressure/64KB: 220405786 ns/iter (+/- 1849544) notifications_protocol/libp2p/with_backpressure/256KB: 1814364552 ns/iter (+/- 18384018) notifications_protocol/litep2p/with_backpressure/64KB: 247287037 ns/iter (+/- 8365376) notifications_protocol/litep2p/with_backpressure/256KB: 2008662039 ns/iter (+/- 78304950) 10k messages notifications_protocol/libp2p/with_backpressure/64KB: 443843240 ns/iter (+/- 1671193) notifications_protocol/libp2p/with_backpressure/256KB: 3564711134 ns/iter (+/- 18137773) notifications_protocol/litep2p/with_backpressure/64KB: 485836412 ns/iter (+/- 4307439) notifications_protocol/litep2p/with_backpressure/256KB: 3834542336 ns/iter (+/- 316935009) |
Thanks @AndreiEres . Looks like libp2p is roughly 10% faster. I would not consider this a blocker since the difference is not that much and we still reap the benefits of lower CPU usage. @lexnv WDYT ? |
The data looks good! Thanks @AndreiEres ! 🙏 Indeed, I don't consider this a major blocker, especially since we're only about 10% behind libp2p. Attaching one more data point, from around ~15:25 UTC the validator was restarted with litep2p. Overall, litep2p handled 13-21% more inbound notifications (1927 litep2p vs. 1588 libp2p), while libp2p managed about 15% more outbound notifications (1228 litep2p vs. 1430 libp2p). We should also factor in the randomness of the network when interpreting these results. |
Coming back with more data, the litep2p yamux component was updated to filter out any incompatibilities between libp2p and litep2p. The update brings significant improvements in upstream benchmarks (libp2p realm). I've only tested this with 1K message and would love to run some more tests: Before
After
Interpreting Data
|
The litep2p v0.9.1 release delivers major performance upgrades for notification protocols! Our benchmarks show a ~40% improvement in submission times for 2MiB and 16MiB notifications. With these optimizations, litep2p now outperforms libp2p on the notification protocol as well. The change can be observed since the 42e9de7: Thanks again @AndreiEres and @sandreim for allocating resources and helping us with the benchmark setup! We have a straight-forward setup to further fine-tune our performance! 🙏 Optimization ImpactNext StepsWe plan to optimize the substreams even further, immediately after the Polakdot stabilization: I expect the paritytech/litep2p#341 to be a bit involved, however a low hanging fruit may be fine tuning the backpressure parameters. This will give us a slight advantage, since the benchmarks show that the litep2p notification backpressure kicks in a bit later for litep2p for smaller packet sizes (ie notifications smaller than 64k). Overview |
Was it adaptive yamux window size that resulted in this performance gain? |
Definitely I think the auto-tuning window sizing brought in some performance improvements. There might have been other smaller fixes that influenced the perf (like not signaling wakers properly, the backpressure bug on |
Recently, we began running benchmarks to compare the libp2p and litep2p implementations of NetworkBackend. We tested both implementations in two modes:
The second mode is intended to demonstrate usage that closely resembles reality.
According to initial results from the notifications protocol, litep2p is faster with serial work, while libp2p performs better with backpressure. This means that either our benchmarks are incorrect or we can slow down gossiping after switching nodes to litep2p.
Benchmarks:
Charts:
@paritytech/networking
The text was updated successfully, but these errors were encountered: