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
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!
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.
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.
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.
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.
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).
@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...
@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...
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.
Activity
danielmewes commentedon Mar 7, 2014
Ok wrong issue title.
Almost every query (including
r.table().limit(1), but notr.expr(1)) became extremely slow, and I even got a heartbeat timeout between nodes again.danielmewes commentedon Mar 7, 2014
Very low CPU utilization, moderate i/o.
coffeemug commentedon Mar 7, 2014
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.
danielmewes commentedon Mar 7, 2014
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.
danielmewes commentedon Mar 7, 2014
Oh and two nodes just crashed:
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.
danielmewes commentedon Mar 7, 2014
Opened a new issue for the crash: #2073
danielmewes commentedon Mar 8, 2014
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).
9 remaining items
danielmewes commentedon Mar 20, 2014
The partial fix is in next 5359930
danielmewes commentedon Mar 21, 2014
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).
srh commentedon Mar 21, 2014
What if we increase the dirty block throttling limit, to, say, a larger value?
srh commentedon Mar 21, 2014
It's not some thought-out value right now -- 200 is particularly low, considering how quickly they could be dumped to disk.
danielmewes commentedon Mar 21, 2014
@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...
danielmewes commentedon Mar 21, 2014
@srh: Basically my hypothesis is that we have to do exactly this (from btree_store.cc):
Now replacing the mutex by a fifo_enforcer to test whether that improves things...
srh commentedon Mar 21, 2014
Or replace it with a new_mutex_t?
danielmewes commentedon Mar 21, 2014
Oh right! I forgot that we had that. That's actually easier. :-)
danielmewes commentedon Mar 21, 2014
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.
danielmewes commentedon Mar 21, 2014
indexList() is still occasionally slow, but other non-sindex related queries are ok now (and much faster in this scenario than in 1.11).
danielmewes commentedon Mar 21, 2014
Closed by a4e7edc
First draft of the release notes for 1.12