Browse Source

Ignore ping time changes < 5ms.

master
Bernd Zeimetz 10 years ago
parent
commit
6f560196b2
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      mpath_prio_open-iscsi

+ 4
- 1
mpath_prio_open-iscsi View File

@@ -122,8 +122,11 @@ def getprio(device):
# (davg is measured ms, rounded to an int)
# lets assume that 100ms is the worst case of a useful connection
# and base the priority on that
# also we do not care about changes < 5ms, changing the priority too
# often doesn't make much sense.

prio = 100 - davg
prio = 100 - int(davg/5)*5 # davg should be an int,
# but lets make sure the result is)

# return 0 if prio < 0:
return max((0, prio))


Loading…
Cancel
Save