feat: benchmark network traffic and database size#837
Conversation
83af348 to
150589b
Compare
e73c285 to
6766b6b
Compare
6766b6b to
41b827a
Compare
|
This is pretty much done, except:
@dhess: Could you look at the nix code with some suspicion? I think there are at least two bits that could probably be done better: using |
41b827a to
cb28cdb
Compare
|
I'll take a look, but FYI, I was able to refactor Note that there are subdirs full of test data in there, and so long as you're careful that the |
15829f3 to
84e5a17
Compare
|
Thanks, I've managed to re-organise so I can use |
9be5b4c to
7558d8b
Compare
cb28cdb to
08b82cf
Compare
9bf13e3 to
f535eac
Compare
These are added as setup for adding some openapi endpoints to primer-client.
This is more setup to add openapi endpoints to primer-client.
We add these as setup for a "replay fixture via the API" (as opposed to our previous "replay edit fixture via 'runEditAppM').
We now emit `RequestStart` log lines, to aid in extracting test/benchmark cases. When looking at the generated logs, note that: - log messages from multiple simultaneous interactions may be interleaved - we log some internal high-level requests, so one API request can generate many log lines. - each group is preceeded by a `RequestStart` line -- this shows where a new request was started, and the following messages will be various stages of handling it. - we will have at most one `Edit` per request, but it will probably be after some `ApplyAction*` and `GetProgram` lines, which correspond to the actual API request made by your frontend and an internal implemetation detail. - technically, there is no guarantee that the `RequestStart` line is actually consecutive with its generated logs, but it is normally the case for a single-user session.
'primer-replay' is a runner to replay a primer session via the API, intended for benchmarking network traffic and database size.
08b82cf to
6f18062
Compare
13b9c7e to
92dc51a
Compare
dhess
left a comment
There was a problem hiding this comment.
Let's move the new benchmark script to the same default.nix file as the others, but otherwise, this is really good stuff, and will be invaluable data. Thanks!
This will be needed for a nixos-test based network traffic benchmark, so we may as well use it instead of separate arguments for (e.g.) coreutils and jq.
92dc51a to
46381e4
Compare
|
Here's a thought, though out of scope for this PR: how hard would it be to collect GHC RTS stats from these runs; e.g., number of GCs? Those might be really interesting, as these replays are as close as we can currently get to real-world loads. |
|
Some future work is to add a fourth vm, a proxy. This would add compression, and bring this benchmark closer to the real-world. (Having both uncompressed and compressed stats would be useful, though perhaps they can be done in one benchmark, just by measuring either side of the proxy somehow (the current setup won't do that, as we only get tx/rx stats per interface; maybe setting up the proxy to have two interfaces: one for client, one for backend would work)). @dhess has indicated he'll look into this |
| , writeText | ||
| , coreutils | ||
| , jq | ||
| , pkgs |
There was a problem hiding this comment.
As an aside, I believe this is considered to be bad practice by the nixpkgs maintainers, as you will sometimes want to use a different pkgs for tests etc. than the one from which your specific tooling comes from (jq, coreutils, etc.), but I'm not bothered, so this is fine for our needs.
dhess
left a comment
There was a problem hiding this comment.
The changes are fine, though I would prefer not to have fixup! commits in our history.
Actually, I think it may be fairly straightforward. I'll have a look |
This uses the nixos-test framework, running a primer server, a postgresql server and a client in sepearate VMs.
46381e4 to
92e6826
Compare
See #889 |
See #890 |
This uses the nixos-test framework to run each component (database, primer, client) in a different vm and generates traffic by replaying sessions. We measure the network traffic and database size.