You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
We have some sort of major performance problem on OS X. #1064
I'd bet a significant amount of money that this was because the data set was out of memory and he was using a rotational drive. I don't think this has anything to do with OS X.
From Drew's mails: "The on-disk size is about 9GB"
And further: "Finally, let's check in with the last suspect: the disk. Since my disk is fairly constantly pegged at 9MB/sec reads during this query. [...] What seems to be happening here is 131k preads to the single datafile [...] Oddly enough, around 2 minutes in, the size of the pread seems to drop to 4096 bytes"
The drop of the read size after 2 minutes clearly indicates that the cache has filled up and RethinkDB disabled the read-ahead function used to fill up the cache after a cold start. From there on, essentially every single access to a document meant random disk reads.
Note: Streaming 9 GiB of data = 2,359,296 blocks of 4 KB each will take in the order of 3.3 hours if every read involves a random access, assuming a very fast disk with a mean access time of 5 ms.
3 hours can be considered close to "never returning".
Frankly, RethinkDB is simply not a good choice for out-of-memory workloads that involve range scans on rotational drives. This is by design. The storage backend was designed for SSD, so this was an intentional sacrifice (trading table scan data locality for write data locality) anchored deep in the very concept of a log-structured data store.
It is fine for out-of-memory point gets on rotational disks, it is fine for anything on in-memory working sets, it is perfect for SSD-based systems. It is no good for out-of-memory range gets on rotational disks. Probably this should be made clear in the FAQ.
So, I named this issue incredibly poorly, but I'm also concerned about the fact that he mentioned the queries being interrupted, which I don't think should happen here:
This runs for about 9 minutes, and then dies with this error:
RqlRuntimeError: Query interrupted. Did you shut down the server? in:
[query]
I didn't realize that this was probably an out-of-memory workload; that lessens my performance concerns.
@mlucy: I totally agree about the interruption issue. That should be looked into.
For the sake of completeness:
Drew's original query (which he saw the interrupted message for) was the following one:
table.filter({"region":10000068}).pluck("type").distinct().run()
As far as performance goes, here's what I think happens FYI. We peg the cache size for the table to 1GB. We populate the cache quickly using read-ahead. Once we hit 1GB, we turn off read ahead and read 4kb chunks. This would explain Drew's disk read profile.
@mlucy -- you said this workload happens much more quickly on newton -- can you confirm this? Also, who's the best person to look into the interruption issue?
An issue being in a milestone just means that the last time @coffeemug looked it that milestone was the next one to be released. It really doesn't mean anything beyond that.
To add to Joe's comment, the reason I originally put this into 1.7.x is that this is a pretty major issues for OS X users on a live version (1.7), so if we could have fixed it as a point release, it would have been worth it.
Since it looks like we won't be doing point releases until 1.8 is out (I saw comments to this effect on a couple of other issues), we can move it to 1.8 if it can get done by then, otherwise we'll move it to 1.8.x once 1.8 is out.
I'm going to do some investigation here into the question of whether we're looping in situations where we really should be doing a pmap (for example, in loading values out of a leaf node). Also, I was told by @jdoliner that when evaluating count(), we shouldn't actually load the blob into memory. I'll check if that's true.
Activity
danielmewes commentedon Jun 23, 2013
I'd bet a significant amount of money that this was because the data set was out of memory and he was using a rotational drive. I don't think this has anything to do with OS X.
danielmewes commentedon Jun 23, 2013
From Drew's mails: "The on-disk size is about 9GB"
And further: "Finally, let's check in with the last suspect: the disk. Since my disk is fairly constantly pegged at 9MB/sec reads during this query. [...] What seems to be happening here is 131k preads to the single datafile [...] Oddly enough, around 2 minutes in, the size of the pread seems to drop to 4096 bytes"
The drop of the read size after 2 minutes clearly indicates that the cache has filled up and RethinkDB disabled the read-ahead function used to fill up the cache after a cold start. From there on, essentially every single access to a document meant random disk reads.
danielmewes commentedon Jun 23, 2013
Note: Streaming 9 GiB of data = 2,359,296 blocks of 4 KB each will take in the order of 3.3 hours if every read involves a random access, assuming a very fast disk with a mean access time of 5 ms.
3 hours can be considered close to "never returning".
Frankly, RethinkDB is simply not a good choice for out-of-memory workloads that involve range scans on rotational drives. This is by design. The storage backend was designed for SSD, so this was an intentional sacrifice (trading table scan data locality for write data locality) anchored deep in the very concept of a log-structured data store.
It is fine for out-of-memory point gets on rotational disks, it is fine for anything on in-memory working sets, it is perfect for SSD-based systems. It is no good for out-of-memory range gets on rotational disks. Probably this should be made clear in the FAQ.
mlucy commentedon Jun 24, 2013
So, I named this issue incredibly poorly, but I'm also concerned about the fact that he mentioned the queries being interrupted, which I don't think should happen here:
I didn't realize that this was probably an out-of-memory workload; that lessens my performance concerns.
danielmewes commentedon Jun 24, 2013
@mlucy: I totally agree about the interruption issue. That should be looked into.
For the sake of completeness:
Drew's original query (which he saw the interrupted message for) was the following one:
table.filter({"region":10000068}).pluck("type").distinct().run()
coffeemug commentedon Jun 24, 2013
As far as performance goes, here's what I think happens FYI. We peg the cache size for the table to 1GB. We populate the cache quickly using read-ahead. Once we hit 1GB, we turn off read ahead and read 4kb chunks. This would explain Drew's disk read profile.
@mlucy -- you said this workload happens much more quickly on newton -- can you confirm this? Also, who's the best person to look into the interruption issue?
mlucy commentedon Jun 24, 2013
@coffeemug -- I haven't tested it on a rotational drive on Newton, which I think is the discrepancy.
I think @jdoliner or I would be the best one to look into the interruption issue.
mlucy commentedon Jun 26, 2013
Moving to optional because this shouldn't hold up the release if I haven't tracked it down by then.
srh commentedon Jul 31, 2013
Why does this issue have the milestone 1.7.x?
jdoliner commentedon Jul 31, 2013
An issue being in a milestone just means that the last time @coffeemug looked it that milestone was the next one to be released. It really doesn't mean anything beyond that.
coffeemug commentedon Aug 6, 2013
To add to Joe's comment, the reason I originally put this into 1.7.x is that this is a pretty major issues for OS X users on a live version (1.7), so if we could have fixed it as a point release, it would have been worth it.
Since it looks like we won't be doing point releases until 1.8 is out (I saw comments to this effect on a couple of other issues), we can move it to 1.8 if it can get done by then, otherwise we'll move it to 1.8.x once 1.8 is out.
srh commentedon Aug 12, 2013
I'm currently looking at this.
srh commentedon Aug 12, 2013
It doesn't seem OS X related. In fact, I'm seeing much better performance in OS X than on Linux on comparable machines and query sizes.
srh commentedon Aug 12, 2013
I'm going to do some investigation here into the question of whether we're looping in situations where we really should be doing a pmap (for example, in loading values out of a leaf node). Also, I was told by @jdoliner that when evaluating
count(), we shouldn't actually load the blob into memory. I'll check if that's true.srh commentedon Mar 24, 2014
Closing in favor of #2156 (not to mention some other count() fixes).