Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main perf tests #2052

Merged
merged 18 commits into from
Oct 2, 2023
Merged

Main perf tests #2052

merged 18 commits into from
Oct 2, 2023

Conversation

rawdaGastan
Copy link
Contributor

@rawdaGastan rawdaGastan commented Sep 11, 2023

Omarabdul3ziz and others added 8 commits September 3, 2023 19:26
- introduce Task interface
- remove testing code
- use redis connection from pool
- unexpose some methods and fields
- update running zos node docs & add example for using perf
- use redis pool correctly
- add GetAll method
- better naming for tasks with prefix `perf.`
- use unix date
@rawdaGastan rawdaGastan marked this pull request as ready for review September 11, 2023 11:42
@rawdaGastan
Copy link
Contributor Author

waiting for

@muhamadazmy muhamadazmy changed the base branch from main to main_perf_package September 13, 2023 10:42
@@ -0,0 +1,68 @@
// Package graphql for grid graphql support
package graphql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we really needed to implement this from scratch ? can't we use an existing graphql client ?

@@ -202,6 +205,41 @@ func action(cli *cli.Context) error {
return errors.Wrap(err, "failed to create a new perfMon")
}

if exists := iperf.Exists(zinit.Default()); exists {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed before running a tests against public nodes happens from ALL nodes (even the ones without public config). The idea is:

  • Public nodes running iperf running in test mode
  • All nodes run test against the nodes that has iperf server running
  • Nodes measure their up/down speed against the random public nodes.

Comment on lines 209 to 223
g, err := graphql.NewGraphQl(env.GraphQL)
if err != nil {
return errors.Wrap(err, "failed to create a new graphql")
}

freeFarmNodes, err := g.ListPublicNodes(0, 1, true, false)
if err != nil {
return errors.Wrap(err, "failed to list freefarm nodes from graphql")
}

nodes, err := g.ListPublicNodes(12, 0, true, false)
if err != nil {
return errors.Wrap(err, "failed to list nodes from graphql")
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too much to be done by noded. Noded all what it cares about is to register a certain test against the perf framework.

The test ON RUNNING, will pick the nodes to test against. means the nodes can be different each time the test runs

Comment on lines 227 to 231
perfMon.AddTask(&perf.TCPTask{
TaskID: "TCPTask",
Schedule: "* */5 * * * *",
ClientIP: strings.SplitN(node.PublicConfig.Ipv4, "/", 2)[0],
Bandwidth: "1M",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's correct, but I really don't like this way to construct types. Instead you should create a NewTest function that takes no argument (in this case) because all this stuff should be defined by the test itself, and should be modified by the test plugin (for example iperf test has specific fixed id and schedule)

Also we should have one single test for iperf not 2. It's a single test plugin that will do both tcp and udb (sequentially) and store the result of both tests.

I think a task id can be only iperf. I don't know why it's called a Task here when it's not

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests also need to run against MANY nodes per test not a single node. I thought this is clear. so a test can take quite some time before it fiinishes (running multiple tests against multiple nodes for tcp and udp

pkg/network/iperf/iperf.go Outdated Show resolved Hide resolved
pkg/perf/monitor.go Outdated Show resolved Hide resolved
pkg/perf/tcp_task.go Outdated Show resolved Hide resolved
Comment on lines 44 to 49
err = cmd.Run()
if err != nil {
log.Error().Err(err).Msgf("failed to run iperf tcp task: %s", stderr.String())
}

return out.String(), nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good structure. The data from the output need to be parse and put in a structure that describe both upload and download speeds (decent structure) not just raw output from the command.

The structure should also then have information about what node, what Ip the test was run against, did it work or not, what are the speeds, and any other useful information from the test.

pkg/perf/udp_task.go Outdated Show resolved Hide resolved
Base automatically changed from main_perf_package to main September 26, 2023 08:06

// NewIperfTest creates a new iperf test
func NewIperfTest() IperfTest {
return IperfTest{taskID: "iperf", schedule: "* */5 * * * *"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to run every 6 hours according to the requirements

pkg/perf/iperf_task.go Outdated Show resolved Hide resolved
pkg/perf/iperf_task.go Outdated Show resolved Hide resolved
pkg/perf/iperf_task.go Outdated Show resolved Hide resolved
rawdaGastan and others added 2 commits September 26, 2023 15:46
an * in the second field means "everysecond" so it means
to run the test every second of each (6th) our of the day
@muhamadazmy muhamadazmy merged commit 101b2b2 into main Oct 2, 2023
2 checks passed
@muhamadazmy muhamadazmy deleted the main_perf_tests branch October 2, 2023 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants