diff options
author | Brian Foster <bfoster@redhat.com> | 2012-10-22 19:19:50 -0400 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-11-21 13:49:47 -0800 |
commit | d8fbd9ec2a674c5bfa80d975dfb328674053f82f (patch) | |
tree | 333ebe74acd50d0b305f21f5b0fcc78cc09f5210 /tests | |
parent | 2e40e0f42807f23d447d7fae67c1e2f834904c53 (diff) |
perf/io-threads: least-rate-limit least priority throttling
The 'least-rate-limit' io-threads translator option enables
throttling of least priority operations. This is initially intended
as a debug/diagnostic tool for users who might experience
overloaded servers via background activity (i.e., self-heal).
least-rate-limit defines the maximum number of least priority
operations the io-threads translator will dequeue in one second.
If the specified rate limit is met, the worker threads sleep for
the minimal amount of time before the next least priority operation
becomes available (or until a new request arrives).
The requests/second metric is generic and relative to a variety of
factors involved with a background operation (server, storage,
etc.). The most recent measured rate ("cached least rate") is added
to the io-threads state dump content (kill -USR1) to serve as a
reference point to throttle background activity under particular
conditions.
Change-Id: I80f2282992137d57b1becaa5c6ae3858c066862a
BUG: 853680
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.org/4119
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/bugs/bug-853680.t | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/bugs/bug-853680.t b/tests/bugs/bug-853680.t new file mode 100755 index 00000000000..a4853c07f8b --- /dev/null +++ b/tests/bugs/bug-853680.t @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Bug 853680 +# +# Test that io-threads least-rate-limit throttling functions as expected. Set +# a limit, perform a few operations with a least-priority mount and verify +# said operations take a minimum amount of time according to the limit. + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd + +TEST $CLI volume create $V0 $H0:$B0/${V0}1 +TEST $CLI volume start $V0 + +# set rate limit to 1 operation/sec +TEST $CLI volume set $V0 performance.least-rate-limit 1 + +# use client-pid=-1 for least priority mount +TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 --client-pid=-1 + +# create a few files and verify this takes more than a few seconds +date1=`date +%s` +TEST touch $M0/file{0..2} +date2=`date +%s` + +optime=$(($date2 - $date1)) +TEST [ $optime -ge 3 ] + +TEST umount $M0 + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 + +cleanup; |