go-graphite / go-carbon

Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister
MIT License
805 stars 123 forks source link

[Q] Is "workers" effectively bound to "max-cpu"? #581

Closed interfan7 closed 1 month ago

interfan7 commented 8 months ago

If max-cpu is the maximum number of threads which can be executed simultaneously (right?), then it doesn't make sense to set workers to anything higher than that, because the won't process at the same time?

Or, there is still a benefit of having multiple workers waiting on disk I/O as the latter may be potentially batched?

deniszh commented 8 months ago

Indeed, workers is more related to disk writes, not cpu.

вс, 17 мар. 2024 г., 21:50 Leonid Brandes @.***>:

If max-cpu is the maximum number of threads which can be executed simultaneously (right?), then it doesn't make sense to set workers to anything higher than that, because the won't process at the same time?

Or, there is still a benefit of having multiple workers waiting on disk I/O as the latter may be potentially batched?

— Reply to this email directly, view it on GitHub https://github.com/go-graphite/go-carbon/issues/581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJLTVWFKYMML54BYYISOCTYYX63BAVCNFSM6AAAAABE2P5TUSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4TAOBVHE3DCNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

deniszh commented 8 months ago

PS: and max-cpu just setting GOMAXPROC internally, limiting go concurrency, hence used cpu cores. But exact workers value depends on hardware, so require some guessing/tuning

interfan7 commented 8 months ago

Would you say there is some relation between max-cpu and workers?

In the example config file, the max-cpu has this comment above it:

# Increase for configuration with multi persister workers
deniszh commented 1 month ago

I would say workers should be <= max-cpu/2, but definitely < max-cpu.