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
..
2013-03-14 16:00:23 -07:00
2013-06-12 11:17:19 -07:00
2013-06-12 11:17:19 -07:00
2013-08-05 15:43:49 -07:00
2013-05-23 11:49:38 -07:00
2012-09-16 19:33:43 -07:00
2012-12-17 11:26:59 -08:00
2012-12-17 11:26:59 -08:00
2013-02-28 18:04:58 -08:00
2013-08-01 09:27:17 -07:00
2013-07-23 14:42:27 -07:00
2013-07-31 12:42:23 -07:00
2013-02-28 18:04:58 -08:00
2013-02-28 18:04:58 -08:00