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

Memory usage: Observing paging and swapping #4311

Closed
dhbarman opened this Issue Jun 25, 2018 · 12 comments

Comments

Projects
None yet
3 participants
@dhbarman
Copy link

dhbarman commented Jun 25, 2018

Proposal

Use case. Why is this important?

Better system performance.

Nice to have' is not a good use case :)

Bug Report

What did you do?

Nothing

What did you expect to see?

No paging and swapping as memory available is high.

What did you see instead? Under which circumstances?

Paging and swapping are observed on Prometheus nodes while memory is still available.

Environment

  • System information:

    Linux 4.1.12-124.15.2.el7uek.x86_64 x86_64

  • Prometheus version:

    prometheus --version
    prometheus, version 2.2.1 (branch: HEAD, revision: bc6058c)
    build user: root@149e5b3f0829
    build date: 20180314-14:15:45
    go version: go1.10

screen shot 2018-05-31 at 3 44 55 pm

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Jun 25, 2018

why do you think Prometheus is causing this? AFAIK It is the OS that controls Paging and swapping.

At compaction or rules evaluation it might use more RAM so maybe this is when the OS decides to SWAP.

@dhbarman

This comment has been minimized.

Copy link
Author

dhbarman commented Jun 29, 2018

If OS controls the behavior, shouldn't we see consistent or uniform behavior ? We see occasional high swapping and paging. I am collecting more data which I will upload here.

@dhbarman

This comment has been minimized.

Copy link
Author

dhbarman commented Jul 2, 2018

screen shot 2018-07-02 at 11 09 20 am 2
screen shot 2018-07-02 at 11 15 49 am
screen shot 2018-07-02 at 11 23 17 am 2

Attaching 3 graphs all from the same window of time:

  1. Virtual memory: Paging and swapping
  2. Memory Available and Swap Used %
  3. Disk Performance %
@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Jul 2, 2018

I imagine this happens at compaction when Prometheus needs more memory to expand and merge the blocks.

@dhbarman

This comment has been minimized.

Copy link
Author

dhbarman commented Jul 3, 2018

Is there anything we can do to avoid such spikes ? Or is it expected ? Does it have any correlation with incoming queries ?

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Jul 3, 2018

Is there anything we can do to avoid such spikes ? Or is it expected ?

It is to be expected.

Does it have any correlation with incoming queries ?

yes any heavy queries will greatly increase memory usage.

@dhbarman

This comment has been minimized.

Copy link
Author

dhbarman commented Jul 11, 2018

Is there no mitigation step? Do you suggest that we should increase swap memory allocation? Do you have any code change in prometheus which will improve its memory footprint?

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Jul 12, 2018

decrease load , increase available memory. Anything along these lines should help.
There are constant attempts to improve the memory usage.

Since this is not a bug I would suggest closing this and moving all additional questions to the user mailing list.

no crash, no panic = user mailing list 😉

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Aug 12, 2018

@dhbarman did you get this resolved so I can close the issue?

@dhbarman

This comment has been minimized.

Copy link
Author

dhbarman commented Aug 17, 2018

@krasi-georgiev Have not resolved it completely. We will keep monitoring our servers. We plan to upgrade to a newer version of Prometheus too. You may close the ticket for now.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Aug 17, 2018

ok, thanks. Feel free to add more updates.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.