3

I've changed a long running process on an Node/Express route to use Bull/Redis.

I've pretty much copied this tutorial on Heroku docs.

The gist of that tutorial is: The Express route schedules the Job, immediately returns 200 to the client, and browser long polls for the job status (a ping route on Express). When the client gets a completed status, it displays it in the UI. The Worker is a separate file and is run with an addtional yarn run worker.js.

Notice the end where it recommends using Throng for clustering your workers.

I'm using this Bull Dashboard to monitor jobs/queues. This dashboard shows the available Workers, and their status (Idle when not running/ Not in Idle when running).

I've got the MVP working, but the operation is super slow. The average time to complete is 1 minute 30 second. Whereas before (before adding Bull) it was seconds to complete.

Another strange it seems to take at least 30 seconds for a Workers status to change from Idle to not Idle. Seems that a lot of the latency is waiting for the worker.

Being that the new operation is a separate file (worker.js) and throng is enabling clustering, I was expecting this operation to be super fast, but it is just the opposite.

Does anyone have an experience with this? Or pointers to help figure out what is causing this to be so slow?

GN.
  • 8,672
  • 10
  • 61
  • 126

0 Answers0