Should I use 64bit or 32bit of node

4,722 views
Skip to first unread message

Ket

unread,
Nov 23, 2013, 10:33:04 PM11/23/13
to nod...@googlegroups.com
Sorry for a dumb question. I'm not an IT guy so I don't know the different of the two.
I've a 2GB RAM server on a2hosting.com and planned to upgrade in a near future.
Which package is better suit for me.

PS. I run a 32bit package previously. But I've reinstalled Ubuntu and have to restart the whole thing.
Thank you,

Ben Noordhuis

unread,
Nov 24, 2013, 6:27:08 AM11/24/13
to nod...@googlegroups.com
You should pick the 32 bits version if your system is one of those
budget VPSs that have 128 or 256 MB of RAM.

Else, just stick with what's native to your operating system. Running
a 32 bits binary on a 64 bits operating system is certainly possible
but system call performance generally takes a hit.

The differences are usually not earth shattering though and probably
nothing compared to the overhead that file and network I/O have in
most virtualized environments. But, when in doubt, benchmark.

Mark Hahn

unread,
Nov 24, 2013, 2:08:09 PM11/24/13
to nodejs
 Running a 32 bits binary on a 64 bits operating system is certainly possible but system call performance generally takes a hit.

I thought it was the opposite.  All 64-bit does is give you more address space.  64-bit is slower because the code is larger and fewer instructions fit in cache.


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ben Noordhuis

unread,
Nov 24, 2013, 6:14:55 PM11/24/13
to nod...@googlegroups.com
On Sun, Nov 24, 2013 at 8:08 PM, Mark Hahn <ma...@reevuit.com> wrote:
>> Running a 32 bits binary on a 64 bits operating system is certainly
>> possible but system call performance generally takes a hit.
>
> I thought it was the opposite. All 64-bit does is give you more address
> space. 64-bit is slower because the code is larger and fewer instructions
> fit in cache.

It's more nuanced than that. Instructions that deal with immediate
values are larger but position independent code tends to be smaller
and more efficient due to RIP-relative addressing.

There are more registers so data gets spilled to the stack less often.
Ditto for function calls, there's more opportunity to pass arguments
in registers.

The reason why system call performance suffers with 32 bits binaries
on 64 bit hosts, is that every system call goes through a thunk that
switches modes and converts arguments and the return value.

Mark Hahn

unread,
Nov 24, 2013, 6:50:05 PM11/24/13
to nodejs
Thanks ...


Ket

unread,
Nov 24, 2013, 7:35:02 PM11/24/13
to nod...@googlegroups.com
Thanks, after some research. I picked the 64 bit package.
Reply all
Reply to author
Forward
0 new messages