-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aca354f
commit 43e92ce
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Performance Monitor Package | ||
|
||
### Overview | ||
|
||
The `perf` package is a performance monitor in `zos` nodes. it schedules tasks, cache their results and allows retrieval of these results through `RMB` calls. | ||
|
||
### Flow | ||
|
||
1. The `perf` monitor is started by the `noded` service in zos. | ||
2. Tasks are registered with a schedule in the new monitor. | ||
3. A bus handler is opened to allow result retrieval. | ||
|
||
### Node Initialization check | ||
|
||
To ensure that the node always has a test result available, a check is performed on node startup for all the registered tasks, if a task doesn't have any stored result, it will run immediately without waiting for the next scheduled time. | ||
|
||
### Scheduling | ||
|
||
Tasks are scheduled using a 6 fields cron format. this format provides flexibility to define time, allowing running tasks periodically or at specific time. | ||
|
||
### RMB commands | ||
|
||
- `zos.perf.get`: | ||
Payload: string representing the task name. | ||
Return: a single task result. | ||
Possible Error: `ErrResultNotFound` if no result is stored for the given task. | ||
|
||
- `zos.perf.get_all`: | ||
Return: all stored results | ||
|
||
### Caching | ||
|
||
Results are stored in a Redis server running on the node. | ||
|
||
The key in redis is the name of the task prefixed with the word `perf`. | ||
The value is an instance of `TaskResult` struct contains: | ||
|
||
- Name of the task | ||
- Timestamp when the task was run | ||
- The actual returned result from the task | ||
|
||
Notes: | ||
|
||
- Storing results by a key ensures each new result overrides the old one, so there is always a single result for each task. | ||
- Storing results prefixed with `perf` eases retrieving all the results stored by this module. | ||
|
||
### Registered tests | ||
- [Public IP validation](./publicips.md) | ||
- [CPU benchmark](./cpubench.md) | ||
- [IPerf](./iperf.md) | ||
- To add new task, [check](../../pkg/perf/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# CPUBenchmark | ||
|
||
### Overview | ||
|
||
The `CPUBenchmark` task is designed to measure the performance of the CPU. it utilizes the [cpu-benchmark-simple](https://github.com/threefoldtech/cpu-benchmark-simple) tool and includes a zos stub to gather the number of workloads running on the node. | ||
|
||
### Configuration | ||
|
||
- Name: `CPUBenchmark` | ||
- Schedule: 4 times a day | ||
|
||
### Details | ||
|
||
- The benchmark simply runs a `CRC64` computation task, calculates the time spent in the computation and reports it in `seconds`. | ||
- The computation is performed in both single-threaded and multi-threaded scenarios. | ||
- Lower time = better performance: for a single threaded benchmark, a lower execution time indicates better performance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# IPerf | ||
|
||
### Overview | ||
|
||
The `iperf` package is designed to facilitate network performance testing using the `iperf3` tool. with both UDP and TCP over IPv4 and IPv6. | ||
|
||
### Configuration | ||
|
||
- Name: iperf | ||
- Schedule: 4 times a day | ||
|
||
### Details | ||
|
||
- The package using the iperf binary to examine network performance under different conditions. | ||
- It randomly fetch PublicConfig data for randomly public nodes on the chain + all public node from free farm. These nodes serves as the targets for the iperf tests. | ||
- For each node, it run the test with 4 times. through (UDP/TCP) using both node IPs (v4/v6) | ||
- result will be a slice of the 4 report each one will include: | ||
``` | ||
UploadSpeed: Upload speed in bits per second. | ||
DownloadSpeed: Download speed in bits per second. | ||
NodeID: ID of the node where the test was conducted. | ||
NodeIpv4: IPv4 address of the node. | ||
TestType: Type of the test (TCP or UDP). | ||
Error: Any error encountered during the test. | ||
CpuReport: CPU utilization report. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters