LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-18-2014, 12:49 PM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
64bit or 32bit linux for 4gb ram server?


Hello,

the virtual server with 4Gb ram, in future will be upgraded to more ram.
Is it better to use 64bit CentOS or 32bit?

I listen 64 takes more memory..

Thank you
 
Old 04-18-2014, 01:06 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
for a server
servers host many sites

there is NO choice 32 bit is incapable of handling traffic

64 bit os's have been used for the last 12 years or more

use 64 bit
 
Old 04-18-2014, 01:25 PM   #3
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
64-bit RAM usage is usually only 20-30% higher than 32-bit usage. This is not a reason to use 32-bit. RAM is relatively cheap so just buy some more if you have problems.
 
Old 04-18-2014, 01:31 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by postcd View Post
Is it better to use 64bit CentOS or 32bit?
Probably it will make very little difference. In the unlikely event that it does make a significant difference, probably 64-bit will be better.

Quote:
I listen 64 takes more memory..
If you use only 64 bit applications on a 64-bit OS, that consumes a little more ram than using only 32-bit applications on a 32-bit OS.

If you mix 32-bit and 64-bit applications on a 64-bit OS, that takes a larger amount of extra ram compared to only 32-bit applications on a 32-bit OS.

But either way we are talking about a pretty trivial fraction of 4GB. Other decisions you make will be more important in conserving ram if you even have any need to conserve ram.

Quote:
Originally Posted by John VV View Post
for a server
servers host many sites

there is NO choice 32 bit is incapable of handling traffic
The word "server" can mean a wide range of things and within each a wide range of possible load. On a system with just 4GB of ram it may be conceivable, but is quite unlikely that a server running a 32-bit OS would be unable to handle the amount of traffic, while a server running a 64-bit OS would be able.

Quote:
64 bit os's have been used for the last 12 years or more

use 64 bit
I don't disagree with that overall advice, just with the idea that there are powerful reasons behind that conclusion.

Maybe a 32-bit OS would make the server a little faster and able to handle a little more load than with a 64-bit OS. Maybe the other way around. Most likely very little difference.

Quote:
Originally Posted by metaschima View Post
64-bit RAM usage is usually only 20-30% higher than 32-bit usage.
That is very misleading. It depends enormously on the use of the system. Executable code is typically bigger in 64-bit and maybe by 20%-30%. But executable code is typically a small fraction of total ram use on a system with 4GB or more of ram. Certain less common kinds of data are 100% bigger in 64-bit applications compared to 32-bit. But text and graphics and sound and numeric data and most other kinds are all exactly the same size in 64-bit as 32-bit. If your ram is 90% consumed by typical data that is the same size, then your overall ram use can only be a few % different between 32-bit and 64-bit. That is the common case for a 4GB server. A significant difference in ram use is an uncommon case.

Last edited by johnsfine; 04-18-2014 at 01:38 PM.
 
Old 04-18-2014, 01:56 PM   #5
postcd
Member
 
Registered: Oct 2013
Posts: 527

Original Poster
Rep: Reputation: Disabled
Exclamation

Thx, please why no one mentioned 32bit OS can handle only less than 4GB memory? Or is it not truth?
"Yes, a 32-bit architecture is limited to addressing a maximum of 4 gigabytes of memory."
Source: http://stackoverflow.com/a/8869596

??
 
Old 04-18-2014, 02:39 PM   #6
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
With 4 GB you would still need PAE to use all 4 GB in 32-bit. PAE is a hack to get around the 32-bit addressing restriction.

I think 20-30% more RAM is a reasonable estimate based upon my tests. It is certainly more accurate than people out there saying 64-bit programs use twice as much RAM as 32-bit. I agree that it varies and can be less or more than my estimate. I've never seen any 64-bit program use twice the RAM of 32-bit. I have seen programs use almost the same amount of RAM in 32-bit and 64-bit.
 
Old 04-18-2014, 03:05 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,632
Blog Entries: 4

Rep: Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931
Undoubtedly, the CPU and motherboard is 64-bit. Therefore, a 64-bit OS should be used.
 
Old 04-18-2014, 04:03 PM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by postcd View Post
Thx, please why no one mentioned 32bit OS can handle only less than 4GB memory? Or is it not truth?
It depends what you mean by "memory", but for practical purposes it is just not true.

A 32-bit OS limits each process to 3GB of address space. It does not limit the system to 4GB of ram.

A server likely runs many different processes and it also has caching and other ram needs outside the address space of any one process. So the limit of 3GB address space per process usually makes no difference.

What kind of "server" are we talking about? Exactly what service software will be running? There are some "service" programs that concentrate almost everything into a single process. Even with almost everything in one process, there is enough ram use outside that process that a system with just 4GB of ram is likely OK with the 3GB limit per process. But you said there would be more ram added later. If almost everything is in a single service process, a system with 6GB of ram would not be OK with the 3GB limit per process.

Most "service" software does not put almost everything into a single process. They run multiple processes sharing the code and dividing the work and the data. In that case, the 3GB limit per process probably does no harm even on a system with 16GB of ram.

Quote:
Originally Posted by metaschima View Post
PAE is a hack to get around the 32-bit addressing restriction.
PAE is not a "hack" and it is not a way around 32-bit addressing.

All addressing on X86 Linux systems (32 bit or 64 bit OS's and with or without PAE) goes through page mapping. Every address, whether in a user process or in the kernel, is translated from "virtual" to "logical" by that mechanism.

The virtual addresses used within a 32-bit program are inherently 32-bit. There is no (hack or otherwise) way around that. The virtual addresses used within a 64-bit program are inherently 64-bit.

The translation mechanism, that converts virtual address to logical address, contains no fundamental assumption that a virtual address and a logical address are the same size. In non PAE 32-bit, a logical address happens to be 32-bits. In PAE 32-bit, a logical address happens to be 36-bits. In 64-bit OS mode, logical address sizes are larger than 36-bits and smaller than 64-bit. Their exact size varies among models of 64-bit CPU. Barely any kernel code needs to be concerned with the size of a logical address and no user code needs to care.

The 32-PAE page translation data structures are very similar (in detail) to the 64-bit page translation data structures. The 64-bit are just a tiny amount more complicated and have a tiny amount more overhead.

The 32-bit non PAE page translation data structures are similar in concept and basic mechanism to the above two, but differ from the above two in much more of the details than the above two differ from each other.

There are frequent statements in this forum that imply some page translation is necessary with PAE and not necessary without PAE. That is nonsense. The same basic page translation is always there: 32-bit non-PAE, 32-bit PAE, or 64-bit. It is all fundamentally the same. In a tiny implementation detail, 32-bit PAE is more similar to 64-bit than it is to non-PAE 32-bit.

Last edited by johnsfine; 04-18-2014 at 04:21 PM.
 
1 members found this post helpful.
Old 04-19-2014, 09:56 AM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Why restrict yourself to 32-bit?

Sure the system right now might only have 4 GB of RAM, and might not be running any processes right now that use more than 3 GB of RAM, but are you positive that's never going to change? With a 64-bit OS, just add more RAM and you're good to go. With a 32-bit OS, you might have to re-install the entire OS if the usage of the system changes for whatever reason a few years down the road.
 
1 members found this post helpful.
Old 04-19-2014, 08:18 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
I doubt you'd ever notice one or the other if you tested 1000 systems. You can easily set up one and then set up the other and run some tests to see. It would be system dependent as to the best. All parts of your system may either help or hurt this result.

There is very little to be gained either way.

If we knew use, load, hardware, apps and such we might be able to guess better but the only way to tell would be a live test.

Almost all distro's either offer PAE standard or have it as an option.

Last edited by jefro; 04-19-2014 at 08:21 PM.
 
Old 04-19-2014, 08:34 PM   #11
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You can use x32 ABI on a 64-bit system if you are worried about resources. http://en.wikipedia.org/wiki/X32_ABI
 
Old 04-19-2014, 08:51 PM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,632
Blog Entries: 4

Rep: Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931
I repeat ... you should use an operating system that is correct for the native architecture of whatever chip you have.

Otherwise, you would be forcing a 64-bit native chip to run in "32-bit compatibility mode." Which is roughly equivalent to forcing a car to emulate a bicycle.
 
2 members found this post helpful.
Old 04-20-2014, 06:37 AM   #13
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by sundialsvcs View Post
Otherwise, you would be forcing a 64-bit native chip to run in "32-bit compatibility mode." Which is roughly equivalent to forcing a car to emulate a bicycle.
Don't let the facts stand in the way of powerful analogy.
 
Old 04-20-2014, 07:01 AM   #14
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,780

Rep: Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431
I have to say it kinda cracks me up when I'm not dismayed by all the misinformation about 64bit Linux vs/ 32bit w/PAE. Not one person has asked exactly what will this server be doing. If, for example, it is a game server that must also handle Wine games, I contend that 32bit version is considerably better... at the very least substantially easier to build, configure, and maintain. PAE can handle up to 64GB of ram. The only reason people get hung up on this 4GB "limitation" is because of Windows XP and it's 4GB limitation which is strictly a licensing restriction and choice. It is best to use the right tool for a given job so it depends entirely on what job(s) this server will be asked to perform. For some, 64bit is undeniably better, but the reverse is also true.
 
1 members found this post helpful.
Old 04-20-2014, 08:00 AM   #15
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by enorbet View Post
Not one person has asked exactly what will this server be doing.
I thought I asked that in post # 8. But we haven't heard from the OP since then.

Quote:
If, for example, it is a game server that must also handle Wine games, I contend that 32bit version is considerably better... at the very least substantially easier to build, configure, and maintain.
I never tried any games in wine, so maybe I'm missing something. But wine support for win32 is easy (and default) when you install wine on a 64-bit Linux.

Quote:
PAE can handle up to 64GB of ram.
In theory. But in practice it doesn't work up to 64GB because the limit on kernel virtual address space becomes unmanageable. Long ago (RHEL 4) there was a really ugly kludge used in addition to PAE to fix the kernel virtual address space limit and really support 64GB physical ram. But that kludge was clearly inferior to using a 64-bit kernel on any 64-bit capable CPU. I don't know if that is even still a kernel build option. No distribution still supports it (in their distributed kernels).

The OP was talking 4GB now, and some more later. So PAE should cover it and theory about whether PAE is OK for over 16GB is not relevant.

Quote:
Windows XP and it's 4GB limitation which is strictly a licensing restriction and choice.
Mainly licensing, but: Windows has a less modular interface between drivers and kernel, which made it harder to adapt many drivers to work with 32-bit systems over 4GB. Linux driver problems with PAE were fixed early and thoroughly. Many Windows drivers were never fixed. So in addition to a special license for 32-bit Windows supporting over 3 and fraction GB of ram, you also are very restricted in devices because so many drivers won't work.

Quote:
For some, 64bit is undeniably better, but the reverse is also true.
Especially with code compiled by GCC or by current versions of other compilers, I think it is quite hard to find the situation in which it is significantly better to use a 32-bit kernel on a 64-bit system with 4GB or more of ram. (An obsolete version of the Intel C/C++ compiler was dramatically better than current 32-bit x86 compilers, and using that eliminated one of the fundamental advantages of 64-bit, letting the other advantages of 32-bit sometimes matter more).

Sure you can find lots of situations in which choosing a 32-bit kernel would make the server a trivial amount faster. But finding a case where 32-bit is significantly faster is difficult.

Cases where 64-bit is significantly faster than 32-bit are also somewhat rare. But they are not terribly rare. It is a real possibility to consider when making the choice.

Last edited by johnsfine; 04-20-2014 at 08:04 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can I use 64-bit Mint with VMware Player and Win8 64bit host with only 4gb ram? martingifford Linux - Virtualization and Cloud 2 12-22-2013 05:39 PM
4GB ram in fedora 14 32bit jokar.mohsen Linux - Hardware 7 05-10-2011 05:17 PM
Using 4GB ram on a 32bit Slackware 13.1 Squall90 Slackware 6 09-18-2010 11:06 AM
Will 64bit Ubuntu use 4gb of Ram when runnin a 32bit VM Windows Environment? Enicko Linux - Newbie 1 02-24-2009 03:48 PM
which 64bit distro supports 4gb ram and the ati fglrx video driver togther Shadowmeph Linux - General 33 11-29-2008 06:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration