Skip to content

Commit fbbdfd2

Browse files
authored
Adding some more context to docs (#15)
* Updating readme with a bit more info on how hperf works * Adding some more context to readme * updating readme based on suggestions and observations
1 parent d545155 commit fbbdfd2

File tree

1 file changed

+89
-34
lines changed

1 file changed

+89
-34
lines changed

README.md

Lines changed: 89 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,94 @@ hperf is a tool for active measurements of the maximum achievable bandwidth betw
66
Hperf was made to test networks in large infrastructure. It's highly scalable and cabaple of running parallel tests over
77
a long period of time.
88

9+
## Common use cases
10+
- Debugging link/nic MTU issues
11+
- Optimizing throughput speed for specific payload/buffer sizes
12+
- Finding servers that present latency on the application level when ping is showing no latency
13+
- Testing overall network throughput
14+
- Testing server to server connectivity
15+
16+
17+
## Core concepts
18+
### The hperf binary
19+
The binary can act as both client and server.
20+
21+
### Client
22+
The client part of hperf is responsible for orchestrating the servers. Its only job is to send commands to the
23+
servers and receive incremental stats updates. It can be executed from any machine that can talk to the servers.
24+
25+
### Servers
26+
Servers are the machines we are testing. To launch the hperf command in servers mode, simply use the `server` command:
27+
NOTE: `server` is the only command you can execute on the servers. All other commands are executed from the client.
28+
```bash
29+
$ ./hperf server --help
30+
```
31+
This command will start an API and websocket on the given `--address` and save test results to `--storage-path`.
32+
33+
WARNING: do not expose `--address` to the internet
34+
35+
### The listen command
36+
Hperf can run tests without a specific `client` needing to be constantly connected. Once the `client` has started a test, the `client` can
37+
easily exit without interrupting the test stopping.
38+
39+
Any `client` can hook into the list test at runtime using the `--id` of the test. There can even be multiple `clients`
40+
listening to the same test.
41+
42+
Example:
43+
```bash
44+
$ ./hperf listen --hosts 10.10.1.{2...10} --id [TEST_ID]
45+
```
46+
947
## Getting started
1048

1149
### Download
12-
[Download Binary Releases](https://github.com/minio/hperf/releases) for various platforms.
13-
14-
You can also install via source
50+
[Download Binary Releases](https://github.com/minio/hperf/releases) for various platforms and place in a directory of
51+
your choosing.
1552

53+
You can also install via source:
1654
```
1755
go install github.com/minio/hperf/cmd/hperf@latest
1856
```
1957

2058
### Server
21-
1. Download hperf and place it in a directory of your choosing
22-
- This can be automated with deployment tools, hperf is just a single binary
23-
24-
2. Run hperf help to see a list of available server commands flags and example
25-
59+
Run server with default settings:
60+
NOTE: this will place all test result files in the same directory.
2661
```bash
27-
$ ./hperf server --help
62+
$ ./hperf server
63+
```
64+
Run the server with custom `--address` and `--storage-path`
65+
```bash
66+
$ ./hperf server --address 10.10.2.10:5000 --storage-path /tmp/hperf/
2867
```
2968

30-
3. Run the server with your preferred settings
69+
### Client
70+
If the `server` command was executed with a custom `--address`, the port can be specified in the `client` using `--port`.
3171

32-
### Client
33-
1. Download hperf
72+
The `--hosts` and `--id` flags are especially important to understand.
3473

35-
2. Run hperf help to see available commands, flags and examples
36-
- The `--hosts` and `--id` flags are especially important to understand
74+
`--hosts` is where we determine which machines we will send the current command to. The hosts parameter supports
75+
the same ellipsis pattern as minio and also a comma separate list of hosts as well as a file: input. The file expects a
76+
host per file line.
3777

3878
```bash
39-
$ ./hperf --help
40-
$ ./hperf [command] --help
79+
./hperf [command] --hosts 1.1.1.1,2.2.2.2
80+
./hperf [command] --hosts 1.1.1.{1...100}
81+
./hperf [command] --hosts file:/home/user/hosts
4182
```
4283

43-
## Common use cases
44-
- Debugging link/nic MTU issues
45-
- Optimizing throughput speed for specific payload/buffer sizes
46-
- Finding servers that present latency on the application level when ping is showing no latency
47-
- Testing overall network throughput
48-
- Testing server to server reachability
84+
`--id` is used to start, stop, listen to tests, or get results.
85+
NOTE: Be careful not to re-use the ID's if you care about fetching results at a later date.
86+
87+
```bash
88+
# get test results
89+
./hperf get --hosts 1.1.1.{1...100} --id [my_test_id]
90+
91+
# listen in on a running test
92+
./hperf listen --hosts 1.1.1.{1...100} --id [my_test_id]
93+
94+
# stop a running test
95+
./hperf stop --hosts 1.1.1.{1...100} --id [my_test_id]
96+
```
4997

5098
## Available Statistics
5199
- Payload Roundtrip (PMS high/low):
@@ -65,17 +113,24 @@ $ ./hperf [command] --help
65113
- CPU (CPUUsed):
66114
- Total memory in use (total for all time)
67115

68-
## Example test output which uses all stat types
116+
## Example: 20 second HTTP payload transfer test using multiple sockets
117+
This test will use 12 concurrent workers to send http requests with a payload without any timeout between requests.
118+
Much like a bandwidth test, but it will also test server behaviour when multiple sockets are being created and closed:
119+
```
120+
$ ./hperf requests --hosts file:./hosts --id http-test-1 --duration 20 --concurrency 12
121+
```
122+
123+
## Example: 20 second HTTP payload transfer test using a stream
124+
This will perform a 20 second bandwidth test with 12 concurrent HTTP streams:
69125
```
70-
$ ./hperf requests --hosts 10.10.10.1,10.10.10.2 --id http-test-1 --duration 5 --concurrency 12
71-
72-
Created Local Remote PMSH PMSL TTFBH TTFBL TX #TX #ERR #Dropped MemUsed CPUUsed
73-
14:42:09 10.10.10.1 10.10.10.2 19 0 6 0 2.70 GB/s 5129 0 0 40 73
74-
14:42:09 10.10.10.2 10.10.10.1 18 0 7 0 2.70 GB/s 5111 0 0 40 63
75-
14:42:10 10.10.10.2 10.10.10.1 16 0 8 0 2.69 GB/s 7799 0 0 40 63
76-
14:42:10 10.10.10.1 10.10.10.2 17 0 6 0 2.73 GB/s 7862 0 0 40 73
77-
14:42:11 10.10.10.1 10.10.10.2 19 0 9 0 2.68 GB/s 10553 0 0 40 89
78-
14:42:11 10.10.10.2 10.10.10.1 20 0 6 0 2.67 GB/s 10472 0 0 40 88
79-
14:42:12 10.10.10.1 10.10.10.2 17 0 5 0 2.69 GB/s 13238 0 0 40 89
80-
14:42:12 10.10.10.2 10.10.10.1 17 0 7 0 2.69 GB/s 13175 0 0 40 88
126+
$ ./hperf bandwidth --hosts file:./hosts --id http-test-2 --duration 20 --concurrency 12
81127
```
128+
129+
## Example: 5 Minute latency test using a 2000 Byte buffer, with a delay of 50ms between requests
130+
This test will send a single round trip request between servers to test base latency and reachability:
131+
```
132+
$ ./hperf latency --hosts file:./hosts --id http-test-2 --duration 360 --concurrency 1 --requestDelay 50
133+
--bufferSize 2000 --payloadSize 2000
134+
```
135+
136+

0 commit comments

Comments
 (0)