deoxxa / jsmc

Pure JavaScript Minecraft server
Other
82 stars 14 forks source link

Proposal - Cluster Node #22

Closed nickpoorman closed 2 months ago

nickpoorman commented 11 years ago

This is just a proposal bust since this project is just starting I'm thinking it might be a good idea to implement this with cluster node or even break it apart into different worker nodes.

From what I can tell the largest bottleneck with the servers that are out there now such as craftbukkit is the event loop that has to process everything on a single core. Since this is a map ie. a matrix and matrices are easily parallelizable, the map could be divided up into zones where each zone is managed by a given worker and each zone has it's own event loop.

Since players don't really interact with the entire map all at once this might work really well. The only edge case I can think of would be where a player is standing in one zone and editing the map in another zone but that should be easy enough to handle.

If a cpu has n number of cores then the map would be broken up into n number of zones. In the future this even has the possibility of managing zones over a socket and distributing the map across servers. This way the map and the server could become infinitely large just by scaling horizontally.

deoxxa commented 11 years ago

I'm a fan of this idea, and it's kind of been kicking around in my head for a while. I'd like to skip the cluster module completely and just go for the connect-everything-via-the-network model from the very start. I might be swayed by performance metrics though, if it turns out that local network connections are meaningfully slower than shoving messages around via cluster.