Kevin Ingwersen (Ingwie Phoenix)
unread,Apr 11, 2015, 10:46:12 PM4/11/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nod...@googlegroups.com
Hey.
Imagine you have the following structure:
main
* http worker#1
* http worker#2
* api worker#1
This is a structure that can easily be done with the cluster module. But what if we have one major watchdog process and the structure changes to this?
watchdog
- http server
* worker#1
* worker#2
- api server
* worker#1
This would require the watchdog process to fork() into two separate processes that it can savely watch. Then, these subprocesses would have to fork() N times for their workers.
When we now use cluster.isMaster and cluster.isChild… what behaviour could be expected from the above structure? I saw C programs doing a fork-in-fork mechanism, but not in NodeJS, especially since in this case, a script is ran again from top to bottom - and not just copied into new memory and executed at the same point, like it happens in POSIX fork() and php-pcntl pcntl_fork().
Kind regards, Ingwie