Skip to content

indexList() extremely slow under load #2071

Closed

Description

@danielmewes

New title: Everything becomes extremely slow under backfilling + sindex creation

While re-testing #1389, I noticed that executing r.table().indexList() took about 30s when the cluster was under load (here: backfilling + creating indexes + some insert queries). indexStatus() was similarly slow, taking up to 2 minutes!

Activity

  1. added this to the milestone on Mar 7, 2014
  2. self-assigned this
    on Mar 7, 2014
  3. danielmewes commented on Mar 7, 2014

    @danielmewes
    MemberAuthor

    Ok wrong issue title.
    Almost every query (including r.table().limit(1), but not r.expr(1)) became extremely slow, and I even got a heartbeat timeout between nodes again.

  4. danielmewes commented on Mar 7, 2014

    @danielmewes
    MemberAuthor

    Very low CPU utilization, moderate i/o.

  5. coffeemug commented on Mar 7, 2014

    @coffeemug
    Contributor

    This is an issue that was gone but is reintroduced after the merge of the new cache, correct? In that case it should be in 1.12, not in polish. Such a regression is really important to fix.

  6. modified the milestones: 1.12, on Mar 7, 2014
  7. modified the milestone: 1.12 on Mar 7, 2014
  8. danielmewes commented on Mar 7, 2014

    @danielmewes
    MemberAuthor

    Yes, I don't know if it was reintroduced or had been there for longer. I originally thought that this did just affect indexList(), but it affects other things as well.
    Moving to 1.12.

  9. danielmewes commented on Mar 7, 2014

    @danielmewes
    MemberAuthor

    Oh and two nodes just crashed:

    info: Connected to server "electro1" fa8a36ac-324a-4f04-9128-6e8983e81187
    info: Connected to server "magneto1" aba3f0df-a534-4e62-b5c5-873c96c634f6
    info: Disconnected from server "electro1" fa8a36ac-324a-4f04-9128-6e8983e81187
    info: Connected to server "electro1" fa8a36ac-324a-4f04-9128-6e8983e81187
    Version: rethinkdb foo (GCC 4.6.3)
    error: Error in src/rdb_protocol/lazy_json.cc at line 19:
    error: Guarantee failed: [res == archive_result_t::SUCCESS] Deserialization of rdb value failed with error archive_result_t::SOCK_EOF.
    error: Backtrace:
    error: Thu Mar  6 17:30:29 2014
    
           1: .persist/rethinkdb() [0x9fb6c3] at 0x9fb6c3 ()
           2: .persist/rethinkdb() [0x9f34c4] at 0x9f34c4 ()
           3: .persist/rethinkdb() [0x90c200] at 0x90c200 ()
           4: .persist/rethinkdb() [0x918fc7] at 0x918fc7 ()
           5: .persist/rethinkdb() [0x459c98] at 0x459c98 ()
           6: .persist/rethinkdb() [0x457e52] at 0x457e52 ()
           7: .persist/rethinkdb() [0x457d28] at 0x457d28 ()
           8: .persist/rethinkdb() [0x457c94] at 0x457c94 ()
           9: .persist/rethinkdb() [0x43168e] at 0x43168e ()
    error: Exiting.
    

    That might just be a case where we don't handle disconnects (due to heartbeat timeouts) properly, and could be unrelated to the performance issues.

  10. danielmewes commented on Mar 7, 2014

    @danielmewes
    MemberAuthor

    Opened a new issue for the crash: #2073

  11. danielmewes commented on Mar 8, 2014

    @danielmewes
    MemberAuthor

    The reason for the slow queries appears to be transaction throttling in the cache.

    Not sure how that could result in a heartbeat timeout though (it might be that the node was actually crashing as in #2073).

  12. 9 remaining items

  13. danielmewes commented on Mar 20, 2014

    @danielmewes
    MemberAuthor

    The partial fix is in next 5359930

  14. danielmewes commented on Mar 21, 2014

    @danielmewes
    MemberAuthor

    Just a quick status update: This is still pretty bad. It was already bad in 1.11 (simple queries there took in the range of 1-2 seconds), but it's worse in next (2-15 seconds).

  15. srh commented on Mar 21, 2014

    @srh
    Contributor

    What if we increase the dirty block throttling limit, to, say, a larger value?

  16. srh commented on Mar 21, 2014

    @srh
    Contributor

    It's not some thought-out value right now -- 200 is particularly low, considering how quickly they could be dumped to disk.

  17. danielmewes commented on Mar 21, 2014

    @danielmewes
    MemberAuthor

    @srh: I had previously experimented with that a little. Removing the throttling solves the issue (until the process runs out of memory), but increasing it to for example 2000 doesn't change all that much. I think it just takes it a little longer until hitting the limit, and from there on it's basically the same.

    I have a theory of why this is so slow. Let me test that first...

  18. danielmewes commented on Mar 21, 2014

    @danielmewes
    MemberAuthor

    @srh: Basically my hypothesis is that we have to do exactly this (from btree_store.cc):

        // SRH: Should we be able to "get in line" for the mutex and release the sindex
        // block or something?
        // JD: That could be a good optimization but I don't think there's any reason
        // we need to do it as part of the new cache. There's also an argument to
        // be made that this mutex could just go away and having write access to
        // the sindex block could fill the same role.
    

    Now replacing the mutex by a fifo_enforcer to test whether that improves things...

  19. srh commented on Mar 21, 2014

    @srh
    Contributor

    Or replace it with a new_mutex_t?

  20. danielmewes commented on Mar 21, 2014

    @danielmewes
    MemberAuthor

    Oh right! I forgot that we had that. That's actually easier. :-)

  21. danielmewes commented on Mar 21, 2014

    @danielmewes
    MemberAuthor

    That alone wasn't enough. A couple of different optimizations and parameter adjustments were required to get rid of the latency issues. The short version is that backfills and sindex post constructions now get throttled if the cache can't flush their data fast enough.

    Implemented in branch daniel_2071_2.

    In code review 1350 by @srh.

  22. danielmewes commented on Mar 21, 2014

    @danielmewes
    MemberAuthor

    indexList() is still occasionally slow, but other non-sindex related queries are ok now (and much faster in this scenario than in 1.11).

  23. danielmewes commented on Mar 21, 2014

    @danielmewes
    MemberAuthor

    Closed by a4e7edc

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