Virtualization: 64-bit or 32-bit?

9,943

Solution 1

Are there any benefits or disadvantages between 64-bit and 32-bit virtualization, except the 4 gigabyte memory limit on 32-bit machines.

There are a number of advantages to running in a 64 bit environment. The biggest is, as you say, the ability to address large amounts of memory. While you can get your 32bit kernel to address more than 4GB of RAM, individual processes will still be limited to 4GB. This affects not just "real ram", but their entire virtual address space...which is a particular problem if applications plan to make extensive use of virtual memory via mmap() or other techniques. The varnish http cache is a prime example of this. Discussed here and elsewhere.

This article from AMD (warning: PDF) discusses 64-vs-32 bits in some detail.

There are theoretical performance advantages to a 64 bit systems caused by more registers, wider memory fetches (that is, more bits read per read operation), and so forth, but the data I've seen so far suggests that performance of 32 vs. 64 bits isn't currently much of a reason to select one or the other.

Solution 2

The 32bit guest will use less memory. I generally use 32bit guests on my 64bit host unless I have a specific reason. If you need the high memory then go 64.

Solution 3

One consideration is the RAM requirements of the virtual machine. You will find that MySQL and Lighttpd use more memory in 64bit Ubuntu compared to 32bit Ubuntu.

So I like to use 32bit installations on small VMs with little RAM, such as 512 or less. You would see these lower end configurations often with many VPS providers like linode or slicehost.

Share:
9,943
Jonathan Egerton
Author by

Jonathan Egerton

Updated on September 17, 2022

Comments

  • Jonathan Egerton
    Jonathan Egerton over 1 year

    I'm going to install Ubuntu 10.04 Server in a virtual machine and want run MySQL and Lighttpd on it.

    Are there any benefits or disadvantages between 64-bit and 32-bit virtualization, except the 4 gigabyte memory limit on 32-bit machines.

    I use Virtualbox.

    • Jonathan Egerton
      Jonathan Egerton over 13 years
      It's Windows 7 64-bit.
  • Reece45
    Reece45 over 13 years
    It really depends on the application. MySQL ran a lot better on 64-bit with the same hardware (I hear its because it uses a lot of 64-bit integers internally, I've never looked for myself). If an application uses >2GB of RAM it's usually faster as 64-bit as well. Most applications don't use that much memory or use many 64-bit integers. For the ones that do, its much faster.
  • user2751502
    user2751502 over 13 years
    @AlReece45 That's what I said. Some applications benefit from 64 bit architectures, others less so. I was not able to find any good data regarding performance differences between the two architectures; if you're aware of actual numbers I'd appreciate a pointer because there appears to be a lot of really bad information out there propogated by people who say things like, "32 bit are faster" or "64 bits will use more memory", etc., without backing up such statements.
  • user2751502
    user2751502 over 13 years
    do you have a link to these benchmarks?
  • Ronald Pottol
    Ronald Pottol over 13 years
    osnews.com/story/5768 for the SPARC benchmarks. I thought the advantage was bigger.