Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upExpression evaluation time is proportional to chunk descs #1035
Comments
This comment has been minimized.
This comment has been minimized.
|
Could you provide the data rather than your conclusion of it so we don't all have replicate the whole process? |
This comment has been minimized.
This comment has been minimized.
|
The SVG graph would be nice :) |
This comment has been minimized.
This comment has been minimized.
|
The command to retrieve it is above, and it's monitoring itself too if you need anything else. It's running at head. |
beorn7
self-assigned this
Aug 28, 2015
brian-brazil
added
the
bug
label
Dec 16, 2015
This comment has been minimized.
This comment has been minimized.
|
OK, finally found time to look into this. The code in question does not copy all the chunkDescs. It creates a slice of chunk pointers and let's them point to the chunks currently loaded. The series iterator then acts directly on chunks and not on chunkDescs at all. I'm trying to remember why we did it that way. It kind of makes the pinning not needed... I'll continue to think about it. |
This comment has been minimized.
This comment has been minimized.
|
OK, wrapped me head around the multiple layers of indirection here. It makes sense after all. I see a number of possible optimizations, but I cannot really believe the copying of pointers to chunks would be a bottle neck. I'm looking at the profiling data right now, assuming it still runs with the same parameters. |
This comment has been minimized.
This comment has been minimized.
|
The issue is mostly the mutex that has to be acquired to get to the chunk reference. So while the problem is not copying chunkDesc, the fundamental cause is similar: Even for accessing a single sample, we go through all chunks. I think it will help a lot even in less special use-cases than the game-of-life setup to fix that. Working on it... |
beorn7
added a commit
that referenced
this issue
Feb 18, 2016
beorn7
added a commit
that referenced
this issue
Feb 19, 2016
beorn7
closed this
Mar 8, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
brian-brazil commentedAug 27, 2015
I noticed that demo.robustperception.io is pegged for CPU. It's scraping a handful of targets and running the Conway's life demo.
If you run
you'll see that the problem is in the analyze phase, in particular in
github.com/prometheus/prometheus/storage/local.(*memorySeries).newIteratorwhich copies all the chunkdescs for each series referenced. Evaluation time should be proportional to the amount of a time series that is accessed, not the total amount of data stored. Accordingly I think we need to rework this, as 9k timeseries being referenced a second is enough to eat an entire core.