-
Notifications
You must be signed in to change notification settings - Fork 55
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
Sync server scalability for live collaboration #207
Comments
Thanks for the report, @mweidner037, this is really helpful. Your results seem vaguely plausible given the performance traces I've seen lately in the browser. (As an aside the Chrome Dev Tools have really excellent performance analysis tools.) We've been looking at similar problems and have a few patches in the work but getting independent performance testing is always very welcome! |
I've been looking into this - There are two issues related to marks causing you to call "server": {
"dependencies": {
- "@automerge/automerge": "2.1.2-alpha.0",
- "@automerge/automerge-repo": "1.0.2",
- "@automerge/automerge-repo-network-websocket": "1.0.2",
+ "@automerge/automerge": "2.1.5",
+ "@automerge/automerge-repo": "1.0.12",
+ "@automerge/automerge-repo-network-websocket": "1.0.12",
"@collabs/collabs": "0.13.4", |
Also I made an even more lightweight version of the |
Sure, I can change
I'll try this out when I can. Aside: When you are running locally, you can make it more stressful (as if there were more users) by increasing the rate of edits. Here is the relevant constant: https://github.com/composablesys/collabs-nsdi/blob/master/client/src/scenarios/all_active.ts#L16 Probably 30 edits/second (value 33 ms) with 3-4 users will make things interesting. Remote latency P95 should be the most sensitive indicator. |
Made a PR that adds a fast |
Something you could add to the benchmark that would be hugely valuable (and I was having trouble doing while reading your harness code) would be to have a server flamegraph added to the stats gathered maybe via the |
I updated the code to use (The updates are in a dev copy of the repo - I can invite you if you like.)
You should be able to change |
I've been running benchmarks for rich-text editors with live collaboration. Using automerge with a modified automerge-repo-sync-server, I noticed performance issues starting at ~4 simultaneous users.
In each benchmark, the users connect to the server using
BrowserWebSocketClientAdapter
, wait for the server to share the document, and then start typing at 6 chars/sec (plus occasional formatting ops). They also record "remote latency": the time from when one user types some text until it shows up for the other users.With 4 users, after about 90 sec of (continuous) typing, the server's CPU usage hits 100% and the remote latencies spike to ~20 seconds. With 8 users, the spike occurs within 30 seconds. I believe it depends on (# users) * (size of doc). Full time-series data: allActive-4-automergeRepo.csv, allActive-8-automergeRepo.csv
Variations:
Reproduce
More details about the benchmarks are in Section 7.1 of this preprint. Server code we're using is here, client code is here.
You can easily run the benchmarks locally, although the data above is from running it on AWS (with clients + server in different regions).
server/package.json
, update@automerge/...
dependencies to the latest versions. (The existing versions are what's used in the preprint.)npm ci && npm run build
cd client bash local_exp.sh ../data allActive 4 automergeRepo trial0
"4" is the number of users; replace "automergeRepo" with "automerge" to use the basic WebSocket echo server.
5. Analyze the data:
cd ../analysis npm start ../results ../data/allActive-004-automergeRepo/
CSVs will be in
results/
. There are also client CPU profiles but not server CPU profiles (sorry).Versions:
The text was updated successfully, but these errors were encountered: