Levi Tamasi
bd8404feff
Do not schedule memtable trimming if there is no history ( #6177 )
...
Summary:
We have observed an increase in CPU load caused by frequent calls to
`ColumnFamilyData::InstallSuperVersion` from `DBImpl::TrimMemtableHistory`
when using `max_write_buffer_size_to_maintain` to limit the amount of
memtable history maintained for transaction conflict checking. Part of the issue
is that trimming can potentially be scheduled even if there is no memtable
history. The patch adds a check that fixes this.
See also https://github.com/facebook/rocksdb/pull/6169 .
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6177
Test Plan:
Compared `perf` output for
```
./db_bench -benchmarks=randomtransaction -optimistic_transaction_db=1 -statistics -stats_interval_seconds=1 -duration=90 -num=500000 --max_write_buffer_size_to_maintain=16000000 --transaction_set_snapshot=1 --threads=32
```
before and after the change. There is a significant reduction for the call chain
`rocksdb::DBImpl::TrimMemtableHistory` -> `rocksdb::ColumnFamilyData::InstallSuperVersion` ->
`rocksdb::ThreadLocalPtr::StaticMeta::Scrape` even without https://github.com/facebook/rocksdb/pull/6169 .
Differential Revision: D19057445
Pulled By: ltamasi
fbshipit-source-id: dff81882d7b280e17eda7d9b072a2d4882c50f79
2019-12-13 19:11:19 -08:00
..
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-09-19 12:34:17 -07:00
2019-09-13 13:50:43 -07:00
2019-12-11 17:19:43 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-11 15:17:08 -08:00
2019-12-09 15:49:49 -08:00
2019-08-23 13:55:34 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-11-01 11:46:19 -07:00
2019-08-06 14:26:44 -07:00
2019-09-11 18:09:00 -07:00
2019-05-30 17:44:09 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-10-21 16:53:06 -07:00
2019-12-09 15:49:49 -08:00
2019-11-19 15:02:41 -08:00
2019-09-16 15:26:21 -07:00
2019-11-26 18:24:10 -08:00
2019-09-09 11:24:11 -07:00
2019-12-12 14:08:02 -08:00
2018-11-12 16:42:16 -08:00
2019-09-05 17:21:42 -07:00
2019-12-12 19:04:48 -08:00
2019-11-27 14:48:49 -08:00
2019-09-20 12:04:26 -07:00
2017-07-15 16:11:23 -07:00
2017-07-15 16:11:23 -07:00
2018-10-29 14:36:31 -07:00
2019-05-30 17:44:09 -07:00
2019-05-30 17:44:09 -07:00
2019-11-19 11:39:02 -08:00
2019-09-19 12:34:17 -07:00
2019-12-13 14:30:14 -08:00
2019-02-14 14:41:36 -08:00
2019-09-09 11:24:11 -07:00
2019-08-06 14:26:44 -07:00
2019-08-06 14:26:44 -07:00
2019-11-26 10:00:32 -08:00
2019-09-16 16:17:09 -07:00
2019-12-12 15:18:02 -08:00
2019-07-06 21:07:32 -07:00
2019-03-01 10:42:09 -08:00
2019-09-09 11:24:11 -07:00
2018-07-17 14:43:18 -07:00
2019-11-13 10:11:34 -08:00
2019-11-12 13:52:55 -08:00
2019-11-26 18:24:10 -08:00
2019-11-26 21:39:56 -08:00
2019-12-09 09:23:50 -08:00
2019-12-13 14:48:41 -08:00
2019-05-30 17:44:09 -07:00
2019-05-31 17:23:59 -07:00
2019-09-20 12:04:26 -07:00
2019-09-11 18:09:00 -07:00
2019-09-18 16:58:21 -07:00
2019-12-12 14:08:02 -08:00
2019-05-31 15:24:43 -07:00
2018-10-04 20:46:50 -07:00
2019-10-14 15:21:01 -07:00
2019-10-14 15:21:01 -07:00
2019-05-31 11:57:01 -07:00
2019-09-13 14:49:47 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-12 14:08:02 -08:00
2019-05-31 17:23:59 -07:00
2019-05-30 17:44:09 -07:00
2017-07-15 16:11:23 -07:00
2019-05-30 17:44:09 -07:00
2019-05-31 17:23:59 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-12 19:04:48 -08:00
2019-08-23 13:55:34 -07:00
2019-06-06 13:56:07 -07:00
2019-06-20 14:31:48 -07:00
2019-05-30 17:44:09 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-09-20 12:04:26 -07:00
2019-09-20 12:04:26 -07:00
2019-09-06 17:31:10 -07:00
2019-01-15 21:34:38 -08:00
2019-10-24 14:44:15 -07:00
2018-08-24 18:13:20 -07:00
2019-09-16 10:33:51 -07:00
2019-09-16 10:33:51 -07:00
2019-12-13 14:48:41 -08:00
2019-09-16 10:33:51 -07:00
2019-09-11 18:09:00 -07:00
2018-05-03 15:43:09 -07:00
2018-05-03 15:43:09 -07:00
2019-07-25 15:27:39 -07:00
2019-07-02 12:07:01 -07:00
2017-07-15 16:11:23 -07:00
2019-05-30 17:44:09 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 19:11:19 -08:00
2019-12-13 19:11:19 -08:00
2019-10-24 17:16:46 -07:00
2019-12-13 19:11:19 -08:00
2019-04-11 14:28:26 -07:00
2019-05-30 17:44:09 -07:00
2019-06-04 10:24:14 -07:00
2018-12-17 17:33:46 -08:00
2017-07-15 16:11:23 -07:00
2019-05-31 15:24:43 -07:00
2019-09-18 11:52:17 -07:00
2019-05-31 11:57:01 -07:00
2019-05-30 17:44:09 -07:00
2017-07-15 16:11:23 -07:00
2019-10-21 16:53:06 -07:00
2019-06-10 11:53:31 -07:00
2019-05-31 11:57:01 -07:00
2019-05-30 17:44:09 -07:00
2019-05-30 11:25:51 -07:00
2019-05-31 11:57:01 -07:00
2019-05-31 11:57:01 -07:00
2019-05-30 11:25:51 -07:00
2019-09-20 12:04:26 -07:00
2019-09-05 17:30:29 -07:00
2019-07-23 08:08:19 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-01-16 09:55:32 -08:00
2017-07-15 16:11:23 -07:00
2019-05-03 17:30:22 -07:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-03-18 12:15:34 -07:00
2019-03-18 12:15:34 -07:00
2019-12-13 14:48:41 -08:00
2019-08-26 11:26:29 -07:00
2019-12-12 19:04:48 -08:00
2019-08-23 13:55:34 -07:00
2019-11-26 21:39:56 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-11-26 21:39:56 -08:00
2019-11-26 21:39:56 -08:00
2019-11-26 21:39:56 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2019-12-13 14:48:41 -08:00
2017-07-15 16:11:23 -07:00
2019-09-12 17:15:18 -07:00
2019-09-09 11:24:11 -07:00
2019-12-13 19:11:19 -08:00
2019-06-10 11:53:31 -07:00
2017-07-15 16:11:23 -07:00
2019-05-30 11:25:51 -07:00
2017-07-15 16:11:23 -07:00
2017-07-15 16:11:23 -07:00
2019-09-11 18:28:33 -07:00
2019-09-11 18:28:33 -07:00