Skip to content

We have some sort of major performance problem on OS X. #1064

Closed

Description

@mlucy

Drew on the mailing list is reporting that count on a 680k-row table is never returning.

Activity

  1. ghost assigned on Jun 23, 2013
  2. danielmewes commented on Jun 23, 2013

    @danielmewes
    Member

    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.

  3. danielmewes commented on Jun 23, 2013

    @danielmewes
    Member

    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.

  4. danielmewes commented on Jun 23, 2013

    @danielmewes
    Member

    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.

  5. mlucy commented on Jun 24, 2013

    @mlucy
    MemberAuthor

    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.

  6. danielmewes commented on Jun 24, 2013

    @danielmewes
    Member

    @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()

  7. coffeemug commented on Jun 24, 2013

    @coffeemug
    Contributor

    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?

  8. mlucy commented on Jun 24, 2013

    @mlucy
    MemberAuthor

    @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.

  9. mlucy commented on Jun 26, 2013

    @mlucy
    MemberAuthor

    Moving to optional because this shouldn't hold up the release if I haven't tracked it down by then.

  10. ghost assigned on Jul 9, 2013
  11. srh commented on Jul 31, 2013

    @srh
    Contributor

    Why does this issue have the milestone 1.7.x?

  12. jdoliner commented on Jul 31, 2013

    @jdoliner
    Contributor

    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.

  13. coffeemug commented on Aug 6, 2013

    @coffeemug
    Contributor

    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.

  14. srh commented on Aug 12, 2013

    @srh
    Contributor

    I'm currently looking at this.

  15. srh commented on Aug 12, 2013

    @srh
    Contributor

    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.

  16. srh commented on Aug 12, 2013

    @srh
    Contributor

    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.

  17. srh commented on Mar 24, 2014

    @srh
    Contributor

    Closing in favor of #2156 (not to mention some other count() fixes).

  18. modified the milestones: duplicate, backlog on Mar 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions