Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a production server with 16GB of RAM that came with a 32bit CentOs installation.

The website hosted on this server is increasing its traffic every day and I am having some MySQL trouble so I tried to check the MySQL configuration with mysqltuner.pl and gave me the following messages:

[!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***

So my question is: can I survive with the 32 bit? Or I will have to install the 64 bit OS?

Thanks.

share|improve this question
10  
I'm pretty sure the giant warning coming out of MySQL has answered this question for you already. There's pretty much no good reason to be using a 32-bit server OS on hardware released in the last five years. –  jgoldschrafe Oct 2 '12 at 11:00
2  
There's some rabid downvoting on this site lately. –  gravyface Oct 2 '12 at 11:14
3  
The warning is incorrect. MySQL can use all your RAM, it just can't map it, which makes its use of large amounts of RAM much less efficient than it would be with a 64-bit OS. –  David Schwartz Oct 2 '12 at 11:30
6  
@gravyface Some rabid upvoting too. 4 upvotes on a question asking whether it's a good idea to use a 64 bit OS, given: >4GB RAM and app warning saying "switch to 64 bit OS" seems pretty excessive to me. I guess I'll choose to believe that my "innate superiority" is what makes it seem like a trivial question to me. –  HopelessN00b Oct 2 '12 at 11:57
7  
Why the server didn't come with 64 bit in the first place is a major concern to me... –  tombull89 Oct 2 '12 at 12:00

3 Answers 3

up vote 22 down vote accepted

You can survive just fine with the 32 bit CentOS install. But, like the warning says, using a 32 bit OS means that MySQL can't actually use all (or even most of) the RAM installed in the system.

Seems like a waste to me. If the hardware supports 64-bit, I'd certainly replace the 32 bit OS with a 64 bit one, yeah. You'd probably want to do some testing first, and/or use a second server to find out what's going to break when you switch OSes, because something always does.

Strictly speaking, you don't need to install a 64 bit OS, but you definitely should. And probably sooner, rather than later, before the RAM limitations of a 32 bit OS start causing you problems.

share|improve this answer
1  
We should mention that this limit counts for every single process, however if mysql is the main task of this machine as that is a single process (with multiple threads) going 64 bit will be worth it. –  ZaphodB Oct 2 '12 at 13:07

Maximum virtual address space of a 32 bit binary is 2^32 (4GB) - once you hit this limit, you're going nowhere.

Should you switch to 64-bit? Absolutely.

Not only will you no longer hit the memory barrier, the generic 64-bit instruction set has generally better performance than generic 32-bit (due to the sheer age of x86) and thus, switching to x64 will give gains in terms of both memory and computational speed.

Obviously if you custom-compiled x86 binaries yourself with the arch target of your exact CPU, you could well find that performance compared to x64 is not all that different, however, since you're using pre-packaged CentOS binaries, obviously that's not the case.

share|improve this answer
1  
To be a little nitpicky, 32-bit OSes can/may be able to access RAM in excess of 4GB with PAE. Otherwise a spot-on answer, and +1 anyhow. –  HopelessN00b Oct 2 '12 at 12:08
5  
@HopelessN00b Yes, with PAE, the kernel can address all 16GB of RAM, but any particular process is still limited to a bit less than 4GB. –  Michael Hampton Oct 2 '12 at 12:16
4  
IIRC you can implement PAE at the application level as well; and that it used to be fairly common among DBs and other memory hungry server apps back before x86-64 hardware was common. However with it now ubiquitous PAE code branches are being deprecated/abandoned due to lack of use sufficient to justify continued development work. –  Dan Neely Oct 2 '12 at 12:39
1  
"...generic 64-bit instruction set has generally better performance than generic 32-bit (due to the sheer age of x86)" -- This is a dubious statement. While it's true that 64-bit code is generally faster than 32-bit code (for various reasons including register size, memory bandwidth, and better optimization), the performance difference has nothing to do with how long x86 has been around. In fact, x86_64 is an extension of x86 and it therefore could be argued that the instruction set's history stretches all the way back to 1986. :-) –  Justin ᚅᚔᚈᚄᚒᚔ Oct 2 '12 at 14:53
    
Justin: no. All x86_64 processors are guaranteed to have certain x86 extensions SSE, SSE2 and several others, thus enabling the compiler to utilise a significantly larger instruction set when targeting the generic x86_64 architecture vs. generic i(3|4|5|6)86 –  Olipro Oct 3 '12 at 15:33

Although answer has been accepted, there's a lot of stuff missing from the discussion here.

First: Alexandru does not mention what database engines are running on this machine, nor whether it's a dedicated DBMS server or if it's also running other stuff, nor what size the data is, nor any stats on physical I/O / VFS usage.

For a dedicated MyISAM based server, then you're not going to get much benefit from making more memory addressable. VFS does as good a job of caching the I/O as MySQL can. OTOH if it were innodb - then by golly, yes: the innodb buffer pool on a dedicated box should be around 80% of the phsyical memory on a dedicated machine.

Regardless of which DBMS is used, switching to 64bit has significant a performance benefit when doing comparison operations on the DBMS - how much depends on whether you're doing a lot of hash or b-tree based lookups.

If the same box is being used for webserving, then the big difference will be if you're using a lot of SSL on the box - SSL is all about calculating large numbers - so even without the AES acceleration in recent intel chips there's an improvment there too.

share|improve this answer
    
I am serving a Real Estate website that you can see here bit.ly/fwTEsT , so the server is doing all sorts of things. Database, serving website, image resizing, cron jobs, sending mails and so on. I have finally decided to take advantage of this situation and change the hosting to a dedicated server in the same country the business is. That server will have the 64bit OS installed already. –  Alexandru Trandafir Catalin Oct 5 '12 at 12:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.