You are not logged in.

#1 2010-08-11 17:31:47

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

KVM - available memory less than expected?

I just orderd a 512MB cloudserver, which seems to work fine but does have one strange issue: the available memory shown by free/top is 492MB instead of 512MB. I also have another VPS (not cloud) at the same provider, and this one does show the amount of 512MB as expected. I e-mailed the provider in question to ask about this, and received this reply (literal transcript):

We allocate the amount of memory for each virtual machine that we start. The fact that the linux kernel, as in physical machines, reserves a small amount of memory for paging, BIOS caching and other things, does not mean that we are purposely trying to mislead our clients. This small amount of reserved memory is not "overhead", but belongs to only a particular cloudserver of one of our customers. Other "overhead" that the cloud system requires, will not be charged to our customers.

I agree with you that it would be nice if the allocated amount of memory would also be the actually usable memory, but unfortunately this is not how things work for both physical and virtual linux machines.

If you look at the output of the application 'dmidecode', then you will see that the set up amount of memory is also available to the machine. The fact that the application 'free' shows only the amount of available memory for user pages, and not the already reserved memory pages for kernel space, memory mapping and the like, is merely a technical fact.

This is something that also occurs on physical machines, and is no extraordinary situation there as well. It is obviously something that occurs standardly on Unix based machines (Mac/Linux/*nix). The reason why this situation is different on our VPS machines, is that these run on Xen with a guest that uses paravirtualisation. Our cloud platform is based on KVM technology, which uses hardware virtualisation. The advantage of this is that it is faster, and that each cloud server has it's own linux kernel.

Can anyone confirm the above statement? It sounds a bit far fetched too me, but my knowledge of KVM is too limited to make a proper assessment.

In general, is it fair to sell someone a virtual machine with specifications that cannot actually be used, claiming that it is a natural consequence of the used technology?


ᶘ ᵒᴥᵒᶅ

Offline

#2 2010-08-11 17:40:06

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: KVM - available memory less than expected?

It's like with the HDD sizes and MegaPixels - you get a nominal value and a real (effective) one.

Offline

#3 2010-08-11 17:57:02

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: KVM - available memory less than expected?

This is similar to hard drive advertised sizes where 320GB actually only gives you 298GB usable, not because a file system or something else is occupying space. But simply because they use 1000KB = 1MB as a conversion rate.

You could simply terminate the account and ask for you money back.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2010-08-11 18:13:42

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: KVM - available memory less than expected?

I checked dmesg and free on both machines, here's the output:

512MB Cloudserver

Memory: 496468k/524276k available (5650k kernel code, 388k absent, 26780k reserved, 3582k data, 544k init)
             total       used       free     shared    buffers     cached
Mem:           492        428         63          0         58        165
-/+ buffers/cache:        203        288
Swap:          512         92        420

512MB VPS

Memory: 509184k/532480k available (2081k kernel code, 14548k reserved, 804k data, 120k init)
             total       used       free     shared    buffers     cached
Mem:           512        505          6          0         25        257
-/+ buffers/cache:        222        290
Swap:         1023        116        907

ᶘ ᵒᴥᵒᶅ

Offline

#5 2010-08-11 18:20:53

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: KVM - available memory less than expected?

Whats the 388K absent in the Cloudserver? Its not much only 0.3 mb but I am not sure what absent means here.

OT: The person who emailed you, seemed pretty defensive about it in his email (or atleast the translation that you provided)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2010-08-11 18:22:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: KVM - available memory less than expected?

Inxsible wrote:

Whats the 388K absent in the Cloudserver? Its not much only 0.3 mb but I am not sure what absent means here.

If I'm reading it correctly, 20 MB are missing.

Offline

#7 2010-08-11 18:38:40

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: KVM - available memory less than expected?

Inxsible wrote:

OT: The person who emailed you, seemed pretty defensive about it in his email (or atleast the translation that you provided)

Yes definitely, i tried to translate it as literally as possible, retaining the original intentions.

His reaction to my first e-mail was:

492mb is the free space that can be used by the system. The other 20mb is held apart by the system, that's why it's not visible.

I wasn't satisfied with that explanation, so i replied back that if that was the case, in my opinion this was misleading and that their product page should mention 492mb instead of 512mb memory. He then came back with the reaction above..


ᶘ ᵒᴥᵒᶅ

Offline

#8 2010-08-11 18:54:16

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: KVM - available memory less than expected?

From your output of dmesg the kernel does see very close to 512MB (511.9883MB), the amount that is missing is used for housekeeping and the person that replied to you seemed to know what he/she was talking about.

About the amount of absent memory, I see something similar with my notebook, I guess it must have something to do with the BIOS and the amount of ram the bios reports to the OS, as an example here's what I get in a real machine:

Memory: 3988700k/5242880k available (3484k kernel code, 1049444k absent, 204736k reserved, 1795k data, 476k init)

This machine has 4GB of ram but somehow 5GB are reported and sometimes I can see the BIOS trying(?) to test up to 5GB during POST.

I guess that in your case it is due to the bios that KVM emulates and some small difference between the full 512MB that are reported somehow and the amount of memory that can truly be accessed.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB