开发者

Benefits of a 64 bit Machine for Hosting your Web Application

I am about to buy a server, before I do so, I just wanted to ask the SO community on its thoughts of a 32 bit server or a 64 bit server and its advatnages on a LAMP stack.

1) Is it difficult to install Apache, MySQL and PHP on a 64 bit machine or is it the same as a 32 bit machine?

2) Are there any performance gains of having a 64 bit machine rather than a 32 bit machine when it comes to a simple web application?

Apart from Create, Read, Update and Delete on a MySQL database, my application will be generating png images using PHP.

Just to let you know, there is no point of having a 32 bit OS installed on a 64 bit machine. See this great article.

3) Finally any other benefits or disadvantages of opting for a 64 bit machine?

Thanks all for any insight into this.

N.B. This d开发者_StackOverflowoesn't belong on serverfault, as I don't have a problem with my yet to buy server. :)


edit 2015

A few years back, the installation of a 64 bits server could have been a risky operation. 64 bits OSes were new, less tested, and only a few 64 bits applications were available.

And later, a couple of years ago (around 2010), installing Redhat and Ubuntu 64 bits on several production servers to run Apache/nginx, Mysql, PHP was still a bit worrying. But finally, the installation of the OS and the various applications went flawlessly. Having me wondering and checking if I really installed a 64 bits version!

Nowadays 64 bits is the default for most OSes running on desktops/laptops.

Some advantages of a 64 bits web server

  • Performance gain. Thanks to the width of the data that can be processed at once by the processor. For instance dealing with 64 bits of memory instead of 32, but that gain is very linked to the running applications and may not be that sensible depending on the data structure.

  • Memory addresses range. An important advantage is that with a 64 bits OS, you are not limited anymore to 4 GB of RAM. A 64 bits OS may potentially address 264 bytes in memory - no computer on Earth has that much memory currently!

  • Some applications behave differently on 32 bits and 64 bits. Web wise, PHP integers have 32 bits (232 values) on 32 bits OSes, and 64 bits (264 values) on 64 bits OSes ; this might be a problem when running 3rd party programs on a 32 bits OS that were initially written by a developer working on a 64 bits OS (who is unlikely to meet bugs due to the 32 bits integer limitation).

One disadvantage of running a 64 bits OS / web server is the size of the executables, that take usually some more space on disk and when running in memory.

Please see this link and read also the comments at the bottom.


Installation difficulty is no different, use in practice is identical.

The main difference is that you can give more than 3G of memory to each process, which is really important for things like MySQL where you want to allocate heaps of memory.

You should definitely buy some hardware, but don't put it in production - leave it in your test lab and try various software combinations on it.

In general 64-bit code will run a bit slower (it is bigger, and its data structures are bigger, and the cache size is the same), but that could easily be offset by being able to use proper sized caches for (e.g.) mysql.

If you are optimisation-obsessed and really thing you need the extra grunt, it is possible to run 32-bit code on a 64-bit OS.

32-bit OSs CAN use more than 4G of ram (contrary to popular belief) - possibly even in Windows (some versions). We used to run 32-bit boxes with 32G of ram each.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜