New on LowEndTalk? Please Register and read our Community Rules.
New to OpenVZ. I think there's something weird going on with the RAM
edited September 2016 in Help
Hello everyone! I've always been on KVM, first time on OpenVZ, from a provider here. KVM was easy, I could easily find out how much RAM I was using via New Relic or by just typing free -m.
I'm getting all kinds of confusing readings from all the different checks. My plan is supposed to have 1gb RAM + 512mb burst.
I took a screenshot of various different readings, hopefully one of you more knowledgeable people can help me figure out what's going on. This same app took up about ~250mb RAM on a KVM VPS at Digital Ocean.
I'm not seeing anything that strikes me as particularly odd. You say the app uses less memory elsewhere and that may be true but I'm inclined to believe this is not necessarily related to the virtualization type as much as differences in the OS.
DO, by default, does not use swap either. I notice many applications have different memory usage when swap is an option as opposed to when it is not, though usually it goes in the other direction.
Hey it's Jarland, my email provider!
What I am mostly confused about is the New Relic reading. It shows I'm only using about 16mb of physical memory, and 224mb of swap. That can't be right correct? I am on a LEMP stack.
I'd rather have everything on physical memory, especially since I have so much of it available and going unused. Shouldn't swap kick in only when my physical memory is all filled up?
To toss in yet another tool, that should accurately examine your RAM usage: https://github.com/pixelb/ps_mem
Does it give you any other readings?
But as @jarland said: Regarding this different systems tend to behave quite non-deterministic.
Does it matter after all, if everything is running just fine? :P
Hey thanks for suggesting that tool Bochi! According to ps_mem I'm using about 176mb. I've attached a screenshot below.
The site loads fine, albeit a little slower than DO. It held up similarly to DO on a blitz.io load test. I'm just wondering if the slowness is due to swap being used instead of physical memory.
You're welcome. Results seem fine to me!
For the swap part: You could use vmstat or such, to determine the I/O to the swap.
But I don't think your slight performance difference is due to this. DO in general has some pretty beefy setups.
depending on how much usage on overall RAM is and at which ratio it's been overcommitted, the hypervisor may be eager to free as much RAM as possible including encouraging swappiness. but keep in mind that swap on OVZ doesn't compare to regular swap but is also RAM only slowed down to behave like swap.
Hmm...so all these different methods telling me different numbers, how do I know which one is the right one?
How do I determine exactly how much RAM I'm using, and whether it's being stored on physical memory or on SWAP?
I'd trust 'free -m' as read by the good old definition here: