commit | d6e7a78ccffba459860df6ffcfd9e022569118de | [log] [tgz] |
---|---|---|
author | Russell Branca <chewbranca@apache.org> | Fri Apr 12 22:36:18 2019 +0000 |
committer | Russell Branca <chewbranca@apache.org> | Fri Apr 12 22:45:42 2019 +0000 |
tree | b49bb5670a5cbf47f6d668c1a26aff1e82281fee | |
parent | 08c6bbb67031c39d48a1beb1b74ea21de38ded3a [diff] |
Allow dynamic classes in is_valid_class This adds support for dynamic classes in IOQ2. Before this change, the allowed set of classes was fixed and hardcoded, with no way for 3rd party IO traffic to be prioritized, and similarly, no way for 3rd party IO traffic to bypass IOQ based on config settings. This change switches to checking to see if there's a declared IO priority value in the classes config, and if so it is treated as a valid value. It's worth noting that because `ioq_config:set_class_config` uses the `is_valid_class` check, you must use `config:set` directly to declare an initial priority for the dynamic channel before being able to use the `ioq_config` helpers. This change was motivated by not being able to bypass search in the Dreyfus project, as it piggy-backed off of `interactive` and `view_update` channels. That was rectified in [1], and now Dreyfus uses the `search` IOQ channel. As that is not used in CouchDB directly, this commit adds the dynamic class support based off of config values, rather than specifically hardcoding search, so that it can be used by any 3rd party services running IO traffic through IOQ. [1] https://github.com/cloudant-labs/dreyfus/pull/46/commits/75d86c49c86f4e7e299d2d05a741c4ef68a144fb
The following are the list of IOQ classes:
One can configure an ioq bypass, which removes an IO class from prioritization, as below:
config:set("ioq.bypass", "view_update", "true")
Note that setting an IOQ bypass can effectively trump all other classes, especially in the case of an interactive bypass v. compaction. This can lead to high disk usage.
The priority for a class can also be set ala:
config:set("ioq", "compaction", "0.3")
Or globally, using snippet/rpc:
s:set_config("ioq", "compaction", "0.314", global) rpc:multicall(config, set, ["ioq", "compaction", "0.217"])
As the interactive class is ‘everything else’ its priority cannot be directly set.