Whamcloud - gitweb
LU-6283 ptlrpc: Implement NRS Delay Policy 01/14701/32
authorChris Horn <hornc@cray.com>
Thu, 12 Mar 2015 23:25:14 +0000 (18:25 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 23 Apr 2017 03:30:27 +0000 (03:30 +0000)
commit588831e9eac38b8514f2a3e71516b44fa7c4bcce
treeb2bf8ea23f2749c6276db99487088aa9afc14f02
parent98270274cca545b79d2cf505ebfe2eae5c4fb374
LU-6283 ptlrpc: Implement NRS Delay Policy

The NRS Delay policy seeks to perturb the timing of request processing
at the PtlRPC layer, with the goal of simulating high server load, and
finding and exposing timing related problems. When this policy is
active, upon arrival of a request the policy will calculate an offset,
within a defined, user-configurable range, from the request arrival
time, to determine a time after which the request should be handled.
The request is then stored using the cfs_binheap implementation,
which sorts the request according to the assigned start time.
Requests are removed from the binheap for handling once their start
time has been passed.

The behavior of the policy can be controlled via three proc files
which can be written to via lctl similar to other policies.

nrs_delay_min: Controls the minimum amount of time, in seconds, that a
request will be delayed by this policy. The default is 5 seconds.

nrs_delay_max: Controls the maximum amount of time, in seconds, that a
request will be delayed by this policy. The default is 300 seconds.

nrs_delay_pct: Control the percentage of requests that will be delayed
by this policy. The default is 100. Note, when a request is not
selected for handling by the delay policy due to this variable then
the request will be handled by whatever fallback policy is defined
for that service. If no other fallback policy is defined then the
request will be handled by the FIFO policy.

Some examples:

lctl set_param *.*.*.nrs_delay_min=reg_delay_min:5, to set the regular
request minimum delay on all PtlRPC services to 5 seconds.

lctl set_param *.*.*.nrs_delay_min=hp_delay_min:2, to set the
high-priority request minimum delay on all PtlRPC services to 2
seconds.

lctl set_param *.*.ost_io.nrs_delay_min=8, to set both the regular and
high-priority request minimum delay of the ost_io service to 8
seconds.

lctl set_param *.*.*.nrs_delay_max=reg_delay_max:20, to set the
regular request maximum delay on all PtlRPC services to 20 seconds.

lctl set_param *.*.*.nrs_delay_max=hp_delay_max:10, to set the
high-priority request maximum delay on all PtlRPC services to 10
seconds.

lctl set_param *.*.ost_io.nrs_delay_max=35, to set both the regular
and high-priority request maximum delay of the ost_io service to 35
seconds.

lctl set_param *.*.*.nrs_delay_pct=reg_delay_pct:5, to delay 5
percent of regular requests on all PtlRPC services.

lctl set_param *.*.*.nrs_delay_pct=hp_delay_pct:2, to delay 2 percent
of high-priority requests on all PtlRPC services.

lctl set_param *.*.ost_io.nrs_delay_pct=8, to delay 8 percent of both
regular and high-priority requests of the ost_io service.

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Iab50a639900adf31893c7b1fe83658932fd59db1
Reviewed-on: https://review.whamcloud.com/14701
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/Makefile.am
lustre/include/lustre_nrs.h
lustre/include/lustre_nrs_delay.h [new file with mode: 0644]
lustre/ptlrpc/Makefile.in
lustre/ptlrpc/nrs.c
lustre/ptlrpc/nrs_delay.c [new file with mode: 0644]
lustre/ptlrpc/ptlrpc_internal.h
lustre/tests/sanityn.sh [changed mode: 0644->0755]