I use firebase-queuein a mobile application to handle server-side work. The firebase-queuedocumentation here says that we can specify an optional parameter numWorkersthat indicates the number of workers who can simultaneously run node.js thread. I do not quite understand how to use this option in my application. For example, one of the things I do on the server side with firebase-queueis to send a confirmation code to the user when he first enters the application. Now it can be hundreds of users in the future. I have a few questions that I would like to clarify in order to better understand the user.numWorkers
- When do I need to have more than one worker for a firebase queue?
- What is the optimal number of employees for any firebase queue? Based on the Java background, he said that more and more threads running in an application can become overhead beyond a certain limit. Not sure if similar principles apply here.
- If I have several queues serving different ones
specIds, then I need to think about the number of total employees at the cumulative level, and not in the queue. At the moment I have four lines.
Please let me know if you have information on my questions above. Any inputs are appreciated.
Update - June 5, 2016
After we play a little with firebase-queue, I realized that it numWorkersdetermines how many tasks of this specification can work simultaneously. Since the desktop does not work in asynchronous mode, if the tasks of the specified qualifier take a lot of time, you can complete many tasks in the queue, waiting for you to be picked up. E.g. if there is a network element in the task processing, this may take longer, and if you expect many of these tasks to be in the queue, then you should have more than one worker in the firebase queue. So now I know the answer to my first question.
2 3. , , , . , , . , , .