问题描述:

I have a server written in Node.js which listens to a certain node for updates (child_added) and if there are any, it creates another child in another node based on the information retrieved with "child_added". I have written a script to test the capacity of the server by adding, lets say 500 children in a "for loop" (in a really short time). The problem is that, the server stops retrieving data after adding around 340 children. Why this happens? Is it maybe because I'm using a "free plan" on Firebase? Or maybe the server goes out capacity because of too much threads? Firebase seems to handle every detail by itself so I don't know if I should manually close the threads/processes after I'm done with them.

The server code:

ref.on("child_added", function(snapshot){

createGame(snapshot.val());

}

function createGame(..){

..

..

ref2.push().set(..);

..

..

}

The test code:

for(var i=0; i<TEST_CAPACITY; i++){

ref.push().set(...);

}

相关阅读:
Top