Ian Bannerman
2014-Mar-13 19:31 UTC
[syslinux] Memory usage with memdisk vs initrd a squashfs
Question, Some Linux distributions I support show two approaches for pxe booting them. One uses memdisk to boot an ISO file. The other uses pxelinux to boot kernel and initrd a squashfs file. I'm unfamiliar with the impact to memory either approach has. Like, does using memdisk permanently squirrel away a chunk of memory for the ISO file that the OS will be unable to use? Is using initrd to pull down the squashfs file more or less efficient? I would appreciate any insight! Apologies for the noob question :) --Ian
On Thu, Mar 13, 2014 at 3:31 PM, Ian Bannerman <ian at internals.io> wrote:> Question, > > Some Linux distributions I support show two approaches for pxe booting them. One uses memdisk to boot an ISO file. The other uses pxelinux to boot kernel and initrd a squashfs file. > I'm unfamiliar with the impact to memory either approach has. Like, does using memdisk permanently squirrel away a chunk of memory for the ISO file that the OS will be unable to use? Is using initrd to pull down the squashfs file more or less efficient? > I would appreciate any insight! Apologies for the noob question :)Generally, the RAM that MEMDISK uses is permanently reserved however that doesn't mean it's unusable. You can still mount the ISO assuming you have the right tools like memdiskfind. As far as efficiency, a small initrd to fetch another file will be more efficient (an ISO might have extra unnecessary stuff like a copy of the kernel and initrd) and would load faster. In my experience TFTP with PXE tops out around 1 MB/s while an HTTP load can easily see 17MB/s or more. lpxelinux.0 (the lwIP-enabled PXELINUX for BIOS) can achieive this as can gpxelinux.0/ipxelinux.0 or PXELINUX ontop of gPXE/iPXE. You can also see this when loading the file after the kernel is booted which would often be a little bit faster than HTTP-capable PXELINUX. -- -Gene
Mattias Schlenker
2014-Mar-13 20:27 UTC
[syslinux] Memory usage with memdisk vs initrd a squashfs
Am 13.03.2014 21:08, schrieb Gene Cumm:> Generally, the RAM that MEMDISK uses is permanently reserved however > that doesn't mean it's unusable. You can still mount the ISO assuming > you have the right tools like memdiskfind. As far as efficiency, a > small initrd to fetch another file will be more efficient (an ISO > might have extra unnecessary stuff like a copy of the kernel and > initrd) and would load faster. In my experience TFTP with PXE tops out > around 1 MB/s while an HTTP load can easily see 17MB/s or more. > lpxelinux.0 (the lwIP-enabled PXELINUX for BIOS) can achieive this as > can gpxelinux.0/ipxelinux.0 or PXELINUX ontop of gPXE/iPXE. You can > also see this when loading the file after the kernel is booted which > would often be a little bit faster than HTTP-capable PXELINUX.I maintain a distribution that loads a rather large initramfs containing all kernel modules and all firmware blobs. This allows for an easy network configuration at early stages and early initialization of framebuffer graphics/KMS. The distribution allows several boot modes over the network: * create an CPIO image containing the ISO and append it as second initramfs (syslinux allows concatenating multiple initramfs) * download the ISO immediately after configuring the network via TFTP, FTP or HTTP * mount a CIFS or NFS share containing the ISO and from there mount the ISO loopback TFTPing large files is dead slow. wgetting FTP or HTTP usually is OK. CIFS and NFS boot is really fast, since just some 200MB of the whole ISO are actually used on systems booting to a thin client mode. And since enough gets cached it doesn't feel notably slower than systems that downloaded the whole ISO during startup. So I would also suggest either downloading the system (stripped ISO without kernel, initramfs and stuff) via HTTP or accessing CIFS/NFS shares containing the ISO and mounting loopback - if thats possible with your distribution. Regards, Mattias -- Mattias Schlenker - Redaktion + EDV-Beratung + Linux-CD/DVD-Konzepte August-Bebel-Str. 74 - 04275 LEIPZIG - GERMANY Bitte fuer geschaeftliche Telefonate vorzugsweise die VoIP-Telefonnummer +49 341 39290767 verwenden, da ich diese aufs Mobiltelefon routen kann!
H. Peter Anvin
2014-Mar-14 02:54 UTC
[syslinux] Memory usage with memdisk vs initrd a squashfs
On 03/13/2014 12:31 PM, Ian Bannerman wrote:> Question, > > Some Linux distributions I support show two approaches for pxe > booting them. One uses memdisk to boot an ISO file. The other uses > pxelinux to boot kernel and initrd a squashfs file. I'm unfamiliar > with the impact to memory either approach has. Like, does using > memdisk permanently squirrel away a chunk of memory for the ISO file > that the OS will be unable to use? Is using initrd to pull down the > squashfs file more or less efficient?Yes it does. If you are using initrd, the best thing to use is a cpio archive (initramfs), which only uses up as little RAM as possible. -hpa