Hi, I have two hosts with 48GB of memory. On each of them I will run multiple DomU which will use near 24GB of memory : I keep 24GB of unused memory on each servers to allow migrate of all VM on only 1 host. So my question : is there a usefull way to use the 24GB of memory on the dom0 ? As a "big" disk cache for example ? (but all my domUs use drbd devices...). Olivier _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Feb 11, 2010 at 10:04 PM, Olivier B. <xen.list@daevel.fr> wrote:> Hi, > > I have two hosts with 48GB of memory. On each of them I will run multiple > DomU which will use near 24GB of memory : I keep 24GB of unused memory on > each servers to allow migrate of all VM on only 1 host. > > So my question : is there a usefull way to use the 24GB of memory on the > dom0 ? As a "big" disk cache for example ? (but all my domUs use drbd > devices...).What kind of domU are you running? If it''s PV, you should be able to use "memory" and "maxmem". So for example you have this on domU config file memory = "1000" maxmem = "2000" It will start with 1000MB memory, but you can extend it up to 2000 MB online with "xm mem-set" without having to reboot domU. When you need to migrate some domUs, you can reduce its memory usage back to the original. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha a écrit :> On Thu, Feb 11, 2010 at 10:04 PM, Olivier B. <xen.list@daevel.fr> wrote: > >> Hi, >> >> I have two hosts with 48GB of memory. On each of them I will run multiple >> DomU which will use near 24GB of memory : I keep 24GB of unused memory on >> each servers to allow migrate of all VM on only 1 host. >> >> So my question : is there a usefull way to use the 24GB of memory on the >> dom0 ? As a "big" disk cache for example ? (but all my domUs use drbd >> devices...). >> > > What kind of domU are you running? If it''s PV, you should be able to > use "memory" and "maxmem". So for example you have this on domU config > file > > memory = "1000" > maxmem = "2000" > > It will start with 1000MB memory, but you can extend it up to 2000 MB > online with "xm mem-set" without having to reboot domU. When you need > to migrate some domUs, you can reduce its memory usage back to the > original. > >You''re right, it''s a solution yes (all my domU are PV). But how does it works if a software use "1800" of that memory, and I reduce it to 1000 ? Or maybe is there a way to reserve this memory for disk caching only ? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Feb 11, 2010 at 11:35 PM, Olivier B. <xen.list@daevel.fr> wrote:> You''re right, it''s a solution yes (all my domU are PV). > But how does it works if a software use "1800" of that memory, and I reduce > it to 1000 ?It''d behave the same as if you run another software that uses 800M of memory. On most cases it''d just use swap. On some cases (like when the app specifically lock the memory it uses, making it unswappable) it might make domU crash or experience OOM.> > Or maybe is there a way to reserve this memory for disk caching only ?No direct way that I know of. You need to know how much memory your application needs/uses. Linux uses available memory for cache. If your application only use 1000M, then the rest (800M) will be used for caching. That 800M can be ballooned-down safely. If your application always need 1800M, then you should assign more memory from the start. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha a écrit :> On Thu, Feb 11, 2010 at 11:35 PM, Olivier B. <xen.list@daevel.fr> wrote: > >> You''re right, it''s a solution yes (all my domU are PV). >> But how does it works if a software use "1800" of that memory, and I reduce >> it to 1000 ? >> > > It''d behave the same as if you run another software that uses 800M of > memory. On most cases it''d just use swap. On some cases (like when the > app specifically lock the memory it uses, making it unswappable) it > might make domU crash or experience OOM. > > >> Or maybe is there a way to reserve this memory for disk caching only ? >> > > No direct way that I know of. You need to know how much memory your > application needs/uses. > Linux uses available memory for cache. If your application only use > 1000M, then the rest (800M) will be used for caching. That 800M can be > ballooned-down safely. > > If your application always need 1800M, then you should assign more > memory from the start. > >Ok, the problem is that it''s not "my application", it''s users''s applications, I don''t really control what they do with their DomU. If I use file backend for a partition, will it use the Dom0 memory for read cache ? (if Xen doesn''t open files in O_DIRECT mode...) In this case I can use 12Go to increase the DomU''s memory by 50%, and 12Go as read cache from dom0 for domu''s swap files :D Maybe it''s a bad idea ? Olivier _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Fri, Feb 12, 2010 at 12:03 AM, Olivier B. <xen.list@daevel.fr> wrote:>> Linux uses available memory for cache. If your application only use >> 1000M, then the rest (800M) will be used for caching. That 800M can be >> ballooned-down safely. >> >> If your application always need 1800M, then you should assign more >> memory from the start. >> >> > > Ok, the problem is that it''s not "my application", it''s users''s > applications, I don''t really control what they do with their DomU.... but they gave you their requirements, right? "Give me a server with 2G RAM" (or something like that). If yes, then you''re only obligated to give them that much resource. If you give them extra, and then take it back later, and the process cause some apps not to work, then it means the requirement is not valid anymore. They need to request more resource. Anyway, most apps (like LAMP) should be able to use swap. The one time I got problem was with Oracle DB (it was a long time ago, on Oracle 10g) when I shrunk domU memory lower than its SGA :P> > If I use file backend for a partition, will it use the Dom0 memory for read > cache ? (if Xen doesn''t open files in O_DIRECT mode...)Sure. If you don''t mind possible data corruption with file:/. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users