HBONE connections benches#631
HBONE connections benches#631istio-testing merged 3 commits intoistio:masterfrom Stevenjin8:bench/hbone-connect
Conversation
|
Skipping CI for Draft Pull Request. |
|
/test all |
1 similar comment
|
/test all |
|
/retest |
|
/test all |
1 similar comment
|
/test all |
|
I have no idea how to fix the CI error The other benches do the by doing |
| echo_addr, | ||
| TEST_WORKLOAD_HBONE.parse().unwrap(), | ||
| )) | ||
| .socks5_connect( |
There was a problem hiding this comment.
This section is repeated often.
e.g.
let mut s =
e.ta.socks5_connect(helpers::with_ip(
e.echo_addr,
TEST_WORKLOAD_TCP.parse().unwrap(),
))
.await;
Wdyt about abstracting that logic into a helper function, maybe something called newTCPStream or similar. Have it maybe take in the TEST_WORKLOAD_<SOURCE/HBONE/TCP> string value as an argument. Would help to maintain that DRY principle while also making it convenient for the next person to extend this test with more benches?
There was a problem hiding this comment.
I'll think about this. The whole echo server setup is clever but also confusing. You can access the echo server through any ip address on lo, but if you want to use ztunnel/socks5, the address you pick to access the echo server needs to be a registered workload.
Point is, I feel like the way its abstracted right now is already confusing, so I didn't want to abstract it any further. I do think there is probably a better way to do this. My first idea it to make TEST_WORKLOAD_* actual IP address instead of a string that can be parsed into an ip address. Thoughts?
There was a problem hiding this comment.
The abstraction I refer to is to really help reduce the repetitive and confusing code in the tests. Using a helper function should actually make it more understandable.
|
|
|
| } | ||
|
|
||
| /// Iterate through possible IP pairs restricted to 0 < ip_pair.0 < ip_pair.1 <= MAX_HBONE_WORKLOADS. | ||
| fn next_ip_pair(ip_pair: (u8, u8)) -> (u8, u8) { |
There was a problem hiding this comment.
Note this is only n*(n-1)/2 combos. If we wanted more new HBONE connections from the same number of IPs this could be optimized.
benches/throughput.rs
Outdated
| let echo_addr = echo.address(); | ||
| let _ = tokio::spawn(async move { | ||
| let _ = tokio::join!(app.wait_termination(), echo.run()); | ||
| }); |
There was a problem hiding this comment.
Adding a .await here should fix the CI
There was a problem hiding this comment.
TODO: Drop works, but hoping that someone has a better solution than just orphaning the tasks.
Signed-off-by: Steven Jin Xuan <t-stjinxuan@microsoft.com>
Benchmarks how long it takes to establish a new HBONE connection.
Do this by creating
nworkloads giving usO(n^2)ways to create new HBONE connections. The actual limiting factor here is not the number of workload source/destination pairs, but the number of possible open file descriptions.This happens to me when I change the duration of the test from 5 to 10 seconds.
I confirmed this is creating new HBONE connections by running
tcpdumponloand seeing the number of TLS handshakes was more or less the same as the number of test iterations.resolves #623