Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

benchmarks: pulled in code from github.com/dgonyeo/rkt-monitor#2324

Merged
cgonyeo merged 2 commits intorkt:masterfrom
cgonyeo:benchmarks
Apr 26, 2016
Merged

benchmarks: pulled in code from github.com/dgonyeo/rkt-monitor#2324
cgonyeo merged 2 commits intorkt:masterfrom
cgonyeo:benchmarks

Conversation

@cgonyeo
Copy link
Member

@cgonyeo cgonyeo commented Mar 24, 2016

Added the tests/rkt-monitor directory, which includes the code for a
golang binary that can start rkt and watch its resource usage. This
directory also includes bash scripts for generating a handful of test
scenarios.

@cgonyeo
Copy link
Member Author

cgonyeo commented Mar 24, 2016

Questions I have about this:

  • Would there be a better way to display the information? If we're only concerned about systemd usage, perhaps I just print that?
  • Should I look into adding a make benchmark to our autotools setup?

@cgonyeo
Copy link
Member Author

cgonyeo commented Mar 24, 2016

Also I've already found something interesting:

derek@rokot ~/go/src/github.com/coreos/rkt/tests/rkt-monitor> sudo ./rkt-monitor too-many-apps.podmanifest -d 30s | grep systemd
systemd(27448): seconds alive: 16  avg CPU: 92.531073%  avg Mem: 5 mB  peak Mem: 5 mB
systemd-journal(27449): seconds alive: 16  avg CPU: 0.000000%  avg Mem: 6 mB  peak Mem: 6 mB

@cgonyeo
Copy link
Member Author

cgonyeo commented Mar 24, 2016

With the too-many-apps pod that's included in this PR it looks like systemd is hunting for some files as hard as it can for a while, and after a while finishes what it was doing and drops back to pretty much no CPU usage.

@yifan-gu
Copy link
Contributor

With the too-many-apps pod that's included in this PR it looks like systemd is hunting for some files as hard as it can for a while, and after a while finishes what it was doing and drops back to pretty much no CPU usage.

@dgonyeo Do you made any notes on what are the files systemd is looking for?

cc @alban @iaguis

@jonboulle jonboulle added this to the v1.3.0 milestone Mar 29, 2016
@alban
Copy link
Member

alban commented Mar 31, 2016

systemd notices the cgroup filesystems being mounted for each app and tries to read the configuration for each of them: https://gist.github.com/alban/0bc92a9dab9a722b05d343753fbc51b1

@iaguis
Copy link
Member

iaguis commented Mar 31, 2016

Not mounting /sys (or not mounting it recursively) inside each app's chroot seems to make the problem go away.

@jonboulle
Copy link
Contributor

Gah. Can we disable systemd's "smartness" somehow?

@alban
Copy link
Member

alban commented Mar 31, 2016

Issue filed in #2351

@alban alban modified the milestones: v1.4.0, v1.3.0 Mar 31, 2016
@iaguis
Copy link
Member

iaguis commented Apr 11, 2016

We shouldn't check in ACIs or binaries.

@jonboulle
Copy link
Contributor

Great catch - presumably an accident since the build scripts are there..

if err != nil {
return nil, err
}
c, err := p.CPUPercent(0)
Copy link
Member

Choose a reason for hiding this comment

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

@cgonyeo
Copy link
Member Author

cgonyeo commented Apr 11, 2016

Whoops, removed the binary and ACI.

@iaguis
Copy link
Member

iaguis commented Apr 11, 2016

😱

$ sudo ./rkt-monitor cpu-stresser.aci -v -d 30s
panic: process does not have children

goroutine 1 [running]:
panic(0x69aa40, 0xc8200c6300)
    /usr/lib/go/src/runtime/panic.go:464 +0x3e6
main.runRktMonitor(0x893260, 0xc8200d60c0, 0x1, 0x4)
    /home/iaguis/work/coreos/go/src/github.com/coreos/rkt/tests/rkt-monitor/main.go:133 +0xa50
github.com/spf13/cobra.(*Command).execute(0x893260, 0xc82000a060, 0x4, 0x4, 0x0, 0x0)
    /home/iaguis/work/coreos/go/src/github.com/spf13/cobra/command.go:565 +0x85a
github.com/spf13/cobra.(*Command).ExecuteC(0x893260, 0x893260, 0x0, 0x0)
    /home/iaguis/work/coreos/go/src/github.com/spf13/cobra/command.go:651 +0x55c
github.com/spf13/cobra.(*Command).Execute(0x893260, 0x0, 0x0)
    /home/iaguis/work/coreos/go/src/github.com/spf13/cobra/command.go:610 +0x2d
main.main()
    /home/iaguis/work/coreos/go/src/github.com/coreos/rkt/tests/rkt-monitor/main.go:65 +0x23
$ ps -o cmd axf | grep -A3 "[s]ystemd-nspawn"
 \_ stage1/rootfs/usr/lib/ld-linux-x86-64.so.2 stage1/rootfs/usr/bin/systemd-nspawn --boot --register=true --link-journal=try-guest --quiet --uuid=9d7e3c2c-0f90-4a65-98d7-35e4805a7709 --machine=rkt-9d7e3c2c-0f90-4a65-98d7-35e4805a7709 --directory=stage1/rootfs -- --default-standard-output=tty --log-target=null --show-status=0
     \_ /usr/lib/systemd/systemd --default-standard-output=tty --log-target=null --show-status=0
         \_ /usr/lib/systemd/systemd-journald
         \_ /worker

@iaguis
Copy link
Member

iaguis commented Apr 14, 2016

Hopefully @dgonyeo has some time to fix this for the next release ;)

@jonboulle
Copy link
Contributor

@dgonyeo do you have time to get this? we need it for rktnetes.

@cgonyeo
Copy link
Member Author

cgonyeo commented Apr 19, 2016

I'll have time to fix this up tomorrow. After I fix the panic, is it fine in its current form? Any changes you'd like to see?

@jonboulle
Copy link
Contributor

For an initial cut yes I think so

@cgonyeo
Copy link
Member Author

cgonyeo commented Apr 20, 2016

The panic was due to gopsutil updating, and me not vendoring the dependencies for this. I pulled in the dependencies and added a little build script to point the GOPATH to Godeps/_workspace. Work for you now, @iaguis?

@iaguis
Copy link
Member

iaguis commented Apr 20, 2016

Yep! But it seems you're still including binary files.

@cgonyeo
Copy link
Member Author

cgonyeo commented Apr 20, 2016

Wow I'm bad at not doing that. Fixed.

@jonboulle
Copy link
Contributor

this is unreviewable, mind splitting out the godeps?

Derek Gonyeo added 2 commits April 20, 2016 14:30
Added the tests/benchmarks directory, which includes the code for a
golang binary that can start rkt and watch its resource usage. This
directory also includes bash scripts for generating a handful of test
scenarios.
Vendored the dependencies necessary for rkt-monitor.
@cgonyeo
Copy link
Member Author

cgonyeo commented Apr 20, 2016

Done.

@alban
Copy link
Member

alban commented Apr 21, 2016

The Godeps changes add a dependency on https://github.com/StackExchange/wmi and it does not have releases yet. We would like to only have godeps dependencies on tagged versions. Can you ask the authors of wmi to tag a release? As an example of such request, please see the rationale on peterbourgon/diskv#27

Same thing for https://github.com/shirou/w32 and maybe others.

@jonboulle
Copy link
Contributor

I think this might not be such an issue for packaging because the deps in
question aren't used in rkt itself, just in ancillary code... but I'm not
sure - @onlyjob can probably clarify.

On Thu, Apr 21, 2016 at 12:23 PM, Alban Crequy [email protected]
wrote:

The Godeps changes add a dependency on
https://github.com/StackExchange/wmi and it does not have releases yet.
We would like to only have godeps dependencies on tagged versions. Can you
ask the authors of wmi to tag a release? As an example of such request,
please see the rationale on peterbourgon/diskv#27
peterbourgon/diskv#27

Same thing for https://github.com/shirou/w32 and maybe others.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#2324 (comment)

@cgonyeo
Copy link
Member Author

cgonyeo commented Apr 25, 2016

Pinging @onlyjob

@onlyjob
Copy link

onlyjob commented Apr 25, 2016

Pinging @onlyjob

Why @dgonyeo? What you expect me to do?? Probably I missed the question...

We can mock-up date-based version of dependency library when semantic releases are not available...

@cgonyeo
Copy link
Member Author

cgonyeo commented Apr 25, 2016

Oh sorry, should have clarified. The question is if it's acceptable in your eyes to use/vendor untagged commits of dependencies, when the dependency is only used in ancillary code that won't make it into the packaged release in a distro like Debian.

@cgonyeo cgonyeo merged commit 8a6e511 into rkt:master Apr 26, 2016
@cgonyeo cgonyeo deleted the benchmarks branch April 26, 2016 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants