Score:1

none of the apps is using more that 2% of memory but memory is at 70%

us flag

I had problem with my server memory so stopped all of docker containers but its still using more than 70% of memory, also added swap but its not being used at all. when I reboot the server every thing is good but all of a sudden it goes up like that. what should I do about this ?

screen shot of glances

UPDATE: so I started containers and it began with 80% of memory being used. but after two days it went up to 92%. screen shot of htop

also memory use per group memory usage of each group

vidarlo avatar
ar flag
Do you see any problems associated with memory use? If not, *ignore it*. Linux handles memory perfectly fine on it's own. Warning signs is typically varying use of swap and no free memory. You have plenty of free memory.
scaryhamid avatar
us flag
well not yet, but when I start running my containers it goes up to 90%, I'm new to server, so are you sure it won't cause any problems? @vidarlo
vidarlo avatar
ar flag
Unused memory is wasted memory. If stuff works the way you expect, you have enough memory. A little swap use is perfectly fine and reasonable; unused things *should* be written out to swap to free memory for stuff that actually needs it.
scaryhamid avatar
us flag
btw i added swap recently, and i used default values, now its 50Gig, is it ok? @vidarlo
vidarlo avatar
ar flag
It's total overkill. If you ever use that amount of swap you have problems. I'd say 1-2GiB of swap is fine.
scaryhamid avatar
us flag
oh, is it possible to remove it now ? @vidarlo
Thorsten Staerk avatar
cn flag
https://www.cloudways.com/blog/linux-ate-my-ram-memory-myth-busted/ explains how you find what your RAM is used for... thus understanding if it's bad or not
John Mahowald avatar
cn flag
What version of Ubuntu? What kernel, uname -a
djdomi avatar
za flag
dont care about the size in case enough hdd site is available. i usually use the same site of swap for my servers eve its nevertheless needed
scaryhamid avatar
us flag
I think this is what you asked for : 5.4.0-91-generic #102-Ubuntu SMP @JohnMahowald
Score:0
cn flag

Some thinking and judgement is required by you to understand your environment and do capacity planning. What does it mean to the organization that this host is performing well? Hint: users care about if "its slow", not memory or CPU utilization. How far can you push utilization and still have an adequate safety margin?

You appear to be using glances, a Python psutil based resource monitor. At first glance (ha) it has decent UX, sane data sources, and tells you about alerts, nice. Default memory alerts are 50% 70% 90%, which to me is fairly conservative and escalates from more than enough to concerning to heavy memory pressure. Check if this makes sense in your environment, configure different thresholds if necessary.

But percent of what memory metric? On Linux, glances defers to psutil. psutil calculates total minus available. Which is a reasonable thing to do, caches and other easy recoverable things are excluded from the ratio. Although there are legacy fallback calculations for old kernels, so how this is measured could vary.

During these "high" memory consumption alerts, collect raw /proc/meminfo output and analyze it. It is possible for memory consumption to exist outside the address space of process. Including shared memory segments, or kernel data structures.

This host is a systemd system that runs docker and a few other things. Get the memory use per group by running systemd-cgtop --order=memory and docker stats Often per group stats are easier to understand than accounting for the many processes on the system. Maybe containers still exist, even though most of their processes have stopped.

scaryhamid avatar
us flag
Thank you for your explanation, I added screen shots of what you asked. still can't figure out what's happening. should I just leave it and let ubuntu handle this?
John Mahowald avatar
cn flag
I don't see you doing the difficult part of qualifying if it seems "slow" to users, which would clarify if this is a problem. That's not something you can get from memory metrics or other resource utilization. Maybe about 8 GB of total memory would be more comfortable, maybe that is not necessary.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.