isaacs / cluster-master

Take advantage of node built-in cluster module behavior
ISC License
276 stars 44 forks source link

What is "256MB RSS cap" #26

Closed Petah closed 9 years ago

busticated commented 9 years ago

@Petah many VPS (virtual private server) environments run multiple apps (aka tenants) on the same physical hardware - that is, all apps on a given VPS share the same CPU, memory, etc. The docs are simply warning you to consider the memory available to your app when determining the number of workers to spawn. If you blindly spin up the same number of workers as CPUs, you could end up with poor performance b/c each worker is memory constrained (or in some cases, additional charges or automatic shut-down due to exceeding the memory limit of your VPS plan).

not an endorsement but heroku explains this fairly well here (w/ memory behavior detail here)

isaacs commented 9 years ago

Exactly.

This is especially tricky in some virtualization implementations that expose the number of CPUs on the machine (say, 16 or 64 or whatever huge number) but only give you a tiny slice of the RAM, and penalize you for going over it. So you probably want to spin up maybe 8 workers, rather than 64, which will use up all your resources.