Skip to content

benchmark: add Docker-in-gVisor moby network benchmark. - #16445

Open
parth-opensrc wants to merge 1 commit into
google:masterfrom
parth-opensrc:pr-moby-bench
Open

parth-opensrc wants to merge 1 commit into
google:masterfrom
parth-opensrc:pr-moby-bench

Conversation

@parth-opensrc

Copy link
Copy Markdown
Contributor

Added benchmark to measure TCP throughput across
Docker-in-gVisor (DING) network topologies using Iperf.

Topologies:

  • DING -> DING over loopback (127.0.0.1)
  • Host -> DING over the host Docker network
  • DING -> Host over the host Docker network
  • DING -> DING across two DING containers on the host Docker network
  • Host -> DINGSubContainer
  • DINGSubContainer -> Host
  • DING -> DINGSubContainer over a bridge network
  • DINGSubContainer -> DING over a bridge network
  • DINGSubContainer -> DINGSubContainer on the same bridge
  • DINGSubContainer -> DINGSubContainer over different bridge

Comment thread test/moby/mobyutil/mobyutil.go Outdated
Comment on lines +53 to +63
// EnsureRuntime defaults the container runtime to runsc if unspecified and
// returns whether the active runtime is gVisor.
func EnsureRuntime() (bool, error) {
if dockerutil.Runtime() == "" {
slog.Warn("no runtime specified, defaulting to runsc")
dockerutil.SetRuntime("runsc")
}
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
return dockerutil.IsGVisorRuntime(ctx)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this is a good idea, especially the sideeffect with the empty runtime. This should inherit the runtime dockerutil dictates, for consistency with the rest of the benchmarks. The StartContainer function can just call dockerutil.IsGVisorRuntime directly. I see this logic was already in moby_test.go, but should disappear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True, done.

Comment thread test/moby/mobyutil/mobyutil.go Outdated
Comment on lines +96 to +102
// Exec runs a command inside container d and returns an error if it fails.
func Exec(ctx context.Context, d *dockerutil.Container, args ...string) error {
if out, err := d.Exec(ctx, dockerutil.ExecOpts{}, args...); err != nil {
return fmt.Errorf("command %v failed: %w (%s)", args, err, out)
}
return nil
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need for this function at all, the d.Exec function is already good enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed custom exec.

Added benchmark to:
- Measure TCP throughput across Docker-in-gVisor (DING) network topologies using iperf.
- Topologies:
  * DING -> DING over loopback (127.0.0.1)
  * Host -> DING over the host Docker network
  * DING -> Host over the host Docker network
  * DING -> DING across two DING containers on the host Docker network
  * Host -> DINGSubContainer
  * DINGSubContainer -> Host
  * DING -> DINGSubContainer over a bridge network
  * DINGSubContainer -> DING over a bridge network
  * DINGSubContainer -> DINGSubContainer on the same bridge
  * DINGSubContainer -> DINGSubContainer over different bridge
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.

2 participants