-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
I see the following architecture problem in Zeno:
Each component runs on a different thread and launches several sub-threads which also launch several sub-threads.
I know that golang threads have very little performance impact but does it make sense to have such a complicated design?
Maybe we could simplify a bit without losing performance to help maintainability.
For example, lets see HQ:
- HQ is one of the components running on a separate thread.
- Two of its functions are
producer()andproducerReceiver()which run on their own sub-threads. They have then own channels and their own batching. with configurable number of workers viagetMaxProducerSenders()andgetProducerBatchSize(). https://github.com/internetarchive/Zeno/blob/main/internal/pkg/source/hq/producer.go - Moreover they run separate threads for each batch.
https://github.com/internetarchive/Zeno/blob/main/internal/pkg/source/hq/producer.go#L153
Why don't we run batches on the same thread? Since its a 3rd level thread, it wouldn't block anything. Also, there is buffering in channels between the components.
Another example is the Finisher:
- Finisher runs on a separate thread.
- Two of its functions
finisherReceiverandfinisherDispatcherrun on their own sub-threads. finisherDispatcherrunsfinisherSenderin separate sub-threads.
Do we need the 3rd level of sub-threads?
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels