go-graphite / go-carbon

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

Speed up fetchData #601

Closed deniszh closed 4 months ago

deniszh commented 4 months ago

During investigation of slow queries on server with big amount of files I found out that main culprit was on fetchData - it's doing data fetch serially, which is slow on hundreds and thousands of files. Main bottleneck should be disk, but we're doing some realtime merging with cache. We can speed up fetchData with goroutines, with sane cap (2 x GOMAXPROCS). Also contains queryCache to expireCache struct renaming, as TODO asked.