title: Stateful Interprocess communication for Node.js
body: <p>I may be missing an obvious trick here but...</p>
  
  <p>Is there anyway for 2+ node.js processes to exchange messages in a stateful fashion?
  As an example: 
  process A is an HTTP server that fields incoming external http requests, to fulfil these requests it needs to get information from either process B or C. Currently I have 'A' opening a TCP/IP connection for each request to 'B' or 'C' which are listening on a suitable port.</p>
  
  <p>This seems completely sucky and alot of overhead as each request requires lots of overhead to open a socket and close it, yet without opening a socket per request I cannot see a way to make sure that a response from the either 'B' or 'C' are bound to the correct HTTP response.</p>
  
  <p>All processes are in nodejs, B + C have a long startup time (30+ seconds) so spawning them per request isn't an option. All processes are currently running on the same box (dual core).<br>
  In terms of protocol all I'm using is basic '<a href="http://nodejs.org/api/net.html" rel="nofollow">net</a>' server as described in the nodejs docs and throwing text across it. </p>
  
  <p>Any suggestions etc gladly accepted</p>