Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
multiple applications in single node.js process
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alexey Guskov  
View profile  
 More options Oct 13 2012, 5:29 am
From: Alexey Guskov <kvasdo...@gmail.com>
Date: Sat, 13 Oct 2012 02:29:16 -0700 (PDT)
Local: Sat, Oct 13 2012 5:29 am
Subject: multiple applications in single node.js process

Hello everybody. I'm a huge fan of node.js and ve're actively using it in
our project for creating various services.

Recently we've faced a problem of significant ram overhead required to run
each node.js instance (about 40Mb). This is an issue since we are running a
number of different node.js services on one machine, and the memory is
limited.

So what we trying to use is run multiple services in single node.js process
using vm.runInNewContext(), but compared this approach is missing some
functionality:

1) We cannot monitor amount of memory allocated by each subprocess.
2) We cannot cancel all setTimeouts and process.nextTicks for given process
to effectively stop its execution.
3) We cannot get a list of open sockets and file descriptors for given
process.

With this functionality we could use node.js similar to erlang - run a
number of processes inside a single vm - and use some erlang features (like
'let it fail') that would certanly lead us to world domination ;)

So, is there any projects targeted to solve similar problem?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bradley Meck  
View profile  
 More options Oct 13 2012, 9:00 am
From: Bradley Meck <bradley.m...@gmail.com>
Date: Sat, 13 Oct 2012 06:00:41 -0700 (PDT)
Local: Sat, Oct 13 2012 9:00 am
Subject: Re: multiple applications in single node.js process

Isolates were taken a look at a while ago. They are similar to what you
want, but still unable to do so. It would generally be more sane to just
scale out processes was what was decided. The edge cases of giving multiple
"light weight" isolates proved to be very difficult to prevent Isolates
from affecting each other (env variables, cwd, ulimits, etc.). If you are
running large numbers of processes and having memory issues I might
recommend you look into where that memory is coming from, node itself is
around 10Mb overhead. The rest is most likely some kind of cache or
non-GCable objects in your application. Note: Code source is cached, and
coffeescript can compound things in unexpected ways (not always bad,
inspect yourself).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Kocharin  
View profile  
 More options Oct 13 2012, 9:09 am
From: Alex Kocharin <a...@kocharin.ru>
Date: Sat, 13 Oct 2012 17:09:36 +0400
Local: Sat, Oct 13 2012 9:09 am
Subject: Re: [nodejs] multiple applications in single node.js process
Hello Alexey,
š
2 and 3 is quite doable using domains, and 1st could be achievable with v8 debugger.
š
It's a hack, but nevertheless it's possible, if all your processes follow some rules and don't mess with each other. But I'm afraid that an infinite loop in a service will screw the whole process anyway.
--
// alex
š
š
13.10.2012, 13:29, "Alexey Guskov" <kvasdopil@gmail.com>:
Hello everybody. I'm a huge fan of node.js and ve're actively using it in our project for creating various services.
Recently we've faced a problem of significant ram overhead required to run each node.js instance (about 40Mb). This is an issue since we are running a number of different node.js services on one machine, and the memory is limited.
So what we trying to use is run multiple services in single node.js process using vm.runInNewContext(), but compared this approach is missing some functionality:
1) We cannot monitor amount of memory allocated by each subprocess.
2) We cannot cancel all setTimeouts and process.nextTicks for given process to effectively stop its execution.
3) We cannot get a list of open sockets and file descriptors for given process.
With this functionality we could use node.js similar to erlang - run a number of processes inside a single vm - and use some erlang features (like 'let it fail') that would certanly lead us to world domination ;)
So, is there any projects targeted to solve similar problem?

š

--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexey Guskov  
View profile  
 More options Oct 14 2012, 1:29 pm
From: Alexey Guskov <kvasdo...@gmail.com>
Date: Sun, 14 Oct 2012 10:29:13 -0700 (PDT)
Local: Sun, Oct 14 2012 1:29 pm
Subject: Re: [nodejs] multiple applications in single node.js process

Yep i see, timers and fds must be accessible via domain.members, but
process.nextTick() tasks aren't there, am i wrong?

I'll investigate what we can achive with debugger, thanks for the idea.

суббота, 13 октября 2012 г., 17:09:58 UTC+4 пользователь Alex Kocharin
написал:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexey Petrushin  
View profile  
 More options Oct 15 2012, 1:50 am
From: Alexey Petrushin <alexey.petrus...@gmail.com>
Date: Sun, 14 Oct 2012 22:50:29 -0700 (PDT)
Local: Mon, Oct 15 2012 1:50 am
Subject: Re: [nodejs] multiple applications in single node.js process

Not direct solution to a problems, but an interesting approach -
node-fibers - it allow to use try/catch, it simplifies error handling.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexey Guskov  
View profile  
 More options Oct 15 2012, 2:44 pm
From: Alexey Guskov <kvasdo...@gmail.com>
Date: Mon, 15 Oct 2012 11:44:49 -0700 (PDT)
Local: Mon, Oct 15 2012 2:44 pm
Subject: Re: multiple applications in single node.js process

By the way, i believe the way google chrome deals with multiple pages and
browser addons is very similar to what i'm trying to achieve: isolated js
vm instances inside a single process. If anyone knows chrome internals,
please correct me.

суббота, 13 октября 2012 г., 13:29:17 UTC+4 пользователь Alexey Guskov
написал:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michal Kruk  
View profile  
 More options Oct 16 2012, 3:15 am
From: Michal Kruk <kru...@gmail.com>
Date: Tue, 16 Oct 2012 09:15:13 +0200
Local: Tues, Oct 16 2012 3:15 am
Subject: Re: [nodejs] Re: multiple applications in single node.js process

Actually chrome has multiple processes running, i think its creating one
for every tab you have open


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexey G  
View profile  
 More options Oct 16 2012, 10:20 am
From: Alexey G <kvasdo...@gmail.com>
Date: Tue, 16 Oct 2012 18:20:38 +0400
Local: Tues, Oct 16 2012 10:20 am
Subject: Re: [nodejs] Re: multiple applications in single node.js process

Thats' right, but it's doesn't always create a separate process, sometimes
multiple tabs run in single process (when they're from same domain and from
same origin). Besides, chrome addons certanly live in same process, but are
somehow isolated from each other and js in pages. I suppose they're created
by single vm, memory overhead would be significant otherwise.

Anyway, it must be possible to create multiple vm's in v8 and isolates
feature seems to be what i'm looking for. It's not implemented, however,
and i don't know if it will be. So for now i'll take a look on what can be
done with domains.

2012/10/16 Michal Kruk <kru...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ted Young  
View profile  
 More options Oct 16 2012, 1:16 pm
From: Ted Young <t...@radicaldesigns.org>
Date: Tue, 16 Oct 2012 10:15:45 -0700
Local: Tues, Oct 16 2012 1:15 pm
Subject: Re: [nodejs] multiple applications in single node.js process

It was implemented, then removed.  The instability and added complexity was determined to be not worth it at the time.

Ted

On Oct 16, 2012, at 7:20 AM, Alexey G <kvasdo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »