New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Research pluck ineffiency #947
Comments
To give a little more info on how I think we should tackle this:
|
Some more results: I've used a varying number of chained without() to test the scalability of chaining this operation. table('t55')->get(1)->run($conn); Again, I've done this for both get() and getAll(). The plot shows the latency (~processing time) of a single such query. For get(), chaining the withouts appears to scale quadratically, while for getAll it is scaling linearly. |
I'm pretty sure this is caused by the fact that we make a copy for Also I'm going to hack up a copy free version of |
@jdoliner: Yes, we can absolutely live without it for a little while. YCSB doesn't have to use pluck. I believe that there actually are other more relevant issues with YCSB for now. However query processing will matter soon enough. What really smells are the quadratic costs. Also, copying should in no way account for a 40 % performance hit. I mean we are talking about 800 queries per second here. Not 8 million. What I want to say is: I have some hope that there's a deeper issue behind this, which is not specific to pluck. Solving it could have a positive impact on a lot of queries. |
It appears to be quadratic because the code was written back when we cached On Wed, Jun 5, 2013 at 9:53 AM, Joe Doliner notifications@github.comwrote:
|
Daniel: I just pushed a branch On Wed, Jun 5, 2013 at 10:18 AM, Michael Lucy mlucy@rethinkdb.com wrote:
|
The fact that this was messed up in at least one place also makes On Wed, Jun 5, 2013 at 10:24 AM, Michael Lucy mlucy@rethinkdb.com wrote:
|
Thanks @mlucy. The problem is gone.
And I can chain without() behind a get() as much as I want... :-) @jdoliner: I consider this solved. I think it is not necessary to make pluck or other commands copy-free at this point, for the reasons that you've mentioned. We will get back to that in a couple months maybe... |
Cool. This is in code-review 607 by Marc. On Wed, Jun 5, 2013 at 11:06 AM, Daniel Mewes notifications@github.comwrote:
|
Here is how I would like to structure this process. First, I think we should become competitive with mongodb on standard predefined YCSB workloads (or, hopefully, do a lot better than them). We should fix all operations that are on the critical path. This will give us two benefits:
After that, we should just follow our users and fix things they complain about workload by workload. This gives us more than enough to work with, and narrows the playing field quite a bit. |
@coffeemug it's kind of moot in this case because we already solved it but what you're saying doesn't really clarify issues like this. In this case pluck is on the critical path only because of how we choose to implement YCSB. We could have implemented in another way and completely ignored pluck. So we need to give a bit more thought to what's actually on the critical path and what appears to be on the critical path. |
There are only a few query languages features that we use in YCSB. Beyond the basic operations like get, between, and update, that we have to have, we only use pluck, and limit. With both pluck and limit we could choose to implement the same functionality in the client but that involves transferring more data to the client than is strictly necessary. Ultimately it will be faster to ensure that these commands are fast than to try and work around the fact that they are slow by avoiding them. Given how easy it was to fix pluck (and I think limit is already doing the right thing) I don't think this is actually something we need to worry about anymore. |
@wmrowan fair enough. This seems to be more of a philosophical question than a real one then. |
Since this is already fixed I'm moving it to 1.6 and assigning to @mlucy. Please feel free to close when the fix makes it into next. |
This is in next, review 607. |
I was taking a brief look at YCSB and noticed that for point gets, we are doing a pluck. This is perfectly sane. Efficiently implemented, pluck should be a practically zero-cost operator.
But it isn't. Here's a quick experiment:
First the output:
The code:
RethinkDB CPU utilization while running the different parts:
Get: 60 %
GetAll: 60 %
Get + Pluck: 69 %
GetAll + Pluck: 55 %
Conclusion: Pluck makes gets slower by about 40 %. While I am using only a single client/connection, this cannot be attributed to a longer delay alone, as the CPU usage is actually higher with pluck, while processing fewer queries per second. Weirdly, pluck on sequences seems to be significantly faster than pluck on a single object.
We should find out what makes pluck so slow, and check if the same issue affects other operations as well.
The text was updated successfully, but these errors were encountered: