Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
almost there

Removing binary from pr
  • Loading branch information
zveinn committed Aug 6, 2024
1 parent 1b40647 commit e81fd39
Show file tree
Hide file tree
Showing 37 changed files with 3,058 additions and 1,296 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
dist/
mperf
./nperf
hperf
./hperf
deploy.sh
hperf
27 changes: 0 additions & 27 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

================================================================

github.com/dustin/go-humanize
https://github.com/dustin/go-humanize
----------------------------------------------------------------
Copyright (c) 2005-2008 Dustin Sallings <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

<http://www.opensource.org/licenses/mit-license.php>

================================================================

github.com/google/uuid
https://github.com/google/uuid
----------------------------------------------------------------
Expand Down
109 changes: 54 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,69 @@

hperf is a tool for active measurements of the maximum achievable bandwidth between N peers, measuring RX/TX bandwidth for each peers.

## Download
## What is hperf for
Hperf was made to test networks in large infrastructure. It's highly scalable and cabaple of running parallel tests over
a long period of time.

[Download Binary Releases](https://github.com/minio/hperf/releases) for various platforms.

## Usecases
- Calculate baseline RX/TX
- Debug TOR Switch bottlenecks
- Calculate roundtrip MS for http requests
## Getting started

## Usage
Various configurations have been added for controling everything from payload size to http read/write buffers. All flags
can be seen via `-help`.
### Download
[Download Binary Releases](https://github.com/minio/hperf/releases) for various platforms.

Hperf can be used without any configuration, just run hperf on all the servers IP1 IP2 IP3 ... respectively.
### Server
1. Download hperf and place it in a directory of your choosing
- This can be automated with deployment tools, hperf is just a single binary
2. Run hperf help to see a list of available server commands flags and example
```bash
$ ./hperf server --help
```
./hperf -stream=false -hosts 10.10.1.{1...10}
┌────────────┬────────────┬───────┬──────────┬───────┬──────────┬─────────────────┬───────────────────┬──────┐
│ Local │ Remote │ #RX │ RX │ #TX │ TX │ TX(ms) high/low │ TTFB(ms) high/low │ #Err │
├────────────┼────────────┼───────┼──────────┼───────┼──────────┼─────────────────┼───────────────────┼──────┤
│ 10.10.10.1 │ 10.10.10.6 │ 14927 │ 1.3 GB/s │ 10681 │ 1.2 GB/s │ 312 / 2 │ 13 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.2 │ 10880 │ 1.3 GB/s │ 18187 │ 1.2 GB/s │ 260 / 2 │ 13 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.3 │ 16804 │ 1.3 GB/s │ 17141 │ 1.2 GB/s │ 299 / 2 │ 13 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.4 │ 18670 │ 1.4 GB/s │ 18920 │ 1.3 GB/s │ 321 / 2 │ 10 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.5 │ 30070 │ 1.2 GB/s │ 29626 │ 1.3 GB/s │ 636 / 2 │ 10 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.7 │ 24031 │ 1.3 GB/s │ 27004 │ 1.3 GB/s │ 600 / 2 │ 16 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.8 │ 20844 │ 1.2 GB/s │ 21870 │ 1.2 GB/s │ 297 / 1 │ 13 / 0 │ 0 │
└────────────┴────────────┴───────┴──────────┴───────┴──────────┴─────────────────┴───────────────────┴──────┘
```

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`
3. Run the server with your preferred settings

```
./hperf -port MYPORT -stream=false -hosts 10.10.1.{1...10}
┌────────────┬────────────┬───────┬──────────┬───────┬──────────┬─────────────────┬───────────────────┬──────┐
│ Local │ Remote │ #RX │ RX │ #TX │ TX │ TX(ms) high/low │ TTFB(ms) high/low │ #Err │
├────────────┼────────────┼───────┼──────────┼───────┼──────────┼─────────────────┼───────────────────┼──────┤
│ 10.10.10.1 │ 10.10.10.6 │ 14927 │ 1.3 GB/s │ 10681 │ 1.2 GB/s │ 312 / 2 │ 13 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.2 │ 10880 │ 1.3 GB/s │ 18187 │ 1.2 GB/s │ 260 / 2 │ 13 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.3 │ 16804 │ 1.3 GB/s │ 17141 │ 1.2 GB/s │ 299 / 2 │ 13 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.4 │ 18670 │ 1.4 GB/s │ 18920 │ 1.3 GB/s │ 321 / 2 │ 10 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.5 │ 30070 │ 1.2 GB/s │ 29626 │ 1.3 GB/s │ 636 / 2 │ 10 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.7 │ 24031 │ 1.3 GB/s │ 27004 │ 1.3 GB/s │ 600 / 2 │ 16 / 0 │ 0 │
│ 10.10.10.1 │ 10.10.10.8 │ 20844 │ 1.2 GB/s │ 21870 │ 1.2 GB/s │ 297 / 1 │ 13 / 0 │ 0 │
└────────────┴────────────┴───────┴──────────┴───────┴──────────┴─────────────────┴───────────────────┴──────┘
### Client
1. Download hperf
2. Run hperf help to see available commands, flags and examples
- The `--hosts` and `--id` flags are especially important to understand
```bash
$ ./hperf --help
$ ./hperf [command] --help
```

## On k8s
## Common use cases
- Debugging link/nic MTU issues
- Optimizing throughput speed for specific payload/buffer sizes
- Finding servers that present latency on the application level when ping is showing no latency
- Testing overall network throughput
- Testing server to server reachability

### Using helm
```
helm install https://github.com/minio/hperf/raw/main/helm-releases/hperf-v4.0.0.tgz --generate-name --namespace <my-namespace>
```

### Using `yaml`
## Available Statistics
- Payload Roundtrip (PMS high/low):
- Payload transfer time (Milliseconds)
- Time to first byte (TTFB high/low):
- This is the amount of time (Milliseconds) it takes between a request being made and the first byte being requested by the receiver
- Transferred bytes (TX):
- Bandwidth throughput in KB/s, MB/s, GB/s, etc..
- Request count (#TX):
- The number of HTTP/s requests made
- Error Count (#ERR):
- Number of encountered errors
- Dropped Packets (#Dropped):
- Total dropped packets on the server (total for all time)
- Memory (MemUsed):
- Total memory in use (total for all time)
- CPU (CPUUsed):
- Total memory in use (total for all time)

## Example test output which uses all stat types
```
export NAMESPACE=<my-namespace>
kubectl apply -f https://github.com/minio/hperf/raw/main/hperf.yaml --namespace $NAMESPACE
```
$ ./hperf requests --hosts 10.10.10.1,10.10.10.2 --id http-test-1 --duration 5 --concurrency 12
### Observe the output
```
kubectl logs --namespace <my-namespace> --max-log-requests <replica-count> -l "app=hperf" -f
Created Local Remote PMSH PMSL TTFBH TTFBL TX #TX #ERR #Dropped MemUsed CPUUsed
14:42:09 10.10.10.1 10.10.10.2 19 0 6 0 2.70 GB/s 5129 0 0 40 73
14:42:09 10.10.10.2 10.10.10.1 18 0 7 0 2.70 GB/s 5111 0 0 40 63
14:42:10 10.10.10.2 10.10.10.1 16 0 8 0 2.69 GB/s 7799 0 0 40 63
14:42:10 10.10.10.1 10.10.10.2 17 0 6 0 2.73 GB/s 7862 0 0 40 73
14:42:11 10.10.10.1 10.10.10.2 19 0 9 0 2.68 GB/s 10553 0 0 40 89
14:42:11 10.10.10.2 10.10.10.1 20 0 6 0 2.67 GB/s 10472 0 0 40 88
14:42:12 10.10.10.1 10.10.10.2 17 0 5 0 2.69 GB/s 13238 0 0 40 89
14:42:12 10.10.10.2 10.10.10.1 17 0 7 0 2.69 GB/s 13175 0 0 40 88
```

### LICENSE
Use of `hperf` tool is governed by the GNU AGPLv3 license that can be found in the [LICENSE](./LICENSE) file.
Loading

0 comments on commit e81fd39

Please sign in to comment.