views:

2668

answers:

6

I'm in the process of selecting an AMI for my website on the Amazon EC2 network. It seems like the Ubuntu instances come in either 32 or 64 bit flavors. Presumably the 64 bit systems give you more memory address space, which is good. However, I'm wondering if it is a problem finding pre-compiled binaries. Am I better off sticking with 32 bit? My web application is not terribly memory intensive.

Why would I select one over the other and what are the pros and cons?

+4  A: 

One issue that crept up on my team during a 64-bit deployment was the fact that the pointers on a 64-bit machine are bigger, so we ran out of memory faster than we thought we would.
Not an answer, I know, just a heads up.

RKitson
This is a big concern when memory is constrained; I've regularly seen Rails apps take 80% more memory on 64-bit systems than 32-bit. Yes memory is cheap, but if you've got to spend twice the money, it's still a significant cost.
womble
A: 

64 bit gives you more memory address space and can perform better at processor intensive tasks. Finding binaries shouldn’t be a problem assuming your using standard software like PHP and Mysql. I’d go with 64 bit unless you have some rare libraries that may not run under 64 bit.

Jared
+1  A: 

Con: like RKitson says, 64bit pointers take double as much memory space. This may cost performance if it means your stuff doesn't fit in the CPU cache now.

Pro: you get double as many registers - programs that benefit from that will show a lot of performance improvement. (and a second pro: 64bit versions of packages are all compiled with SSE support... this could also enhance performance, depending on your workload)

I would just build both images and benchmark them, that's easier than theorizing, and shouldn't cost days either.

yungchin
+5  A: 

You should make your decision based on the size of the servers you want.

32-bit AMIs only run on m1.small, while 64-bit AMIs only run on m1.large and m1.xlarge instances (plus the respective High CPU variants).

Larger instances obviously cost more money, with price theoretically scaling linearly with performance. However, I've found that large and xlarge instances actually have a little more performance / dollar than small instances.

Rather than being due to 32- or 64-bit architecture, this seems to be due to contention on I/O controllers. If you're doing serious work on EC2, I'd recommend going with m1.large instances, and the 64-bit AMIs that that entails.

Alabaster Codify
A: 

I would say go with 32-bit unless you really need 64-bit for performance reasons. You can run 32-bit Ubuntu on an m1.small instance costing 10c / instance hour, or about $75 / month; by contrast, the cheapest option for 64-bit is m1.large, which costs four times as much - 40c / instance hour or about $300 / month.

gareth_bowles
A: 

If cost is priority go for 32bit. If performance is important go for 64bit.

Sharique