4 ms·
I am interested to see some solutions with Node.js. From my experience (I built a lightweight protocol for multiplayer game with Node.js), it is super easy to p
by liuliu 16y ago
I am interested to see some solutions with Node.js. From my experience (I built a lightweight protocol for multiplayer game with Node.js), it is super easy to program with Node.js and it just works. But the down-side is, you don't really get scalability. Node.js is great in one-process environment, and you don't have any methods for inter-process communication (you can do it based on you tiny protocol, but really, that is not what you want as "inter-process communication" means). Node.js is fast for prototyping, but I am eager to try out Erlang or Go before deployed the current version in production.
- jmtulloss 16y ago<shameless plug> try zeromq.node for your interprocess communication needs! </shameless plug>
- aaronblohowiak 16y agoInclude a link when you plug! https://github.com/JustinTulloss/zeromq.node https://github.com/JustinTulloss/zeromq.node
- jmtulloss 16y agoI was on the ipad, just getting tags was a struggle! Thanks for the link :).
- ehsanul 16y agoThis is actually just what I'm starting to use for inter-process communication with node.js, for a realtime MMO game. I'm dividing the (2d) world into squares, each handled by a node.js process which will each be responsible for all the game logic and computations within that square, with some extra logic for handling objects that span two or more adjacent squares. All IPC goes through a single (per machine) routing server which handles routing messages to the various node.js processes, which may or may not be on the same physical server. Only communications are for objects around the edges of the squares, for collision detection etc. and for transferring websocket connections to another node.js process. After a lot of thought, that seems to me to be the best way to work out a scalable solution. Have yet to see if it'll work well, but I see no reason why it shouldn't. Now if only I had enough users to test it.. Oh, and thanks for the great 0MQ library! :)
- jmtulloss 16y agoThat's awesome. Let me know if you have any problems!
- gourneau 16y agoI found this library last night and was surprised how flipping easy it was to use, and how fast it was. I wrote a tiny little script to test the max number of concurrent connections. https://github.com/JustinTulloss/zeromq.node/blob/master/examples/connections.js https://github.com/JustinTulloss/zeromq.node/blob/master/exa... On my OS X machine it fails at 893 open connections. I compiled zeromq to have max_sockets = 5000 (zeromq2/src/config.hpp) The error is: s_849.send(msg); Too many open files rc == 0 (mailbox.cpp:374) Abort trap What am I doing wrong? Should I just have one connection to zeromq and have all my async callbacks use it? I have a comment below that describes what I am trying to build. Thanks!
- d3x 16y agoI made http://spotted.at http://spotted.at using node.js / mongo. I used it because I wanted to see what all the hype was about and I wanted some real experience with it. But honestly I dont see what what node provides that eventmachine and twisted dont.
- sorenbs 16y agoHave you considered using the actor model with something like akka for scala? http://akka.io/ http://akka.io/ It will give you event passing across machines in a really concise way.
- Lennie 16y agoYep, that was exactly what I felt I was missing, processes/threads, ipc and I'm still not sure the memory usage/garbage collection handling would be great under stress.