rocksdb/db
Jim Paton 1036537c94 Add soft and hard rate limit support
Summary:
This diff adds support for both soft and hard rate limiting. The following changes are included:

1) Options.rate_limit is renamed to Options.hard_rate_limit.
2) Options.rate_limit_delay_milliseconds is renamed to Options.rate_limit_delay_max_milliseconds.
3) Options.soft_rate_limit is added.
4) If the maximum compaction score is > hard_rate_limit and rate_limit_delay_max_milliseconds == 0, then writes are delayed by 1 ms at a time until the max compaction score falls below hard_rate_limit.
5) If the max compaction score is > soft_rate_limit but <= hard_rate_limit, then writes are delayed by 0-1 ms depending on how close we are to hard_rate_limit.
6) Users can disable 4 by setting hard_rate_limit = 0. They can add a limit to the maximum amount of time waited by setting rate_limit_delay_max_milliseconds > 0. Thus, the old behavior can be preserved by setting soft_rate_limit = 0, which is the default.

Test Plan:
make -j32 check
./db_stress

Reviewers: dhruba, haobo, MarkCallaghan

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D12003
2013-08-05 15:43:49 -07:00
..
.nfs00000000066c9ebb00000002 Enhance db_bench 2013-03-14 16:00:23 -07:00
builder.cc [RocksDB] cleanup EnvOptions 2013-06-12 11:17:19 -07:00
builder.h [RocksDB] cleanup EnvOptions 2013-06-12 11:17:19 -07:00
c_test.c Fix poor error on num_levels mismatch and few other minor improvements 2013-01-25 15:37:26 -08:00
c.cc Fix poor error on num_levels mismatch and few other minor improvements 2013-01-25 15:37:26 -08:00
corruption_test.cc Make arena block size configurable 2013-07-31 12:42:23 -07:00
db_bench.cc Add soft and hard rate limit support 2013-08-05 15:43:49 -07:00
db_filesnapshot.cc [Rocksdb] Log on disable/enable file deletions 2013-06-05 10:48:24 -07:00
db_impl_readonly.cc [Rocksdb] Support Merge operation in rocksdb 2013-05-03 16:59:02 -07:00
db_impl_readonly.h [RocksDB] Enable manual compaction to move files back to an appropriate level. 2013-07-19 16:20:36 -07:00
db_impl.cc Add soft and hard rate limit support 2013-08-05 15:43:49 -07:00
db_impl.h Add soft and hard rate limit support 2013-08-05 15:43:49 -07:00
db_iter.cc Record the number of open db iterators. 2013-05-29 08:47:08 -07:00
db_iter.h [Rocksdb] Support Merge operation in rocksdb 2013-05-03 16:59:02 -07:00
db_statistics.h [RocksDB] Expose DBStatistics 2013-05-23 11:49:38 -07:00
db_stats_logger.cc remove boost 2012-09-16 19:33:43 -07:00
db_test.cc Add soft and hard rate limit support 2013-08-05 15:43:49 -07:00
dbformat_test.cc Fix all warnings generated by -Wall option to the compiler. 2012-11-06 14:07:31 -08:00
dbformat.cc Fix refering freed memory in earlier commit. 2013-06-10 15:08:13 -07:00
dbformat.h Fix refering freed memory in earlier commit. 2013-06-10 15:08:13 -07:00
filename_test.cc Added meta-database support. 2012-12-17 11:26:59 -08:00
filename.cc Allow the logs to be purged by TTL. 2013-02-04 19:42:40 -08:00
filename.h Added meta-database support. 2012-12-17 11:26:59 -08:00
log_file.h GetUpdatesSince API to enable replication. 2012-12-07 11:42:13 -08:00
log_format.h Fixed sign-comparison in rocksdb code-base and fixed Makefile 2013-03-19 14:35:23 -07:00
log_reader.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
log_reader.h TransactionLogIter should stall at the last record. Currently it errors out 2013-03-21 15:12:35 -07:00
log_test.cc Fix more signed-unsigned comparisons 2013-03-19 17:21:36 -07:00
log_writer.cc Fix a number of object lifetime/ownership issues 2013-01-23 16:54:11 -08:00
log_writer.h Fix a number of object lifetime/ownership issues 2013-01-23 16:54:11 -08:00
memtable.cc Expand KeyMayExist to return the proper value if it can be found in memory and also check block_cache 2013-08-01 09:07:46 -07:00
memtable.h Expand KeyMayExist to return the proper value if it can be found in memory and also check block_cache 2013-08-01 09:07:46 -07:00
memtablelist.cc Expand KeyMayExist to return the proper value if it can be found in memory and also check block_cache 2013-08-01 09:07:46 -07:00
memtablelist.h Expand KeyMayExist to return the proper value if it can be found in memory and also check block_cache 2013-08-01 09:07:46 -07:00
merge_helper.cc [Rocksdb] Support Merge operation in rocksdb 2013-05-03 16:59:02 -07:00
merge_helper.h [Rocksdb] Support Merge operation in rocksdb 2013-05-03 16:59:02 -07:00
merge_test.cc Merge operator for ttl 2013-08-01 09:27:17 -07:00
repair.cc Virtualize SkipList Interface 2013-07-23 14:42:27 -07:00
skiplist_test.cc Make arena block size configurable 2013-07-31 12:42:23 -07:00
skiplist.h Make arena block size configurable 2013-07-31 12:42:23 -07:00
skiplistrep.h Make arena block size configurable 2013-07-31 12:42:23 -07:00
snapshot.h [RocksDB] fix compaction filter trigger condition 2013-05-13 12:33:02 -07:00
table_cache.cc Use KeyMayExist for WriteBatch-Deletes 2013-07-23 13:36:50 -07:00
table_cache.h Use KeyMayExist for WriteBatch-Deletes 2013-07-23 13:36:50 -07:00
transaction_log_iterator_impl.cc [RocksDB] cleanup EnvOptions 2013-06-12 11:17:19 -07:00
transaction_log_iterator_impl.h [RocksDB] cleanup EnvOptions 2013-06-12 11:17:19 -07:00
version_edit_test.cc Make some variables configurable for each db instance 2012-06-27 14:36:31 -07:00
version_edit.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
version_edit.h Compact multiple memtables before flushing to storage. 2013-06-18 14:28:04 -07:00
version_set_reduce_num_levels.cc Fix valgrind errors in rocksdb tests: auto_roll_logger_test, reduce_levels_test 2013-03-12 16:03:16 -07:00
version_set_test.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
version_set.cc Expand KeyMayExist to return the proper value if it can be found in memory and also check block_cache 2013-08-01 09:07:46 -07:00
version_set.h Expand KeyMayExist to return the proper value if it can be found in memory and also check block_cache 2013-08-01 09:07:46 -07:00
write_batch_internal.h Use KeyMayExist for WriteBatch-Deletes 2013-07-23 13:36:50 -07:00
write_batch_test.cc Virtualize SkipList Interface 2013-07-23 14:42:27 -07:00
write_batch.cc Expand KeyMayExist to return the proper value if it can be found in memory and also check block_cache 2013-08-01 09:07:46 -07:00