Skip to content

Commit 1b40647

Browse files
authored
Adding: latency test, more control, more stats, etc.. (#9)
1 parent 5271587 commit 1b40647

File tree

10 files changed

+747
-126
lines changed

10 files changed

+747
-126
lines changed

.github/workflows/vulncheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
go-version: [ 1.21.9, 1.22.2 ]
17+
go-version: [ 1.22.5 ]
1818
steps:
1919
- name: Check out code into the Go module directory
2020
uses: actions/checkout@v3

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
dist/
22
mperf
3+
./nperf
34
hperf
4-
nperf
5+
./hperf
6+
deploy.sh

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM scratch
22
MAINTAINER MinIO Development "[email protected]"
33

44
EXPOSE 9999
5-
EXPOSE 10000
65

76
COPY ./hperf /hperf
87

README.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,43 @@ hperf is a tool for active measurements of the maximum achievable bandwidth betw
99
## Usecases
1010
- Calculate baseline RX/TX
1111
- Debug TOR Switch bottlenecks
12+
- Calculate roundtrip MS for http requests
1213

1314
## Usage
15+
Various configurations have been added for controling everything from payload size to http read/write buffers. All flags
16+
can be seen via `-help`.
17+
18+
Hperf can be used without any configuration, just run hperf on all the servers IP1 IP2 IP3 ... respectively.
1419
```
15-
./hperf IP1 IP2 IP3 ...
16-
...
17-
Bandwidth: 1.2 GB/s RX | 1.0 GB/s TX
18-
Bandwidth: 1.2 GB/s RX | 1.1 GB/s TX
19-
Bandwidth: 1.2 GB/s RX | 990 MB/s TX
20-
Bandwidth: 1.2 GB/s RX | 944 MB/s TX
20+
./hperf -stream=false -hosts 10.10.1.{1...10}
21+
┌────────────┬────────────┬───────┬──────────┬───────┬──────────┬─────────────────┬───────────────────┬──────┐
22+
│ Local │ Remote │ #RX │ RX │ #TX │ TX │ TX(ms) high/low │ TTFB(ms) high/low │ #Err │
23+
├────────────┼────────────┼───────┼──────────┼───────┼──────────┼─────────────────┼───────────────────┼──────┤
24+
│ 10.10.10.1 │ 10.10.10.6 │ 14927 │ 1.3 GB/s │ 10681 │ 1.2 GB/s │ 312 / 2 │ 13 / 0 │ 0 │
25+
│ 10.10.10.1 │ 10.10.10.2 │ 10880 │ 1.3 GB/s │ 18187 │ 1.2 GB/s │ 260 / 2 │ 13 / 0 │ 0 │
26+
│ 10.10.10.1 │ 10.10.10.3 │ 16804 │ 1.3 GB/s │ 17141 │ 1.2 GB/s │ 299 / 2 │ 13 / 0 │ 0 │
27+
│ 10.10.10.1 │ 10.10.10.4 │ 18670 │ 1.4 GB/s │ 18920 │ 1.3 GB/s │ 321 / 2 │ 10 / 0 │ 0 │
28+
│ 10.10.10.1 │ 10.10.10.5 │ 30070 │ 1.2 GB/s │ 29626 │ 1.3 GB/s │ 636 / 2 │ 10 / 0 │ 0 │
29+
│ 10.10.10.1 │ 10.10.10.7 │ 24031 │ 1.3 GB/s │ 27004 │ 1.3 GB/s │ 600 / 2 │ 16 / 0 │ 0 │
30+
│ 10.10.10.1 │ 10.10.10.8 │ 20844 │ 1.2 GB/s │ 21870 │ 1.2 GB/s │ 297 / 1 │ 13 / 0 │ 0 │
31+
└────────────┴────────────┴───────┴──────────┴───────┴──────────┴─────────────────┴───────────────────┴──────┘
2132
```
2233

23-
on all the servers IP1 IP2 IP3 ... respectively.
24-
25-
Default ports are `9999` and `10000` make sure your firewalls allow these ports. You may optionally configure `./hperf` to use custom ports as well, for example setting port `5001` would require opening up port `5002` as well.
26-
34+
Default ports are `9999` make sure your firewalls allow this port. You may optionally configure `./hperf` to use a custom port as well `-port MYPORT`
2735

2836
```
29-
NPERF_PORT=5001 ./hperf IP1 IP2 IP3 ...
37+
./hperf -port MYPORT -stream=false -hosts 10.10.1.{1...10}
38+
┌────────────┬────────────┬───────┬──────────┬───────┬──────────┬─────────────────┬───────────────────┬──────┐
39+
│ Local │ Remote │ #RX │ RX │ #TX │ TX │ TX(ms) high/low │ TTFB(ms) high/low │ #Err │
40+
├────────────┼────────────┼───────┼──────────┼───────┼──────────┼─────────────────┼───────────────────┼──────┤
41+
│ 10.10.10.1 │ 10.10.10.6 │ 14927 │ 1.3 GB/s │ 10681 │ 1.2 GB/s │ 312 / 2 │ 13 / 0 │ 0 │
42+
│ 10.10.10.1 │ 10.10.10.2 │ 10880 │ 1.3 GB/s │ 18187 │ 1.2 GB/s │ 260 / 2 │ 13 / 0 │ 0 │
43+
│ 10.10.10.1 │ 10.10.10.3 │ 16804 │ 1.3 GB/s │ 17141 │ 1.2 GB/s │ 299 / 2 │ 13 / 0 │ 0 │
44+
│ 10.10.10.1 │ 10.10.10.4 │ 18670 │ 1.4 GB/s │ 18920 │ 1.3 GB/s │ 321 / 2 │ 10 / 0 │ 0 │
45+
│ 10.10.10.1 │ 10.10.10.5 │ 30070 │ 1.2 GB/s │ 29626 │ 1.3 GB/s │ 636 / 2 │ 10 / 0 │ 0 │
46+
│ 10.10.10.1 │ 10.10.10.7 │ 24031 │ 1.3 GB/s │ 27004 │ 1.3 GB/s │ 600 / 2 │ 16 / 0 │ 0 │
47+
│ 10.10.10.1 │ 10.10.10.8 │ 20844 │ 1.2 GB/s │ 21870 │ 1.2 GB/s │ 297 / 1 │ 13 / 0 │ 0 │
48+
└────────────┴────────────┴───────┴──────────┴───────┴──────────┴─────────────────┴───────────────────┴──────┘
3049
```
3150

3251
## On k8s

go.mod

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
module github.com/minio/hperf
22

3-
go 1.19
3+
go 1.22
44

55
require (
6+
github.com/charmbracelet/lipgloss v0.11.1
67
github.com/dustin/go-humanize v1.0.1
7-
github.com/google/uuid v1.4.0
8-
golang.org/x/sys v0.19.0
8+
github.com/minio/pkg/v3 v3.0.7
9+
golang.org/x/sys v0.22.0
10+
)
11+
12+
require (
13+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
14+
github.com/charmbracelet/x/ansi v0.1.3 // indirect
15+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
16+
github.com/mattn/go-isatty v0.0.20 // indirect
17+
github.com/mattn/go-runewidth v0.0.15 // indirect
18+
github.com/muesli/termenv v0.15.2 // indirect
19+
github.com/rivo/uniseg v0.4.7 // indirect
920
)

go.sum

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
2+
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
3+
github.com/charmbracelet/lipgloss v0.11.1 h1:a8KgVPHa7kOoP95vm2tQQrjD2AKhbWmfr4uJ2RW6kNk=
4+
github.com/charmbracelet/lipgloss v0.11.1/go.mod h1:beLlcmkF7MWA+5UrKKIRo/VJ21xGXr7YJ9miWfdMRIU=
5+
github.com/charmbracelet/x/ansi v0.1.3 h1:RBh/eleNWML5R524mjUF0yVRePTwqN9tPtV+DPgO5Lw=
6+
github.com/charmbracelet/x/ansi v0.1.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
17
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
28
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
3-
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
4-
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
5-
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
6-
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
9+
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
10+
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
11+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
12+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
13+
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
14+
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
15+
github.com/minio/pkg/v3 v3.0.7 h1:1I2CbFKO+brioB6Pbnw0jLlFxo+YPy6hCTTXTSitgI8=
16+
github.com/minio/pkg/v3 v3.0.7/go.mod h1:njlf539caYrgXqn/CXewqvkqBIMDTQo9oBBEL34LzY0=
17+
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
18+
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
19+
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
20+
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
21+
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
22+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
23+
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
24+
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

helm/hperf/templates/service.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ spec:
1010
ports:
1111
- port: 9999
1212
name: http1
13-
- port: 10000
14-
name: http2
1513
selector:
1614
app: hperf

helm/hperf/templates/statefulset.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ spec:
3838
ports:
3939
- name: http1
4040
containerPort: 9999
41-
- name: http2
42-
containerPort: 10000
4341
{{- with .Values.nodeSelector }}
4442
nodeSelector:
4543
{{- toYaml . | nindent 8 }}

hperf.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ spec:
1111
ports:
1212
- port: 9999
1313
name: http1
14-
- port: 10000
15-
name: http2
1614
selector:
1715
app: hperf
1816
---
@@ -59,5 +57,3 @@ spec:
5957
ports:
6058
- name: http1
6159
containerPort: 9999
62-
- name: http2
63-
containerPort: 10000

0 commit comments

Comments
 (0)