Hello, we''re using several test- and development-servers as virtual Xen-machines running on one host. Unfortunately our main application needs much memory. Its not a problem at a first view, because usually only very few instances are running at the same time. But if I understand Xen correctly, its only possible to distribute the physical memory of the machine, not the whole virtual memory of dom0. Let me give an example to explain my problem: The machine has 4GB of physical memory, the application needs about 1GB (mainly used as a kind of shared cache between the instances). Now I would like to have say 4 test and 4 development machines, thus using 8 doms. Would be easy to give dom0 just 4+x GB swap, and distribute the resulting 8GB on all machines. Yes I know, if all machines are running the whole system would be very busy swapping, but I''m fairly sure this case will be happen very seldom. But this seems to be not possible with Xen. It allows only to distribute the physical memory about the machines and ensures, that the sum of the domX-memory must not be larger than the available physical memory. In my case I can only create 3 doms at the same time. Is there something I''m missing? Any solution? Mathias _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hello, Why not just set up the swap in the guests? Mathias Waack wrote:> we''re using several test- and development-servers as virtual Xen-machines > running on one host. Unfortunately our main application needs much memory. > Its not a problem at a first view, because usually only very few instances > are running at the same time. But if I understand Xen correctly, its only > possible to distribute the physical memory of the machine, not the whole > virtual memory of dom0. Let me give an example to explain my problem: > > The machine has 4GB of physical memory, the application needs about 1GB > (mainly used as a kind of shared cache between the instances). Now I would > like to have say 4 test and 4 development machines, thus using 8 doms. Would > be easy to give dom0 just 4+x GB swap, and distribute the resulting 8GB on > all machines. Yes I know, if all machines are running the whole system would > be very busy swapping, but I''m fairly sure this case will be happen very > seldom. But this seems to be not possible with Xen. It allows only to > distribute the physical memory about the machines and ensures, that the sum > of the domX-memory must not be larger than the available physical memory. In > my case I can only create 3 doms at the same time. > > Is there something I''m missing? Any solution? > > Mathias > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- Taneli Leppä | Crasman Co Ltd <taneli@crasman.fi> | <http://www.crasman.fi/> _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > Mathias Waack > Sent: 20 April 2006 12:39 > To: xen-users@lists.xensource.com > Subject: [Xen-users] Memory bound applications > > Hello, > > we''re using several test- and development-servers as virtual > Xen-machines running on one host. Unfortunately our main > application needs much memory. > Its not a problem at a first view, because usually only very > few instances are running at the same time. But if I > understand Xen correctly, its only possible to distribute the > physical memory of the machine, not the whole virtual memory > of dom0. Let me give an example to explain my problem: > > The machine has 4GB of physical memory, the application needs > about 1GB (mainly used as a kind of shared cache between the > instances). Now I would like to have say 4 test and 4 > development machines, thus using 8 doms. Would be easy to > give dom0 just 4+x GB swap, and distribute the resulting 8GB > on all machines. Yes I know, if all machines are running the > whole system would be very busy swapping, but I''m fairly sure > this case will be happen very seldom. But this seems to be > not possible with Xen. It allows only to distribute the > physical memory about the machines and ensures, that the sum > of the domX-memory must not be larger than the available > physical memory. In my case I can only create 3 doms at the > same time. > > Is there something I''m missing? Any solution? >I think you''re missing an important part of the concept here. The memory you give to DomU has to be physical memory, because it''s not managed by Dom0. It''s managed by a combination of DomU (doing for example swapping) and the hypervisor. Dom0 is not involved in any of this. The hypervisor has no ability to swap in/out memory, so the memory you give to a DomU has to be PHYSICALLY present in the machine. The reason the hypervisor can''t swap is because it never was designed to do that. It would also require the hypervisor to have knowledge of the hard-disk layout (or you''d have to make sure that you don''t need to swap out any of Dom0 and use Dom0 to do the actual swapping - which would make the hypervisor relatively simpler, but still make the processing of swapping quite hard). The OS knows (because this is given with the flags when the memory was allocated) which pages are swappable and which are not. This information is not available to HV, so you''d either have to implement it blind (as in, the HV doesn''t actually know what it''s swapping in/out) or extend the information needed to be passed from the OS to HV so that it can say "It''s (not) OK to swap this page out" when you need more memory. And whilst the first approach is POSSIBLE, it would not be very good if the HV suddenly replaced your post for a web-forum to be transmitted by the network card with some block of memory that came out of your "accounts.txt" that you were editing in Xemacs and contains your account and password info for your electronic banking web-site... ;-) As Taneli said: why don''t you swap in each DomU? -- Mats> Mathias > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thursday 20 April 2006 6:52 am, Taneli Leppä wrote:> Hello, > > Why not just set up the swap in the guests?or, give each domU 256MB-1GB, (variable with the baloon driver). most of the domUs would have just 256MB and do lot of swapping, and one of them (the busy one) could get more real RAM (up to 1GB) to do its work. that assumes, of course, that only one or two would be really busy at a time and you know in advance which one will be the busy one. also, you say that most of the RAM used by your application is a ''shared cache between the instances''. what if you create in dom0 a 1GB file in a RAM-backed filesystem (like tmpfs), use that as the VBD for all instances. then you could use that extra partition and mmap it on each application instance. this would only work nice if that ''shared cache'' is either read-only, or if there''s another channel of communication to propagate changes. -- Javier _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thursday 20 April 2006 01:52 pm, Taneli Leppä wrote:> Why not just set up the swap in the guests?Just because it wouldn''t solve the problem. In this case I would have one instance very busy swapping and some other instances occupying non-used memory. Its just the opposite of sharing resources. So if I understand you and Taneli right with Xen its (currently) only possible to share CPU, but not memory? Mathias _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hello Mathias, Mathias Waack wrote:> So if I understand you and Taneli right with Xen its (currently) only possible > to share CPU, but not memory?Yes, I believe this is (somewhat) the case. I believe you can dynamically distribute memory to domU:s using the balloon driver as it was mentioned earlier by Javier (strangely the docs say nothing about that driver and I''ve never used it). Maybe you''d be better off with a different approach, such as VServers? -- Taneli Leppä | Crasman Co Ltd <taneli@crasman.fi> | <http://www.crasman.fi/> _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users