[bisq-network/projects] Migrate to Tor v3 onion service protocol (#23)

Florian Reimair notifications at github.com
Tue Mar 31 10:12:01 UTC 2020


# Performance eval
**TL;DR** hidden service publishing time has dropped from around 33 seconds to <5 seconds, no significant changes otherwise

- 2 evaluations
  - use the monitor for "isolated" Tor measurements
  - Integration tests: start Bisq app to confirm findings

_Recent changes to Bisq had an impact on the startup times already, so I decided to get the baseline manually instead of relying on the [monitor](https://monitor.bisq.network/d/F4uDCR8mk/tor-metrics)._
## Isolated Tor measurements
- to get an idea of what we can expect
### Setup
- single PC, Arch linux, Kernel 5.5.13, Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz, Samsung_SSD_970_EVO via M.2 interface
- devices under test (DUTs)
  - bisq-monitor with HSv2: compiled from v1.2.9 tag
  - bisq-monitor with HSv3: compiled from v1.2.9+https://github.com/bisq-network/bisq/pull/4028
- DUTs have been copied to their own workspaces for isolation purposes
- metrics
  - tor startup time: time until `Tor.getDefault()` returns, includes installing tor to disk and starting it up
  - hidden service startup time: time between telling tor to publish a hidden service until the service has been confirmed by the tor network (in detail, time until the first tor relay announces that it added the hidden service to its "DNS" entries)
  - RTT
    - use a started tor to query an hidden service; ie. v3 onion address of whonix.org
    - 5 measurements each, calculate average, min, max, p25, p50, p75
- test runs alternate between v2 and v3
### Results
- hidden service publishing times dropped from around 33 seconds to < 5 seconds
- no significant difference in Tor startup times
- no significant difference in RTT
<details>

![Screenshot from 2020-03-30 21-38-46](https://user-images.githubusercontent.com/1070734/78010136-4f147d00-7342-11ea-825f-3c2a4940fc57.png)
![Screenshot from 2020-03-30 21-41-08](https://user-images.githubusercontent.com/1070734/78010143-52a80400-7342-11ea-8099-c03c5fd92070.png)
![Screenshot from 2020-03-30 21-39-54](https://user-images.githubusercontent.com/1070734/78010183-5dfb2f80-7342-11ea-98b1-61388d628c3c.png)
[raw data](https://github.com/bisq-network/projects/files/4407973/tor-only-results.zip)

</details>

## Integration Tests
- to see if the results of the previous evaluation holds for the real thing.
- please note, measuring the startup-time of the Bisq app until ready is tricky
  - lots of external factors (seed node availability, age of local database, request size...)
  - no definite point of "bisq has started"
- hence, only limit measurements to the stuff we changed
### Setup
- single PC, Arch linux, Kernel 5.5.13, Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz, Samsung_SSD_970_EVO via M.2 interface
- devices under test (DUTs)
  - bisq-desktop with HSv2: compiled from v1.2.9 tag
  - bisq-desktop with HSv3: compiled from v1.2.9+https://github.com/bisq-network/bisq/pull/4028
- DUTs have been copied to their own workspaces for isolation purposes
- test run script pseudocode
  - clean tor hidden service directory
  - fire up bisq-desktop
  - terminate it after 60 seconds
  - wait for ~10minutes
  - repeat
- metrics
  - tor startup time: extract from bisq.log.
  - hidden service startup time: extract from bisq.log.
```
################################################################
Tor started after 7182 ms. Start publishing hidden service.
################################################################
```
```
################################################################
Tor hidden service published after 1832 ms. Socked=HiddenServiceSocket[addr=kzafzl4nu5kb5vj6tn4esthv5hnnflo6kw6utnsq5hfdjfsmatbhacad.onion,port=9999]
################################################################ 
```
- run script for each DUT at the same time, over a couple of hours
### Results
- hidden service publishing times dropped from around 33 seconds to < 5 seconds
- no significant difference in Tor startup times

<details>

![Screenshot from 2020-03-31 11-08-40](https://user-images.githubusercontent.com/1070734/78014210-e5976d00-7347-11ea-9781-fe562ac4f831.png)
![Screenshot from 2020-03-31 11-09-21](https://user-images.githubusercontent.com/1070734/78014222-e92af400-7347-11ea-9d47-cb11e2040f65.png)
[raw data](https://github.com/bisq-network/projects/files/4408264/bisq-results.zip)

</details>






-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/projects/issues/23#issuecomment-606529873
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200331/cc92dca9/attachment-0001.html>


More information about the bisq-github mailing list