-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: add js-libp2p perf tests #244
Conversation
Great to see @maschad. Thank you for the work. Let me know once this is ready for a review. Also, in case you don't have permissions to trigger the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the work here. Once #249 is merged I can trigger the CI action.
@maschad please ping me once this is ready for another review. |
I triggered the https://github.com/libp2p/test-plans/actions/runs/5818528858/job/15775124342 @maschad do I understand correctly that the branch on |
Test run (see link above) failed with:
The
|
Thanks for running the CI @mxinden I don't have write access to the repo so this is the only branch I have been using i.e.
Thanks for helping me resolve this, was a file permissions issue, resolved via |
But you didn't push the change, right @maschad? |
Correct, I'm debugging another issue and then will push the changes. |
@mxinden I've run this locally and generated these benchmark results when you have a chance could you please trigger a CI run? Thanks. |
Once the CI run is successful and js-libp2p protocol perf 1.1.0 is merged and published I can follow up with PR that will make builds faster by running the perf package solely (as opposed to installing and building the entire monorepo). |
@mxinden I saw you pushed some changes, did you execute a perf run as well and is it approved for merge now? |
The NodeJS installation issue is resolved with #267. My bad for the broken #266.
I reverted your changes to the NodeJS installation instructions. They are no longer needed. NodeJS installation is now properly in place. See js-libp2p perf test being executed in https://github.com/libp2p/test-plans/actions/runs/5923420241/job/16060336976. Unfortunately perf runs are failing consistently, namely on The rust-libp2p server is unable to bind to the
and thus the Rust client fails to connect:
The problem is, that the previous js-libp2p NodeJS process is still running and binded to
@maschad could it be that the js-libp2p server is not reacting to |
That's correct. The I have modified the runner to kill the process running on port 4001 as an alternative, rather than writing the PID to a pidfile, then reading that PID and then killing it. I have ran this a few times on my machine successfully. |
Results of run: https://github.com/libp2p/test-plans/actions/runs/5932647404 |
This reverts commit 8e528c0.
Kills the node child process when the `perf` script is killed. Does not depend on specific ports. Keeps the idiosyncrasies of the script local to the script.
Is the ready for merge?
drive by comment here: why not get the PID of node process within the perf shell script itself? seems better than assuming that we have to kill the process listening on port 4001 - that could change in the future? |
I suggest containing the cleanup of the NodeJS process within the |
That was my original course of action but it's not an assumption since the port is set by the nohup command that runs the server and it's unlikely that would change. It's more efficient to kill the process running at the port since that was pre-determined to be the server and not another process, as opposed to writing it to a file and then reading that file, then deleting it.
I don't necessarily object but I would like to understand the preference for doing it that way. |
I spoke to @p-shahi on the maintainers call on 22-08-23 and he explained why that's his preference, I don't object to it so please feel free to go ahead and push that commit in order that this can be merged. |
Thanks @mxinden looks good. This is ready for merge from my end. |
To view the test results on the dashboard: https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=perf%2Fjs-libp2p#branch |
Latency median of 1s seems off. Is this expected @maschad? Maybe a unit conversion error? |
This has been what I have observed in my tests runs, on average I have seen latencies of I don't think it's a conversion error given we the conversion from milliseconds to seconds is correct. I've ran the perf package locally in two terminals over 100 iterations and averaged |
Adding @achingbrain and @MarcoPolo here for visibility. Summary: we are measuring a median of 1s when establishing a js-libp2p TCP+Plaintext+Yamux connection and sending an empty request and receive an empty response. For comparison, the median latency between the machines is 60ms and an https (TCP+TLS) request takes median 180ms (3 round-trips). See dashboard below for higher resolution. https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=perf%2Fjs-libp2p#branch Moving forward here anyways. In my eyes measuring in itself already provides value. Any related fixes can go into follow-up pull requests. |
Related libp2p/js-libp2p#1604