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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
04-18-2014, 01:49 PM
|
#1
|
Member
Registered: Oct 2013
Posts: 532
Rep: 
|
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
|
|
|
04-18-2014, 02:06 PM
|
#2
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,676
|
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
|
|
|
04-18-2014, 02:25 PM
|
#3
|
Senior Member
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982
|
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.
|
|
|
04-18-2014, 02:31 PM
|
#4
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
Quote:
Originally Posted by postcd
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
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
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 02:38 PM.
|
|
|
04-18-2014, 02:56 PM
|
#5
|
Member
Registered: Oct 2013
Posts: 532
Original Poster
Rep: 
|
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
??
|
|
|
04-18-2014, 03:39 PM
|
#6
|
Senior Member
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982
|
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.
|
|
|
04-18-2014, 04:05 PM
|
#7
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,099
|
Undoubtedly, the CPU and motherboard is 64-bit. Therefore, a 64-bit OS should be used.
|
|
|
04-18-2014, 05:03 PM
|
#8
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
Quote:
Originally Posted by postcd
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
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 05:21 PM.
|
|
1 members found this post helpful.
|
04-19-2014, 10:56 AM
|
#9
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
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.
|
04-19-2014, 09:18 PM
|
#10
|
Moderator
Registered: Mar 2008
Posts: 22,301
|
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 09:21 PM.
|
|
|
04-19-2014, 09:34 PM
|
#11
|
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675
Rep: 
|
You can use x32 ABI on a 64-bit system if you are worried about resources. http://en.wikipedia.org/wiki/X32_ABI
|
|
|
04-19-2014, 09:51 PM
|
#12
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,099
|
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.
|
04-20-2014, 07:37 AM
|
#13
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
Quote:
Originally Posted by sundialsvcs
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.
|
|
|
04-20-2014, 08:01 AM
|
#14
|
LQ Guru
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 5,058
|
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.
|
04-20-2014, 09:00 AM
|
#15
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
Quote:
Originally Posted by enorbet
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 09:04 AM.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 10:47 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|