Skip to content

Commit

Permalink
DAOS-16304 tools: Adjust default RPC size for net-test (#15091)
Browse files Browse the repository at this point in the history
The previous default of 1MiB isn't helpful at large scales.
Use a default of 1KiB to get faster results and a better
balance between raw latency and bandwidth.

Also include calculated rpc throughput and bandwidth in
JSON output.

Signed-off-by: Michael MacDonald <[email protected]>
  • Loading branch information
mjmac authored Sep 9, 2024
1 parent b95ef01 commit 8e20e80
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
5 changes: 2 additions & 3 deletions src/control/cmd/daos/pretty/selftest.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ func PrintSelfTestResult(out io.Writer, result *daos.SelfTestResult, verbose, sh
return errors.Errorf("nil %T", result)
}

rpcThroughput := float64(result.MasterLatency.Succeeded()) / result.Duration.Seconds()

rpcThroughput := result.RPCThroughput()
epRanks := ranklist.NewRankSet()
epTgts := hostlist.NewNumericSet()
for _, ep := range result.TargetEndpoints {
Expand All @@ -73,7 +72,7 @@ func PrintSelfTestResult(out io.Writer, result *daos.SelfTestResult, verbose, sh
}
if result.SendSize > 0 || result.ReplySize > 0 {
suffix := "B/s"
bw := rpcThroughput * (float64(result.SendSize) + float64(result.ReplySize))
bw := result.RPCBandwidth()
if !showBytes {
bw *= 8
suffix = "bps"
Expand Down
18 changes: 10 additions & 8 deletions src/control/cmd/daos/pretty/selftest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func TestPretty_PrintSelfTestConfig(t *testing.T) {
Client/Server Network Test Parameters
-------------------------------------
Servers : All
Send RPC Size : 1.00 MiB
Reply RPC Size : 1.00 MiB
Send RPC Size : 1.00 KiB
Reply RPC Size : 1.00 KiB
RPCs Per Server: 10000
`,
Expand All @@ -56,8 +56,8 @@ Client/Server Network Test Parameters
Client/Server Network Test Parameters
-------------------------------------
Server : 1
Send RPC Size : 1.00 MiB
Reply RPC Size : 1.00 MiB
Send RPC Size : 1.00 KiB
Reply RPC Size : 1.00 KiB
RPCs Per Server: 10000
`,
Expand Down Expand Up @@ -85,8 +85,8 @@ Client/Server Network Test Parameters
Client/Server Network Test Parameters
-------------------------------------
Servers : All
Send RPC Size : 1.00 MiB
Reply RPC Size : 1.00 MiB
Send RPC Size : 1.00 KiB
Reply RPC Size : 1.00 KiB
RPCs Per Server : 10000
System Name : daos_server
Tag : 0
Expand Down Expand Up @@ -143,8 +143,8 @@ Client/Server Network Test Parameters
Client/Server Network Test Parameters
-------------------------------------
Servers : All
Send RPC Size : 1.00 MiB
Reply RPC Size : 1.00 MiB
Send RPC Size : 1.00 KiB
Reply RPC Size : 1.00 KiB
RPCs Per Server : 10000
System Name : daos_server
Tags : ERROR (0 tags)
Expand All @@ -169,6 +169,8 @@ Client/Server Network Test Parameters
func genResult(xfrm func(result *daos.SelfTestResult)) *daos.SelfTestResult {
cfg := &daos.SelfTestConfig{}
cfg.SetDefaults()
cfg.SendSizes = []uint64{1 << 20}
cfg.ReplySizes = cfg.SendSizes
result := &daos.SelfTestResult{
MasterEndpoint: daos.SelfTestEndpoint{Rank: 3, Tag: 0},
TargetEndpoints: []daos.SelfTestEndpoint{
Expand Down
17 changes: 16 additions & 1 deletion src/control/lib/daos/selftest.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type (
var defaultLatencyPercentiles []uint64 = []uint64{50, 75, 90, 95, 99}

const (
defaultSendSize = 1 << 20 // 1MiB
defaultSendSize = 1 << 10 // 1KiB
defaultReplySize = defaultSendSize
defaultRepCount = 10000
defaultMaxInflight = 16
Expand Down Expand Up @@ -297,6 +297,8 @@ func (str *SelfTestResult) MarshalJSON() ([]byte, error) {
MasterEndpoint string `json:"master_endpoint"`
TargetEndpoints []string `json:"target_endpoints"`
EndpointLatencies map[string]*EndpointLatency `json:"target_latencies,omitempty"`
RPCThroughput float64 `json:"rpc_count_per_second"`
RPCBandwidth float64 `json:"rpc_bytes_per_second"`
*toJSON
}{
MasterEndpoint: str.MasterEndpoint.String(),
Expand All @@ -308,6 +310,8 @@ func (str *SelfTestResult) MarshalJSON() ([]byte, error) {
return eps
}(),
EndpointLatencies: epLatencies,
RPCThroughput: str.RPCThroughput(),
RPCBandwidth: str.RPCBandwidth(),
toJSON: (*toJSON)(str),
})
}
Expand Down Expand Up @@ -352,3 +356,14 @@ func (str *SelfTestResult) TargetRanks() (ranks []ranklist.Rank) {
}
return
}

// RPCThroughput calculates the number of RPCs per second.
func (str *SelfTestResult) RPCThroughput() float64 {
return float64(str.MasterLatency.Succeeded()) / str.Duration.Seconds()
}

// RPCBandwidth calculates the bytes per second value based on the number of
// RPCs sent for the duration of the test.
func (str *SelfTestResult) RPCBandwidth() float64 {
return str.RPCThroughput() * (float64(str.SendSize) + float64(str.ReplySize))
}
2 changes: 2 additions & 0 deletions src/control/lib/daos/selftest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ func TestDaos_SelfTestResult_MarshalJSON(t *testing.T) {
"fail_count": 0
}
},
"rpc_count_per_second": 1500,
"rpc_bytes_per_second": 3072000,
"repetitions": 3000,
"send_size": 1024,
"reply_size": 1024,
Expand Down

0 comments on commit 8e20e80

Please sign in to comment.