[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Do I need 64Bit if RAM is more than 4 GB?



On Tue, Sep 07, 2004 at 09:24:31PM +0200, Dirk H. Schulz wrote:
> Hi folks,
> 
> I hope this is the right place for this kind of question:
> 
> I want to run a server with more than 4 GB of RAM. I do not need 
> applications/processes to address more than 4 GB each. Let's say I want to 
> have 2 instances of apache on the machine, and each instance should address 
> a max of 4 GB.
> 
> Do I need a 64Bit Linux then? Or can I install a 32Bit Linux on a Server 
> with 8 GB RAM, set up my 2 instances of apache, and that`s it?
> 
> Sorry for that kind of basic question but I did not find any docs on that 
> googling around.

 Ok, here are your options:
32bit kernel, 32bit user space:  Each process gets 3GB of virtual address
space.  The kernel can divvy that up however it wants.  You'll need to
enable highmem support for that.  If CPU performance isn't your bottleneck,
it won't matter that you don't get to use the extra registers.  You lose
maybe 15% CPU performance, depending on what you're doing.  (Compare SPEC
scores breakdowns for AMD's submission, if you're curious.)  This will be
the most stable configuration, because you can just install i386 Sarge, and
forget all about 64bit.  (Yes, Opterons support PAE and all that's needed
for a 32bit kernel to use lots of RAM.)  The kernel has to use bounce
buffers to move data around, because it can't map all the memory.  The
kernel uses the remaining 1GB of virtual address space for itself, and maps
all the RAM it can.  What's left is highmem.

64bit kernel, 32bit userspace:  Each process gets 4GB of virtual address
space.  Disadvantage:  you need a module-init-tools, iptables, and so on
that can talk to the kernel.  All the normal system calls by 32bit programs
go through a translation layer (not much overhead, don't worry) so you can
boot a 64bit kernel with root=/dev/path-to-i386-Sarge.  You can install some
64bit libraries, or make some statically linked binaries, so you can run a
few things 64bit.  statically linked AMD64 iptables might be the best way to
go.  (you can debootstrap a 64bit chroot so you can apt-get install the
stuff you need...  Use dchroot to make your chroot convenient).  The
ia32->amd64 kernel translation layer works well, so while it might not be as
stable as a fully i386 system, and you have to worry about special kernel
interfaces that don't get 32bit translated, you don't have to worry about
bugs in userspace programs like storing a pointer in an int variable.  On an
SMP system, the kernel will know about NUMA and be able to allocate memory
that's attached to the CPU the requesting process is running on.

64bit kernel, 64bit userspace:  Each process gets 64bit virtual address space.
 Same as above, but you have to worry about user-space too.  Not all
packages are available, and some of them have bugs because they truncate
pointers to 32bits in some places.  Just all around less stable still,
not to mention that AMD64 Debian might not release with sarge, so security
updates won't come from security.debian.org.  You can install libraries so
that you can run i386 binaries if you have any binary-only programs.  (32bit
code can't link to 64bit code at all, ever, on amd64.  (not counting special
translation layers like the kernel-userspace boundary).)  3D acceleration is
only possible with 64/64 kernel/user, or 32/32, if that matters to you.

32bit kernel, 64bit userspace: not possible.

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter@cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC



Reply to: