You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Pool Member / Multi-Host Considerations](#pool-member-multi-host-considerations)
20
27
<!--toc:end-->
21
28
22
29
## Overview
@@ -103,42 +110,86 @@ The caller classification allows wildcards for any field, though we require
103
110
that at least one field be specified. This lets us, for example, combine all
104
111
accesses from the xapi python API by specifying the user-agent .
105
112
106
-
In order to assist with rate limiting, we can store statistics about callers:
107
-
- Last request timestamp
113
+
A rate limiter can be associated with any number of callers, and the parameters
114
+
of the rate limiter can either be derived from the usage patterns of the
115
+
callers or selected from a number of preset profiles.
116
+
117
+
### Statistics
118
+
In order to assist with rate limiting, we can store statistics about callers.
119
+
We identify two kinds of statistics: volatile and stable. Volatile statistics
120
+
change over time without any input, e.g. sliding windows. These will be stored
121
+
in RRDs. By contrast, stable statistics only vary at most once per request, and
122
+
so are safe to store in the main database.
123
+
124
+
**Volatile statistics:**
108
125
- Tokens used over the last (5 minutes/hour/day).
109
-
- Most common API requests.
126
+
- Most common requests over the last (5 minutes/hour/day).
110
127
111
-
A rate limiter can then be attached to a particular caller, and the parameters
112
-
of the rate limiter can either be derived from the usage patterns of the caller
113
-
or selected from a number of preset profiles.
128
+
**Stable statistics:**
129
+
- Last request timestamp
114
130
115
131
## API design
116
-
We propose two new datamodels: **Caller** and **Rate_limit**.
132
+
133
+
### Caller Datamodel
134
+
We propose two new datamodel tables: **Caller**, which stores the data associated with each caller, and **Rate limit**, which identifies one or more callers with a rate limiter
0 commit comments