From dc4c76e573994eeb92d7111c782f4229037a4130 Mon Sep 17 00:00:00 2001 From: Emoly Liu Date: Tue, 10 Apr 2018 14:19:39 +0800 Subject: [PATCH] LUDOC-328 tbf: add UID/GID based policy to NRS-TBF section Update NRS-TBF policy section to reflect UID/GID based TBF policy: - format: uid={uid} or gid={gid} or uid={uid}&gid={gid} - Lustre-commit: e0cdde123c14729a340cf937cf9580be7c9dd9c1 - Lustre-change: http://review.whamcloud.com/27608 Change-Id: I49302f35bb6fae3de9410a8b84940aa8df7b0ca7 Signed-off-by: Emoly Liu Reviewed-on: https://review.whamcloud.com/31769 Tested-by: Jenkins Reviewed-by: Joseph Gmitter --- LustreTuning.xml | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/LustreTuning.xml b/LustreTuning.xml index c31812f..cca32d5 100644 --- a/LustreTuning.xml +++ b/LustreTuning.xml @@ -1634,15 +1634,16 @@ ost.OSS.ost_io.nrs_orr_supported=reg_supported:reads_and_writes lctl set_param ost.OSS.ost_io.nrs_policies="tbf <policy>" For now, the RPCs can be classified into the different types - according to their NID, JOBID and OPCode. (UID/GID will be supported - soon.) When enabling TBF policy, you can specify one of the types, or - just use "tbf" to enable all of them to do a fine-grained RPC requests - classification. + according to their NID, JOBID, OPCode and UID/GID. When enabling TBF + policy, you can specify one of the types, or just use "tbf" to enable + all of them to do a fine-grained RPC requests classification. Example: $ lctl set_param ost.OSS.ost_io.nrs_policies="tbf" $ lctl set_param ost.OSS.ost_io.nrs_policies="tbf nid" $ lctl set_param ost.OSS.ost_io.nrs_policies="tbf jobid" -$ lctl set_param ost.OSS.ost_io.nrs_policies="tbf opcode" +$ lctl set_param ost.OSS.ost_io.nrs_policies="tbf opcode" +$ lctl set_param ost.OSS.ost_io.nrs_policies="tbf uid" +$ lctl set_param ost.OSS.ost_io.nrs_policies="tbf gid"
Start a TBF rule @@ -1706,7 +1707,7 @@ $ lctl set_param ost.OSS.ost_io.nrs_tbf_rule=\ linkend="dbdoclet.jobstats" /> for more details. Command: lctl set_param x.x.x.nrs_tbf_rule= -"[reg|hp] start name jobid={jobid_list} rate=rate" +"[reg|hp] start rule_name jobid={jobid_list} rate=rate" Wildcard is supported in {jobid_list}. @@ -1730,7 +1731,7 @@ $ lctl set_param ost.OSS.ost_io.nrs_tbf_rule=\ Opcode based TBF policy Command: $ lctl set_param x.x.x.nrs_tbf_rule= -"[reg|hp] start name opcode={opcode_list} rate=rate" +"[reg|hp] start rule_name opcode={opcode_list} rate=rate" Example: $ lctl set_param ost.OSS.ost_io.nrs_tbf_rule=\ @@ -1745,11 +1746,33 @@ $ lctl set_param ost.OSS.ost_io.nrs_tbf_rule=\ "reg start iozone_user1 opcode={ost_read} rate=100" + UID/GID based TBF policy + Command: + $ lctl set_param ost.OSS.*.nrs_tbf_rule=\ +"[reg][hp] start rule_name uid={uid} rate=rate" +$ lctl set_param ost.OSS.*.nrs_tbf_rule=\ +"[reg][hp] start rule_name gid={gid} rate=rate" + Exapmle: + Limit the rate of RPC requests of the uid 500 + $ lctl set_param ost.OSS.*.nrs_tbf_rule=\ +"start tbf_name uid={500} rate=100" + Limit the rate of RPC requests of the gid 500 + $ lctl set_param ost.OSS.*.nrs_tbf_rule=\ +"start tbf_name gid={500} rate=100" + Also, you can use the following rule to control all reqs + to mds: + Start the tbf uid QoS on MDS: + $ lctl set_param mds.MDS.*.nrs_policies="tbf uid" + Limit the rate of RPC requests of the uid 500 + $ lctl set_param mds.MDS.*.nrs_tbf_rule=\ +"start tbf_name uid={500} rate=100" + + Policy combination - To support rules with complex expressions of NID/JOBID/OPCode - conditions, TBF classifier is extented to classify RPC in a more - fine-grained way. This feature supports logical conditional - conjunction and disjunction operations among different types. + To support TBF rules with complex expressions of conditions, + TBF classifier is extented to classify RPC in a more fine-grained + way. This feature supports logical conditional conjunction and + disjunction operations among different types. In the rule: "&" represents the conditional conjunction and "," represents the conditional disjunction. @@ -1780,6 +1803,11 @@ default * 10000, ref 0 CPT 1: comp_rule opcode={ost_write}&jobid={dd.0},nid={192.168.1.[1-128]@tcp 0@lo} 100, ref 0 default * 10000, ref 0 + Example: + $ lctl set_param ost.OSS.*.nrs_tbf_rule=\ +"start tbf_name uid={500}&gid={500} rate=100" + In this example, those RPC requests whose uid is 500 and + gid is 500 will be processed at the rate of 100 req/sec.
-- 1.8.3.1