mirror of
https://github.com/Zygo/bees.git
synced 2025-07-01 00:02:27 +02:00
throttle: add delays to match deferred request rate to btrfs completion rate
Measure the time spent running various operations that extend btrfs transaction completion times (`LOGICAL_INO`, tmpfiles, and dedupe) and arrange for each operation to run for not less than the average amount of time by adding a sleep after each operation that takes less than the average. The delay after each operation is intended to slow down the rate of deferred and long-running requests from bees to match the rate at which btrfs is actually completing them. This may help avoid big spikes in latency if btrfs has so many requests queued that it has to force a commit to release memory. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -550,9 +550,8 @@ class BeesRoots : public enable_shared_from_this<BeesRoots> {
|
||||
Timer m_crawl_timer;
|
||||
BeesThread m_crawl_thread;
|
||||
BeesThread m_writeback_thread;
|
||||
bool m_workaround_btrfs_send = false;
|
||||
|
||||
RateEstimator m_transid_re;
|
||||
bool m_workaround_btrfs_send = false;
|
||||
|
||||
shared_ptr<BeesScanMode> m_scanner;
|
||||
|
||||
@ -889,6 +888,7 @@ string pretty(double d);
|
||||
void bees_readahead(int fd, off_t offset, size_t size);
|
||||
void bees_readahead_pair(int fd, off_t offset, size_t size, int fd2, off_t offset2, size_t size2);
|
||||
void bees_unreadahead(int fd, off_t offset, size_t size);
|
||||
void bees_throttle(double time_used, const char *context);
|
||||
string format_time(time_t t);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user