diff --git a/lib/core/common.py b/lib/core/common.py index d7b6c5953..12a6fb9bc 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -100,6 +100,7 @@ from lib.core.settings import IS_WIN from lib.core.settings import LARGE_OUTPUT_THRESHOLD from lib.core.settings import MIN_ENCODED_LEN_CHECK from lib.core.settings import MIN_TIME_RESPONSES +from lib.core.settings import MIN_VALID_DELAYED_RESPONSE from lib.core.settings import ML from lib.core.settings import NULL from lib.core.settings import PARAMETER_AMP_MARKER @@ -1913,7 +1914,7 @@ def wasLastResponseDelayed(): logger.warn(warnMsg) lowerStdLimit = average(kb.responseTimes) + TIME_STDEV_COEFF * deviation - retVal = (threadData.lastQueryDuration >= lowerStdLimit) + retVal = (threadData.lastQueryDuration >= max(MIN_VALID_DELAYED_RESPONSE, lowerStdLimit)) if not kb.testMode and retVal: if kb.adjustTimeDelay is None: diff --git a/lib/core/settings.py b/lib/core/settings.py index 3edb4ecfd..05bfbbadf 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -64,6 +64,9 @@ CONCAT_VALUE_DELIMITER = '|' # Coefficient used for a time-based query delay checking (must be >= 7) TIME_STDEV_COEFF = 7 +# Minimum response time that can be even considered as delayed (not a complete requirement) +MIN_VALID_DELAYED_RESPONSE = 0.5 + # Standard deviation after which a warning message should be displayed about connection lags WARN_TIME_STDEV = 0.5