From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 4 Sep 2018 14:54:04 +0300 From: Vladimir Davydov Subject: Re: [PATCH 7/7] vinyl: keep track of disk idle time Message-ID: <20180904115404.el6kdswgitsnopgf@esperanza> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: kostja@tarantool.org Cc: tarantool-patches@freelists.org List-ID: Please ignore this patch, because it's incorrect: since we always keep one worker reserved for dumps it will should that the disk is 1/box.cfg.vinyl_writers idle even if compaction never stops, which is misleading. I'll rework and resend it separately. On Sun, Sep 02, 2018 at 11:19:00PM +0300, Vladimir Davydov wrote: > To understand whether the disk is fully utilized or can still handle > more compaction load and make right decisions regarding transaction > throttling, we need a metric that would report how much time worker > threads spent being idle. So this patch adds a new metric to global > statistics, box.stat.vinyl().disk.idle_ratio. The metric is updated > on each dump using the following formula: > > idle_time > idle_ratio = -------------------------- > dump_period * worker_count > > where idle_time is the total amount of time workers were idle between > the last two dumps, dump_period is the time that passed between the last > two dumps, worker_count is the number of workers. > > The value of the new metric always lays between 0 inclusive and 1 > exclusive. The closer it is to 1 the more busy the disk is. > --- > src/box/vinyl.c | 1 + > src/box/vy_scheduler.c | 48 +++++++++++++++++++++++++++++++---- > src/box/vy_scheduler.h | 12 +++++++++ > test/vinyl/errinj.result | 62 ++++++++++++++++++++++++++++++++++++++++++++++ > test/vinyl/errinj.test.lua | 22 ++++++++++++++++ > test/vinyl/info.result | 1 + > test/vinyl/info.test.lua | 1 + > 7 files changed, 142 insertions(+), 5 deletions(-)