1

I have a relatively small and happy MySQL 5.1 database living on a FreeBSD 7.1 64bit install. Because of incompatibility with our backup software and FreeBSD, I have to move the databases to a Linux server.

Since we run Debian on everything else here I'm going to settle for that. The big question is if I should run 32bit or 64bit. It's a virtualized enviroment, so hardware doesnt play a role in this.

Will I get any performance gain (or loss) by using 64bit linux+64bit MySQL with little memory assigned (lets say 512M to be extreme)? Should I just use 32bit until the day I need to assign more than 2GB RAM to MySQL (PAE does not help, 32bit MySQL can not use more than 2GB)?

pauska
  • 19,766

4 Answers4

8

You already answered the question yourself.

If you are 100% percent positive not to grow beyond 2GB of RAM usage in the current hardware lifecycle you can stay with 32bit, when the time comes to replace your hardware you will have to reconsider anyway.

Given the current hardware market I don't see a real reason not to use 64 bit it will be the safe side in case of unforseen growth, that is true for cache as well as real data size. After all a full migration will take somewhat longer than just taking the box down and adding some RAM.

Drawbacks could be that pointers on a 64bit system use about 30% more memory but that won't really hurt you if you really stay on the small side of memory usage, but on the other hand if you grow you will be able to grow more quickly (at least as long as you can stay on the same hardware box)

serverhorror
  • 6,538
4

64bit. If for some reason you get a request that blows the database needs beyond the 512, you can just add some cheap ram and be done with it. No reinstall, etc.

Dayton Brown
  • 1,549
1

Running Mysql 5 or later on a 64bit OS is usually worth it regardless of the memory you're addressing because of the internal use of 64 integers in the database. Unless you're trying to fit your install into a tiny amount of RAM there is almost no reason to choose a 32bit install of Mysql.

kashani
  • 3,942
0

I think that what is more important than choosing 32bit or 64bit is:

  1. Make sure you are using LVM or some storage technique that will allow you to make backups of your data via snapshot. (Yes, even with MyISAM you can flush with lock, snap, release)
    1. I can move an active DB from on a 32bit system to a beefier one on a 64bit system with 0-5 minutes downtime.
    2. With this flexibility, I would choose to start out 32bit. If I didn't have it, I would likely go 64bit to be safe.
  2. Consider what else may need to run on the system. You may find that some other program you are wanting to run is 32bit only.

That is how would make my decision. I wouldn't "choose" an architecture. I would compare my case against a logic tree like that.