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

swap utilization isn't captured in openvz containers #733

Closed
zerkms opened this Issue Sep 16, 2014 · 7 comments

Comments

Projects
None yet
2 participants
@zerkms
Contributor

zerkms commented Sep 16, 2014

The containers run in openvz environment (to be precise: driven by proxmox) and for some reason collectd v5.4.0 (5.4.0-3ubuntu2) does not capture swap utilization.

swap-io is captured well, but swap-cached, swap-free and swap-used are not.

Both /proc/swaps and /proc/meminfo readable and have meaningful numbers.

On the bare metal machines the same configuration works fine, so only openvz containers are affected.

Any thoughts?

@zerkms zerkms changed the title from swap utilization isn't captured in openvz virtual machines to swap utilization isn't captured in openvz containers Sep 16, 2014

@zerkms

This comment has been minimized.

Show comment
Hide comment
@zerkms

zerkms Sep 16, 2014

Contributor

Used some gdb magic and found it: the plugin expects all three SwapTotal, SwapFree and SwapCached available: https://github.com/collectd/collectd/blob/collectd-5.4.0/src/swap.c#L342

Though in openvz container only SwapTotal and SwapFree are available.

So it just skips all.

In collectd v4 it didn't do such a smart check hence worked fine.

How about making SwapCached not mandatory?

Contributor

zerkms commented Sep 16, 2014

Used some gdb magic and found it: the plugin expects all three SwapTotal, SwapFree and SwapCached available: https://github.com/collectd/collectd/blob/collectd-5.4.0/src/swap.c#L342

Though in openvz container only SwapTotal and SwapFree are available.

So it just skips all.

In collectd v4 it didn't do such a smart check hence worked fine.

How about making SwapCached not mandatory?

octo added a commit that referenced this issue Sep 16, 2014

swap plugin: Make SwapCached optional under Linux.
OpenVZ doesn't provide the line, which caused swap collection to be
skipped entirely on these systems. Instead, "cached" should simply be
ignored, as it is on other systems. Thanks to @zerkms for reporting this
problem!

Fixes: #733
@octo

This comment has been minimized.

Show comment
Hide comment
@octo

octo Sep 16, 2014

Member

Thanks for reporting this! It should be fixed in master, but I might back-port this to one of the version branches.

—octo

Member

octo commented Sep 16, 2014

Thanks for reporting this! It should be fixed in master, but I might back-port this to one of the version branches.

—octo

@octo octo closed this Sep 16, 2014

@zerkms

This comment has been minimized.

Show comment
Hide comment
@zerkms

zerkms Sep 16, 2014

Contributor

That was quick!

Any version is fine. I'll wait for the next release and contact some maintainers to backport it to ubuntu trusty. Or simply will just build a package for myself :-)

Contributor

zerkms commented Sep 16, 2014

That was quick!

Any version is fine. I'll wait for the next release and contact some maintainers to backport it to ubuntu trusty. Or simply will just build a package for myself :-)

octo added a commit that referenced this issue Sep 17, 2014

swap plugin: Make "cached" optional under Linux.
This is the smallest possible fix for OpenVZ, where cached is not available.
master has a more complete fix which should be used going forward.

Fixes: #733
@octo

This comment has been minimized.

Show comment
Hide comment
@octo

octo Sep 17, 2014

Member

I just pushed the above fix to collectd-5.3. It's a minimalistic fix, but should be easier to apply to older versions. The first fix uses functions only available in master right now …

Member

octo commented Sep 17, 2014

I just pushed the above fix to collectd-5.3. It's a minimalistic fix, but should be easier to apply to older versions. The first fix uses functions only available in master right now …

@zerkms

This comment has been minimized.

Show comment
Hide comment
@zerkms

zerkms Sep 17, 2014

Contributor

@octo one of the best opensource projects support I've seen so far

Contributor

zerkms commented Sep 17, 2014

@octo one of the best opensource projects support I've seen so far

@octo

This comment has been minimized.

Show comment
Hide comment
@octo

octo Sep 17, 2014

Member

@zerkms Thank you, I'm honored. I have to admit, though, that you've been lucky, I don't have a track record (yet) ;)

Member

octo commented Sep 17, 2014

@zerkms Thank you, I'm honored. I have to admit, though, that you've been lucky, I don't have a track record (yet) ;)

@zerkms

This comment has been minimized.

Show comment
Hide comment
@zerkms

zerkms Sep 23, 2014

Contributor

Just created a request to reintegrate the patch into current Trusty version: https://answers.launchpad.net/ubuntu/+source/collectd/+question/254877

Contributor

zerkms commented Sep 23, 2014

Just created a request to reintegrate the patch into current Trusty version: https://answers.launchpad.net/ubuntu/+source/collectd/+question/254877

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment