[PATCH 13/18] vinyl: use lower bound percentile estimate for dump bandwidth

Vladimir Davydov vdavydov.dev at gmail.com
Thu Aug 16 19:12:07 MSK 2018


Use a lower bound estimate in order not to overestimate dump bandwidth.
For example, if an observation of 12 MB/s falls in bucket 10 .. 15, we
should use 10 MB/s to avoid stalls.
---
 src/box/vy_quota.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/box/vy_quota.c b/src/box/vy_quota.c
index 64c2ca04..620155ab 100644
--- a/src/box/vy_quota.c
+++ b/src/box/vy_quota.c
@@ -196,8 +196,13 @@ vy_quota_dump(struct vy_quota *q, size_t size, double duration)
 	/* Account dump bandwidth. */
 	if (duration > 0) {
 		histogram_collect(q->dump_bw_hist, size / duration);
-		q->dump_bw = histogram_percentile(q->dump_bw_hist,
-						  VY_DUMP_BANDWIDTH_PCT);
+		/*
+		 * To avoid unpredictably long stalls, we need to
+		 * know the worst (smallest) dump bandwidth so use
+		 * a lower-bound percentile estimate.
+		 */
+		q->dump_bw = histogram_percentile_lower(q->dump_bw_hist,
+							VY_DUMP_BANDWIDTH_PCT);
 	}
 }
 
-- 
2.11.0




More information about the Tarantool-patches mailing list