Findwise/Hydra

Increasing number of threads also polls Core more often

Opened this issue · 4 comments

If you set numberOfThreads = 4 in a stage, not only will you have 4 worker threads for processing, you will also have 4 threads actively polling the database. Is this intended behavior?

Sounds like a problem with how Core creates StageRunners for each remote stage. Hm, or it might be due to the stages polling at the same time and a thread being spawned from their HTTP request? I'm not familiar with the logic there, need to check what's going on to be sure.

It's due to numberOfThreads controlling how many Stage instances to create, and each instance does its own polling. I haven't changed this behavior in my refactoring since I didn't know whether it was intended or not.

By "active polling the database", I mean "polling the core".

So whether it will poll the database or not, I don't know. May not be worth looking at, depending on whether my continued work moving over to a queue-based system bears any fruit 😄