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

Collect RSS and CPU usage for OVS/OVN processes. #106

Merged
merged 1 commit into from
Jun 15, 2022

Conversation

igsilya
Copy link
Contributor

@igsilya igsilya commented Jun 13, 2022

With this change the new process-monitor.py script is copied into
each container and started to collect RSS and CPU usage of all
OVS/OVN processes. Later, log-collector will stop the monitoring
and will collect results as a process-stats.json file. do.sh
script then uses process-stats.py script at the data mining stage
to produce html reports for master and worker nodes containing
RSS an CPU usage graphs.

The integration part is a bit sketchy. Alternative is to avoid
modification of the ovn-tester itself and only deploy the
process monitor on the physical host. This will make the code
a bit cleaner, but we'll loose an easy way to add container names
to process names. Also, the monitor spends 0.5 seconds per process
to estimate the CPU usage. More processes to track - less accurate
the results. For example, one round of measurements for 9 processes
takes ~4.5 seconds, so we can easily miss the 3 second database
compaction. We could run a monitor per process though, but that
sounds like an overkill.

In order to work properly, python3-psutil needs to be installed
in the container. If it's not available, ovn-heater will still
work normally, but resource usage reports will not be generated.

Signed-off-by: Ilya Maximets i.maximets@ovn.org

With this change the new process-monitor.py script is copied into
each container and started to collect RSS and CPU usage of all
OVS/OVN processes.  Later, log-collector will stop the monitoring
and will collect results as a process-stats.json file.  do.sh
script then uses process-stats.py script at the data mining stage
to produce html reports for master and worker nodes containing
RSS an CPU usage graphs.

The integration part is a bit sketchy.  Alternative is to avoid
modification of the ovn-tester itself and only deploy the
process monitor on the physical host.  This will make the code
a bit cleaner, but we'll loose an easy way to add container names
to process names.  Also, the monitor spends 0.5 seconds per process
to estimate the CPU usage.  More processes to track - less accurate
the results.  For example, one round of measurements for 9 processes
takes ~4.5 seconds, so we can easily miss the 3 second database
compaction.  We could run a monitor per process though, but that
sounds like an overkill.

In order to work properly, python3-psutil needs to be installed
in the container.  If it's not available, ovn-heater will still
work normally, but resource usage reports will not be generated.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
@igsilya
Copy link
Contributor Author

igsilya commented Jun 13, 2022

Corresponding ovn-fake-multinode PR: ovn-org/ovn-fake-multinode#64

@igsilya
Copy link
Contributor Author

igsilya commented Jun 13, 2022

Reports look like this, but they are interactive html (github doesn't allow to attach html):
rss

@flavio-fernandes
Copy link

Request: Make it an ovscon 2022 track!

@dceara
Copy link
Collaborator

dceara commented Jun 15, 2022

Looks great to me, thanks!

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