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

[CI:DOCS] hack/podmansnoop #16334

Merged
merged 1 commit into from
Oct 28, 2022
Merged

Conversation

vrothberg
Copy link
Member

Add a script to measure the execution times of podman, crun, run and conmon. It's a trimmed down version of the exitsnoop tool and intended to guide us in future performance optimizations.

The below output was generated when running

podman run --net=host docker.io/library/alpine:latest true

podman (snoop) $ sudo ./hack/podmansnoop
PCOMM            PID     PPID    TID     AGE(ms)
conmon           51580   51569   51580   1.67
conmon           51583   51569   51583   3.53
crun             51591   51590   51591   18.28
crun             51593   51569   51593   2.48
conmon           51606   51594   51606   0.85
crun             51608   51594   51608   2.50
podman           51594   51590   51594   176.27
conmon           51590   1950    51590   214.78
podman           51569   40964   51569   431.36

In the future, it would be helpful to add the arguments of the commands. execsnoop can reveal them quite nicely but I did not manage to merge the two scripts due to time constraints.

Signed-off-by: Valentin Rothberg [email protected]

Does this PR introduce a user-facing change?

None

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 28, 2022
@vrothberg
Copy link
Member Author

@baude @rhatdan @alexlarsson PTAL

@alexlarsson
Copy link
Contributor

This looks nice. Is it possible to get the cmdline args too? That way you can figure out what the different parts are. I know for example there is a conmon --version call in there somewhere, etc, which may be confusing.

@vrothberg
Copy link
Member Author

This looks nice. Is it possible to get the cmdline args too? That way you can figure out what the different parts are. I know for example there is a conmon --version call in there somewhere, etc, which may be confusing.

I really want the cmdline as well but see commit message:

In the future, it would be helpful to add the arguments of the commands. execsnoop can reveal them quite nicely but I did not manage to merge the two scripts due to time constraints.

@alexlarsson
Copy link
Contributor

Can you also get events on process creation or exec? Would be interesting to know at what point the different things are started in the run.

@vrothberg
Copy link
Member Author

Can you also get events on process creation or exec? Would be interesting to know at what point the different things are started in the run.

Yes, execsnoop does that. If you are interested, do a dnf install bcc-tools and then run sudo /usr/share/bcc/tools/execsnoop -t -n "podman|crun|conmon". Really cool stuf

@vrothberg
Copy link
Member Author

It's already usable for a human, but I'd love to reach a point, where we marry all this data and can print a CSV file.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Please add a comment at the top on how to use this script. It was not clear to me that I have to run the script without arguments in one window and the podman commands in another.

hack/podmansnoop Outdated Show resolved Hide resolved
hack/podmansnoop Outdated Show resolved Hide resolved
hack/podmansnoop Outdated Show resolved Hide resolved
@vrothberg
Copy link
Member Author

It was not clear to me that I have to run the script without arguments in one window and the podman commands in another.

See commit message.

@Luap99 can we get this in first? I want folks to play with the script first and then go from there. I'll be off until Wednesday.

Add a script to measure the execution times of podman, crun, run and
conmon.  It's a trimmed down version of the exitsnoop tool and intended
to guide us in future performance optimizations.

The below output was generated when running

`podman run --net=host docker.io/library/alpine:latest true`

```
podman (snoop) $ sudo ./hack/podmansnoop
PCOMM            PID     PPID    TID     AGE(ms)
conmon           51580   51569   51580   1.67
conmon           51583   51569   51583   3.53
crun             51591   51590   51591   18.28
crun             51593   51569   51593   2.48
conmon           51606   51594   51606   0.85
crun             51608   51594   51608   2.50
podman           51594   51590   51594   176.27
conmon           51590   1950    51590   214.78
podman           51569   40964   51569   431.36
```

In the future, it would be helpful to add the arguments of the commands.
`execsnoop` can reveal them quite nicely but I did not manage to merge
the two scripts due to time constraints.

Signed-off-by: Valentin Rothberg <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Oct 28, 2022

Does this script actually get executed in tests? If not can we skip the tests.

@vrothberg
Copy link
Member Author

Does this script actually get executed in tests? If not can we skip the tests.

Not executed in tests. I should have added [CI:DOCS]. Will do it next time, thanks!

@rhatdan rhatdan changed the title hack/podmansnoop [CI:DOCS] hack/podmansnoop Oct 28, 2022
@rhatdan
Copy link
Member

rhatdan commented Oct 28, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2022
@openshift-merge-robot openshift-merge-robot merged commit fba3080 into containers:main Oct 28, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants