Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v2 02/11] vinyl: factor load regulator out of quota
Date: Tue, 2 Oct 2018 21:16:56 +0300	[thread overview]
Message-ID: <20181002181656.GA12422@chai> (raw)
In-Reply-To: <d4e75f2aa725f02934737ebadd609c7125e3f5fb.1538155645.git.vdavydov.dev@gmail.com>

* Vladimir Davydov <vdavydov.dev@gmail.com> [18/09/28 21:00]:
> Turned out that throttling isn't going to be as simple as maintaining
> the write rate below the estimated dump bandwidth, because we also need
> to take into account whether compaction keeps up with dumps. Tracking
> compaction progress isn't a trivial task and mixing it in a module
> responsible for resource limiting, which vy_quota is, doesn't seem to be
> a good idea. Let's factor out the related code into a separate module
> and call it vy_regulator. Currently, the new module only keeps track of
> the write rate and the dump bandwidth and sets the memory watermark
> accordingly, but soon we will extend it to configure throttling as well.

OK, if we keep regulator in place there is a few comments about
the contents of the patch (i.e. the renames).

> -	struct vy_quota *q = &env->quota;
> +	struct vy_regulator *r = &env->regulator;
>  
> -	info_table_begin(h, "quota");
> -	info_append_int(h, "used", q->used);
> -	info_append_int(h, "limit", q->limit);
> -	info_append_int(h, "watermark", q->watermark);
> -	info_append_int(h, "use_rate", q->use_rate);
> -	info_append_int(h, "dump_bandwidth", q->dump_bw);
> -	info_table_end(h); /* quota */
> +	info_table_begin(h, "regulator");
> +	info_append_int(h, "watermark", r->watermark);
> +	info_append_int(h, "write_rate", r->write_rate);
> +	info_append_int(h, "dump_bandwidth", r->dump_bw);

I think "watermark" should be now "dump_watermark", sicne simply
"watermark" is not specific enough. Is it regulator watermark? A
regulator watermark doesn't make any sense to me.

The rename should take place across the entire code base imho.

>  	assert(mem_used_after >= mem_used_before);
>  	vy_quota_adjust(&env->quota, tx->write_size,
>  			mem_used_after - mem_used_before);
> +	vy_regulator_check_watermark(&env->regulator);

Like check_dump_watermark.

>  vy_env_quota_exceeded_cb(struct vy_quota *quota)
>  {
>  	struct vy_env *env = container_of(quota, struct vy_env, quota);
> +	vy_regulator_no_memory(&env->regulator);

IMHO vy_regulator_quota_exceeded is a better name.
-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

  parent reply	other threads:[~2018-10-02 18:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28 17:39 [PATCH v2 00/11] vinyl: transaction throttling infrastructure Vladimir Davydov
2018-09-28 17:39 ` [PATCH v2 01/11] vinyl: add helper to start scheduler and enable quota on startup Vladimir Davydov
2018-09-29  4:37   ` [tarantool-patches] " Konstantin Osipov
2018-09-28 17:40 ` [PATCH v2 02/11] vinyl: factor load regulator out of quota Vladimir Davydov
2018-09-29  5:00   ` [tarantool-patches] " Konstantin Osipov
2018-09-29 11:36     ` Vladimir Davydov
     [not found]       ` <20180929114308.GA19162@chai>
2018-10-01 10:27         ` Vladimir Davydov
2018-10-01 10:31   ` Vladimir Davydov
2018-10-02 18:16   ` Konstantin Osipov [this message]
2018-10-03  8:49     ` [tarantool-patches] " Vladimir Davydov
2018-09-28 17:40 ` [PATCH v2 03/11] vinyl: minor refactoring of quota methods Vladimir Davydov
2018-09-29  5:01   ` [tarantool-patches] " Konstantin Osipov
2018-09-28 17:40 ` [PATCH v2 04/11] vinyl: move transaction size sanity check to quota Vladimir Davydov
2018-09-29  5:02   ` [tarantool-patches] " Konstantin Osipov
2018-09-28 17:40 ` [PATCH v2 05/11] vinyl: implement quota wait queue without fiber_cond Vladimir Davydov
2018-09-29  5:05   ` [tarantool-patches] " Konstantin Osipov
2018-09-29 11:44     ` Vladimir Davydov
2018-09-28 17:40 ` [PATCH v2 06/11] vinyl: enable quota upon recovery completion explicitly Vladimir Davydov
2018-09-29  5:06   ` [tarantool-patches] " Konstantin Osipov
2018-09-28 17:40 ` [PATCH v2 07/11] vinyl: zap vy_env::memory, read_threads, and write_threads Vladimir Davydov
2018-09-29  5:06   ` [tarantool-patches] " Konstantin Osipov
2018-09-28 17:40 ` [PATCH v2 08/11] vinyl: do not try to trigger dump in regulator if already in progress Vladimir Davydov
2018-09-28 17:40 ` [PATCH v2 09/11] vinyl: do not account zero dump bandwidth Vladimir Davydov
2018-10-12 13:27   ` Vladimir Davydov
2018-10-16 18:25     ` [tarantool-patches] " Konstantin Osipov
2018-10-17  8:44       ` Vladimir Davydov
2018-10-23  7:02         ` Konstantin Osipov
2018-09-28 17:40 ` [PATCH v2 10/11] vinyl: implement basic transaction throttling Vladimir Davydov
2018-09-28 17:40 ` [PATCH v2 11/11] vinyl: introduce quota consumer priorities Vladimir Davydov
2018-10-06 13:24   ` Konstantin Osipov
2018-10-08 11:10     ` Vladimir Davydov
2018-10-09 13:25       ` Vladimir Davydov
2018-10-11  7:02       ` Konstantin Osipov
2018-10-11  8:29         ` Vladimir Davydov
2018-10-03  9:06 ` [PATCH v2 00/11] vinyl: transaction throttling infrastructure Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181002181656.GA12422@chai \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 02/11] vinyl: factor load regulator out of quota' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox