automatic memory ballooning?
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically.
Is there any support for that?
Signature · 2 lines
Thomas Fjellstrom [email protected]
Quoted 7 lines · Thomas Fjellstrom
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically.
Is there any support for that?
That would be part of a management application. qemu only knows about the guest it controls, while ballooning needs a global view of the system.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 10 lines · Avi Kivity
Quoted 6 lines · Thomas Fjellstrom
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically.
Is there any support for that?
That would be part of a management application. qemu only knows about the guest it controls, while ballooning needs a global view of the system.
All a single guest needs to do is only use as much ram as it needs at any given time (up to the max allocated). So if the guest hasn't used much ram in a given time frame, "free" the free ram from the host, and only reallocate when needed. It doesn't _need_ a management application, just happens to be the way people do it.
Signature · 2 lines
Thomas Fjellstrom [email protected]
Quoted 11 lines · Thomas Fjellstrom
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Thomas Fjellstrom
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically.
Is there any support for that?
Quoted 9 lines
Quoted 3 lines
That would be part of a management application. qemu only knows about the guest it controls, while ballooning needs a global view of the system.
All a single guest needs to do is only use as much ram as it needs at any given time (up to the max allocated). So if the guest hasn't used much ram in a given time frame, "free" the free ram from the host, and only reallocate when needed. It doesn't _need_ a management application, just happens to be the way people do it.
Well, for a single guest you are correct, but this is better solved generically for multiple guests.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 9 lines · Thomas Fjellstrom
Quoted 8 lines · Avi Kivity
Quoted 6 lines · Thomas Fjellstrom
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically.
Is there any support for that?
Quoted 9 lines
Quoted 2 lines
That would be part of a management application. qemu only knows about the guest it controls, while ballooning needs a global view of the system.
All a single guest needs to do is only use as much ram as it needs at any given time (up to the max allocated). So if the guest hasn't used much ram in a given time frame, "free" the free ram from the host, and only reallocate when needed. It doesn't _need_ a management application, just happens to be the way people do it.
This is far from being an accurate description of the reality ( ;) )
You cannot just expect the guest to do so. The guest has page cache that uses memory, it might run many processes that consume lots of memory, etc. Even if you could have done it, the translation between the guest-host is not 1-1 and the host needs to be aware of the guest memory usage.
This is what ballooning does. A target is determined by host management daemon. As a response, the guest balloon driver try to allocate memory and pass it as Guest Physical Addresses to the host. Now the host can use madvise in order to mark these pages as not needed (and free the mmu of pinning them).
The complexity is for the management to dynamically shift memory between the host and the guest to reach maximum performance.
Regards,
Dor
Quoted 35 lines · Dor Laor
Quoted 13 lines · Thomas Fjellstrom
Quoted 11 lines · Avi Kivity
Quoted 6 lines · Thomas Fjellstrom
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically.
Is there any support for that?
That would be part of a management application. qemu only knows about the guest it controls, while ballooning needs a global view of the system.
Quoted 5 lines
All a single guest needs to do is only use as much ram as it needs at any given time (up to the max allocated). So if the guest hasn't used much ram in a given time frame, "free" the free ram from the host, and only reallocate when needed. It doesn't _need_ a management application, just happens to be the way people do it.
This is far from being an accurate description of the reality ( ;) ) You cannot just expect the guest to do so. The guest has page cache that uses memory, it might run many processes that consume lots of memory, etc. Even if you could have done it, the translation between the guest-host is not 1-1 and the host needs to be aware of the guest memory usage.
This is what ballooning does. A target is determined by host management daemon. As a response, the guest balloon driver try to allocate memory and pass it as Guest Physical Addresses to the host. Now the host can use madvise in order to mark these pages as not needed (and free the mmu of pinning them).
The complexity is for the management to dynamically shift memory between the host and the guest to reach maximum performance.
Quoted 6 lines
Regards,
Dor
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
One thing I found odd about kvm's ballooning is that it actually seems to change how much ram the guest has. I really didn't expect "free -m" to report that the guest only had 64M ram after I manually ballooned the ram. I was however expecting it just to free ram it wasn't using in the host. To me, it just doesn't seem to be the same thing. now it'll start swapping at 64M ram instead of just reallocating the ram it used to have.
Signature · 2 lines
Thomas Fjellstrom [email protected]
Quoted 7 lines · Thomas Fjellstrom
One thing I found odd about kvm's ballooning is that it actually seems to change how much ram the guest has. I really didn't expect "free -m" to report that the guest only had 64M ram after I manually ballooned the ram. I was however expecting it just to free ram it wasn't using in the host. To me, it just doesn't seem to be the same thing. now it'll start swapping at 64M ram instead of just reallocating the ram it used to have.
You expectations aren't realistic. kvm never allocates the ram the guest doesn't use in the first place. Ballooning just the "free" memory is pointless since it's usually a very small amount.
It may be worthwhile for the guest to give up that memory voluntarily though.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 10 lines · Avi Kivity
Quoted 6 lines · Thomas Fjellstrom
One thing I found odd about kvm's ballooning is that it actually seems to change how much ram the guest has. I really didn't expect "free -m" to report that the guest only had 64M ram after I manually ballooned the ram. I was however expecting it just to free ram it wasn't using in the host. To me, it just doesn't seem to be the same thing. now it'll start swapping at 64M ram instead of just reallocating the ram it used to have.
You expectations aren't realistic. kvm never allocates the ram the guest doesn't use in the first place.
Really? So htop is lying to me then? I gave 1G ram to a kvm linux guest using virtio (disk, net, ballooning), and RES clearly said 1G, and VIRT actually said somewhere around 1.3 to 1.6G. It stayed that way for over a day, and the guest did nothing the entire time.
I know the kernel lies a little bit about ram usage, but it seems at least with kvm, the ram is in use when it says it is, while with vmware, it usually isn't.
Quoted 5 lines
Ballooning just the "free"
memory is pointless since it's usually a very small amount.It may be worthwhile for the guest to give up that memory voluntarily though.
Signature · 2 lines
Thomas Fjellstrom [email protected]
Quoted 11 lines · Thomas Fjellstrom
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Thomas Fjellstrom
One thing I found odd about kvm's ballooning is that it actually seems to change how much ram the guest has. I really didn't expect "free -m" to report that the guest only had 64M ram after I manually ballooned the ram. I was however expecting it just to free ram it wasn't using in the host. To me, it just doesn't seem to be the same thing. now it'll start swapping at 64M ram instead of just reallocating the ram it used to have.
Quoted 4 lines
Quoted 3 lines
You expectations aren't realistic. kvm never allocates the ram the guest doesn't use in the first place.
Really? So htop is lying to me then?
Of course not.
Quoted 5 lines
I gave 1G ram to a kvm linux guest using
virtio (disk, net, ballooning), and RES clearly said 1G, and VIRT actually said somewhere around 1.3 to 1.6G. It stayed that way for over a day, and the guest did nothing the entire time.
VIRT size is pointless, it includes tons of shared libraries which don't really affect memory usage. Try cat /proc/$pid/maps (or pmap $pid) on a qemu instance and see.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 10 lines · Avi Kivity
Quoted 6 lines · Thomas Fjellstrom
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically.
Is there any support for that?
That would be part of a management application. qemu only knows about the guest it controls, while ballooning needs a global view of the system.
Where can I find such a management application?
Signature · 2 lines
Thomas Fjellstrom [email protected]