-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
delay
78 lines (73 loc) · 2.2 KB
/
delay
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -*- text -*-
#
# :toc:
#
# $Id$
#######################################################################
#
# ## Delay Module
#
# The `delay` module delays the processing of a request in a
# non-blocking fashion.
#
# The module is most useful for rate limiting reject responses.
# Instead of having a specific "reject delay" configuration, it is
# instead possible to have a policy that delays the response.
#
# The module can also be used to introduce artificial jitter into
# responses.
#
#
# ## Default instance
#
delay {
#
# delay:: How long to delay request processing for.
#
delay = 1.0
#
# force_reschedule:: Whether the request should be rescheduled even if no
# delay is needed.
#
# Rescheduling the request pauses it momentarily, and
# introduces a small delay. It allows for processing of
# other requests ahead of this one. The result is a small
# amount of "jitter" in responses, which can help avoid some
# deterministic timings in the network.
#
# force_reschedule = no
#
# relative:: Whether delay should be calculated relative to when
# the request was received.
#
# This configuration can be useful for rate limiting, as most
# NAS will only allow a limited number of request to be in
# flight.
#
# The default is `no`, which means that.
#
# relative = no
}
#
# ## Delaying Access-Reject packets
#
# The `delay_reject` module should be used in a 'send Access-Reject' section, as
# the last module in that section. When `delay_reject` is used
# there, the reject will be delayed for either the Response-Delay
# seconds, or if that attribute does not exist, then one second.
#
# While the response is delayed, the server will continue processing
# other requests. It will simply set a timer to wake up and send the
# response after the delay.
#
# Note that we set `relative = yes` here. That setting ensures that
# if the server takes more than one second to process the request,
# then the `delay_reject` module will not add *additional* delays.
# Instead, this module will ensure that the `Access-Reject` is sent
# no earlier than one second after the `Access-Request` had been
# received.
#
delay delay_reject {
delay = "%{reply:Response-Delay:-1}"
relative = yes
}