aqa-test-tools
aqa-test-tools copied to clipboard
Increase the TRSS Server efficiency by running multiple node in parallel
With the current code, we are using a single node when running TRSS server. As we monitor more and more projects, the TRSS server can be very busy to process the Jenkins outputs. As a result, TRSS server may not be able to response the client requests in a timely manner.
With the current structure, we can easily break into two node servers:
frontend- for responding to client requests (mainly for querying database)backend- for querying Jenkins and inserting/updating database.
We do not want to use fork() here because it will complicate the logic and add lots of if conditions. And these two tasks are very different.
Once two node servers are created, we can further improve the efficiency by leveraging multiple processors on the machine. We can use fork() to create multiple backend workers and we can process Jenkins jobs in parallel.
Note: a flag is needed to keep the worker id and to keep track of which job is processing by which backend worker. Also, we should set a timeout after which we assume the worker is dead and we can restart the worker.

In summary, there are the following steps:
-
[x] Break node server into two:
frontendandbackend -
[x] configure forever service on the server
-
[ ] create multiple
backendworkers -
[ ] update readme