I read a post in kernel maling list talking about swapfiles and NFS, but i cant`t undestand: swap don`t work with NFS and Xen? I read at debianadministrarors`s web site this how-to: "NFS does not need a fast processor or a lot of memory. I/O is the bottleneck, so fast disks and a fast network help. If you use IDE disks, use hdparam to tune them for optimal transfer rates. If you support multiple, simultaneous users, consider paying for SCSI disks; SCSI can schedule multiple, interleaved requests much more intelligently than IDE can. On the software side, by far the most effective step you can take is to optimize the NFS block size. NFS transfers data in chunks. If the chunks are too small, your computers spend more time processing chunk headers than moving bits. If the chunks are too large, your computers move more bits than they need to for a given set of data. To optimize the NFS block size, measure the transfer time for various block size values. Here is a measurement of the transfer time for a 256 MB file full of zeros. # mount files.first.com:/home /mnt -o rw,wsize=1024 # time dd if=/dev/zero of=/mnt/test bs=16k count=16k 16384+0 records in 16384+0 records out real 0m32.207s user 0m0.000s sys 0m0.990s # umount /mnt This corresponds to a throughput of 63 Mb/s. Try writing with block sizes of 1024, 2048, 4096, and 8192 bytes (if you use NFS v3, you can try 16384 and 32768, too) and measuring the time required for each. In order to get an idea of the uncertainly in your measurements, repeat each measurement several times. In order to defeat caching, be sure to unmount and remount between measurements. # mount files.first.com:/home /mnt -o ro,rsize=1024 # time dd if=/mnt/test of=/dev/null bs=16k 16384+0 records in 16384+0 records out real 0m26.772s user 0m0.010s sys 0m0.530s # umount /mnt Your optimal block sizes for both reading and writing will almost certainly exceed 1024 bytes. It may occur that, like mine, your data do not indicate a clear optimum, but instead seem to approach an asymptote as block size is increased. In this case, you should pick the lowest block size which gets you close to the asymptote, rather than the highest available block size; anecdotal evidence indicates that too large block sizes can cause problems. Once you have decided on an rsize and wsize, be sure to write them into your clients' /etc/fstab. You might also consider specifying the noatime option." This really increase some performance running with XEN? -- Regards, Luiz Vitor Martinez Cardoso aka Grabber. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> fast network help. If you use IDE disks, use hdparam to tune them for > optimal transfer rates. If you > support multiple, simultaneous users, consider paying for SCSI disks; SCSI > can schedule multiple, > interleaved requests much more intelligently than IDE can.Thats rather outdated documentation _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Alan Cox, I read about NFS in this mail (at kernel-list): [PATCH 00/33] Swap over NFS -v14 This is outdated information? I trying to understand why i can`t use SWAP with NFS. Regards, Luiz Vitor Martinez Cardoso aka Grabber. On Nov 3, 2007 6:08 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:> > fast network help. If you use IDE disks, use hdparam to tune them for > > optimal transfer rates. If you > > support multiple, simultaneous users, consider paying for SCSI disks; > SCSI > > can schedule multiple, > > interleaved requests much more intelligently than IDE can. > > Thats rather outdated documentation > >-- Atenciosamente, Luiz Vitor. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> I read about NFS in this mail (at kernel-list): [PATCH 00/33] Swap over NFS > -v14 > > This is outdated information? I trying to understand why i can`t use SWAP > with NFS.Swap with NFS has not been allowed for technical reasons. I think that 2.6.24 might have patches to allow swapping over NFS, but I''m not really sure. There''s certainly an effort in progress to get swap-over-NFS into mainline Linux in the not-too-distant future. Patches to allow it have been floating around for a while, so you could probably find one and apply it to your kernel. Actually, I thought that debian were including a patch for this in their kernel at one stage but I''m not sure... Anyhow, the basic problem with swapping over NFS is: you want to swap when you''re low on memory; you need to allocate memory in order to do network IO; how do you swap over the network if you''ve got no memory to allocate for network buffers? I''m not sure how previous patches address this (or how good they were!), but I understand the latest round of patches for current kernels keep some memory in reserve in order to prevent a lack of memory freezing up the system and preventing forward progress. The problems (and solutions) here are basically the same whether you''re running on a real machine or under Xen, so there''s not really anything Xen-specific going on. Cheers, Mark> Regards, > Luiz Vitor Martinez Cardoso aka Grabber. > > On Nov 3, 2007 6:08 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > > > fast network help. If you use IDE disks, use hdparam to tune them for > > > optimal transfer rates. If you > > > support multiple, simultaneous users, consider paying for SCSI disks; > > > > SCSI > > > > > can schedule multiple, > > > interleaved requests much more intelligently than IDE can. > > > > Thats rather outdated documentation-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thanks for reply! I''m thinking... is really necessary use SWAP over ethernet (using NFS)? The RAM memory have highest transfers rates and access time, why we need migrate information (pages from ram) accross a network? It is stupid and decrease a lot o performance??? Can anyone justify it? Regards, Luiz Vitor Martinez Cardoso aka Grabber. On 12/2/07, Mark Williamson <mark.williamson@cl.cam.ac.uk> wrote:> > > I read about NFS in this mail (at kernel-list): [PATCH 00/33] Swap over > NFS > > -v14 > > > > This is outdated information? I trying to understand why i can`t use > SWAP > > with NFS. > > Swap with NFS has not been allowed for technical reasons. I think that > 2.6.24 > might have patches to allow swapping over NFS, but I''m not really sure. > There''s certainly an effort in progress to get swap-over-NFS into mainline > Linux in the not-too-distant future. > > Patches to allow it have been floating around for a while, so you could > probably find one and apply it to your kernel. Actually, I thought that > debian were including a patch for this in their kernel at one stage but > I''m > not sure... > > Anyhow, the basic problem with swapping over NFS is: you want to swap when > you''re low on memory; you need to allocate memory in order to do network > IO; > how do you swap over the network if you''ve got no memory to allocate for > network buffers? > > I''m not sure how previous patches address this (or how good they were!), > but I > understand the latest round of patches for current kernels keep some > memory > in reserve in order to prevent a lack of memory freezing up the system and > preventing forward progress. > > The problems (and solutions) here are basically the same whether you''re > running on a real machine or under Xen, so there''s not really anything > Xen-specific going on. > > Cheers, > Mark > > > Regards, > > Luiz Vitor Martinez Cardoso aka Grabber. > > > > On Nov 3, 2007 6:08 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > > > > fast network help. If you use IDE disks, use hdparam to tune them > for > > > > optimal transfer rates. If you > > > > support multiple, simultaneous users, consider paying for SCSI > disks; > > > > > > SCSI > > > > > > > can schedule multiple, > > > > interleaved requests much more intelligently than IDE can. > > > > > > Thats rather outdated documentation > > > > -- > Dave: Just a question. What use is a unicyle with no seat? And no pedals! > Mark: To answer a question with a question: What use is a skateboard? > Dave: Skateboards have wheels. > Mark: My wheel has a wheel! >-- Regards, Luiz Vitor Martinez Cardoso [Grabber]. (11) 8187-8662 Eletrical Engineer at maua.br _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> Thanks for reply! > > I''m thinking... is really necessary use SWAP over ethernet (using NFS)? The > RAM memory have highest transfers rates and access time, why we need > migrate information (pages from ram) accross a network? It is stupid and > decrease a lot o performance??? > > Can anyone justify it?Well, just swapping to disk can cost a significant amount of performance because the /latency/ of accessing a disk is way more than that to access RAM. The biggest two arguments for swapping to disk I can think of are: a) move unused data out of RAM to make more space for caches and other useful stuff b) avoid out of memory conditions if you''re running programs that use close to (or more than) your total available RAM The same arguments basically apply to swapping over NFS. You might then ask why we''d choose to swap over NFS instead of directly to disk, given using a disk directly might perform better. The big win here is that it makes it possible to have diskless machines which are still able to swap. With virtual machines this could be very handy because: a) it gives you a convenient central point (the NAS filer) to administer virtual machine filesystems. b) virtual machines can still access their filesystem and swap data after being live migrated to another physical host Cheers, Mark> Regards, > Luiz Vitor Martinez Cardoso aka Grabber. > > On 12/2/07, Mark Williamson <mark.williamson@cl.cam.ac.uk> wrote: > > > I read about NFS in this mail (at kernel-list): [PATCH 00/33] Swap over > > > > NFS > > > > > -v14 > > > > > > This is outdated information? I trying to understand why i can`t use > > > > SWAP > > > > > with NFS. > > > > Swap with NFS has not been allowed for technical reasons. I think that > > 2.6.24 > > might have patches to allow swapping over NFS, but I''m not really sure. > > There''s certainly an effort in progress to get swap-over-NFS into > > mainline Linux in the not-too-distant future. > > > > Patches to allow it have been floating around for a while, so you could > > probably find one and apply it to your kernel. Actually, I thought that > > debian were including a patch for this in their kernel at one stage but > > I''m > > not sure... > > > > Anyhow, the basic problem with swapping over NFS is: you want to swap > > when you''re low on memory; you need to allocate memory in order to do > > network IO; > > how do you swap over the network if you''ve got no memory to allocate for > > network buffers? > > > > I''m not sure how previous patches address this (or how good they were!), > > but I > > understand the latest round of patches for current kernels keep some > > memory > > in reserve in order to prevent a lack of memory freezing up the system > > and preventing forward progress. > > > > The problems (and solutions) here are basically the same whether you''re > > running on a real machine or under Xen, so there''s not really anything > > Xen-specific going on. > > > > Cheers, > > Mark > > > > > Regards, > > > Luiz Vitor Martinez Cardoso aka Grabber. > > > > > > On Nov 3, 2007 6:08 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > > > > > fast network help. If you use IDE disks, use hdparam to tune them > > > > for > > > > > > > optimal transfer rates. If you > > > > > support multiple, simultaneous users, consider paying for SCSI > > > > disks; > > > > > > SCSI > > > > > > > > > can schedule multiple, > > > > > interleaved requests much more intelligently than IDE can. > > > > > > > > Thats rather outdated documentation > > > > -- > > Dave: Just a question. What use is a unicyle with no seat? And no > > pedals! Mark: To answer a question with a question: What use is a > > skateboard? Dave: Skateboards have wheels. > > Mark: My wheel has a wheel!-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel