From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 6 Sep 2018 13:26:31 +0300 From: Konstantin Osipov Subject: Re: [PATCH 8/8] vinyl: keep track of thread pool idle ratio Message-ID: <20180906102631.GI8205@chai> References: <20180906074937.GH8205@chai> <20180906081851.tlkeedihyfe5qoff@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180906081851.tlkeedihyfe5qoff@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: * Vladimir Davydov [18/09/06 11:19]: > > > 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 two new metrics to global > > > statistics, disk.dump_idle_ratio and compact_idle_ratio, which show how > > > much time dump threads and compaction threads were idle, respectively. > > > The metrics are updated using the following formula: > > > > > > idle_time > > > idle_ratio = -------------------------- > > > dump_period * worker_count > > > > I don't understand the formula. There can be many workers. > > Is idle time measured per worker or per entire pool? > > > > If it is measured per entire pool, how is idle time calculated if > > some workers are busy and some not? > > It is measured for entire pool - note that I divide the result by > worker_count. E.g. if there were two workers and one of them were > busy all the time between two last dumps while another were idle, > idle_ratio would be 0.5. This looks imprecise. Why not measure idle time of each worker and then even it out over the total number of workers? Besides, once again, how do you define the window over which you measure? -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov