Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1 | ----------------------------------------------- |
| 2 | Stream Processing Offload Engine (SPOE) |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 3 | Version 1.2 |
Christopher Faulet | 3b78809 | 2020-05-13 08:25:12 +0200 | [diff] [blame] | 4 | ( Last update: 2020-06-13 ) |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 5 | ----------------------------------------------- |
| 6 | Author : Christopher Faulet |
| 7 | Contact : cfaulet at haproxy dot com |
| 8 | |
| 9 | |
| 10 | SUMMARY |
| 11 | -------- |
| 12 | |
| 13 | 0. Terms |
| 14 | 1. Introduction |
| 15 | 2. SPOE configuration |
| 16 | 2.1. SPOE scope |
| 17 | 2.2. "spoe-agent" section |
| 18 | 2.3. "spoe-message" section |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 19 | 2.4. "spoe-group" section |
| 20 | 2.5. Example |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 21 | 3. SPOP specification |
| 22 | 3.1. Data types |
| 23 | 3.2. Frames |
| 24 | 3.2.1. Frame capabilities |
| 25 | 3.2.2. Frame types overview |
| 26 | 3.2.3. Workflow |
| 27 | 3.2.4. Frame: HAPROXY-HELLO |
| 28 | 3.2.5. Frame: AGENT-HELLO |
| 29 | 3.2.6. Frame: NOTIFY |
| 30 | 3.2.7. Frame: ACK |
| 31 | 3.2.8. Frame: HAPROXY-DISCONNECT |
| 32 | 3.2.9. Frame: AGENT-DISCONNECT |
| 33 | 3.3. Events & messages |
| 34 | 3.4. Actions |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 35 | 3.5. Errors & timeouts |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 36 | 4. Logging |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 37 | |
| 38 | |
| 39 | 0. Terms |
| 40 | --------- |
| 41 | |
| 42 | * SPOE : Stream Processing Offload Engine. |
| 43 | |
Ilya Shipitsin | 11057a3 | 2020-06-21 21:18:27 +0500 | [diff] [blame] | 44 | A SPOE is a filter talking to servers managed by a SPOA to offload the |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 45 | stream processing. An engine is attached to a proxy. A proxy can have |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 46 | several engines. Each engine is linked to an agent and only one. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 47 | |
| 48 | * SPOA : Stream Processing Offload Agent. |
| 49 | |
| 50 | A SPOA is a service that will receive info from a SPOE to offload the |
| 51 | stream processing. An agent manages several servers. It uses a backend to |
| 52 | reference all of them. By extension, these servers can also be called |
| 53 | agents. |
| 54 | |
| 55 | * SPOP : Stream Processing Offload Protocol, used by SPOEs to talk to SPOA |
| 56 | servers. |
| 57 | |
| 58 | This protocol is used by engines to talk to agents. It is an in-house |
| 59 | binary protocol described in this documentation. |
| 60 | |
| 61 | |
| 62 | 1. Introduction |
| 63 | ---------------- |
| 64 | |
| 65 | SPOE is a feature introduced in HAProxy 1.7. It makes possible the |
| 66 | communication with external components to retrieve some info. The idea started |
| 67 | with the problems caused by most ldap libs not working fine in event-driven |
| 68 | systems (often at least the connect() is blocking). So, it is hard to properly |
| 69 | implement Single Sign On solution (SSO) in HAProxy. The SPOE will ease this |
| 70 | kind of processing, or we hope so. |
| 71 | |
| 72 | Now, the aim of SPOE is to allow any kind of offloading on the streams. First |
Christopher Faulet | 3b78809 | 2020-05-13 08:25:12 +0200 | [diff] [blame] | 73 | releases won't do lot of things. As we will see, there are few handled events |
| 74 | and even less actions supported. Actually, for now, the SPOE can offload the |
| 75 | processing before "tcp-request content", "tcp-response content", "http-request" |
| 76 | and "http-response" rules. And it only supports variables definition. But, in |
| 77 | spite of these limited features, we can easily imagine to implement SSO |
| 78 | solution, ip reputation or ip geolocation services. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 79 | |
Willy Tarreau | 8695199 | 2021-04-21 09:39:06 +0200 | [diff] [blame] | 80 | Some example implementations in various languages are linked to from the |
| 81 | HAProxy Wiki page dedicated to this mechanism: |
| 82 | |
| 83 | https://github.com/haproxy/wiki/wiki/SPOE:-Stream-Processing-Offloading-Engine |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 84 | |
| 85 | 2. SPOE configuration |
| 86 | ---------------------- |
| 87 | |
| 88 | Because SPOE is implemented as a filter, To use it, you must declare a "filter |
| 89 | spoe" line in a proxy section (frontend/backend/listen) : |
| 90 | |
| 91 | frontend my-front |
| 92 | ... |
| 93 | filter spoe [engine <name>] config <file> |
| 94 | ... |
| 95 | |
| 96 | The "config" parameter is mandatory. It specififies the SPOE configuration |
| 97 | file. The engine name is optional. It can be set to declare the scope to use in |
| 98 | the SPOE configuration. So it is possible to use the same SPOE configuration |
| 99 | for several engines. If no name is provided, the SPOE configuration must not |
| 100 | contain any scope directive. |
| 101 | |
| 102 | We use a separate configuration file on purpose. By commenting SPOE filter |
Michael Prokop | 4438c60 | 2019-05-24 10:25:45 +0200 | [diff] [blame] | 103 | line, you completely disable the feature, including the parsing of sections |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 104 | reserved to SPOE. This is also a way to keep the HAProxy configuration clean. |
| 105 | |
| 106 | A SPOE configuration file must contains, at least, the SPOA configuration |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 107 | ("spoe-agent" section) and SPOE messages/groups ("spoe-message" or "spoe-group" |
| 108 | sections) attached to this agent. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 109 | |
| 110 | IMPORTANT : The configuration of a SPOE filter must be located in a dedicated |
| 111 | file. But the backend used by a SPOA must be declared in HAProxy configuration |
| 112 | file. |
| 113 | |
| 114 | 2.1. SPOE scope |
| 115 | ------------------------- |
| 116 | |
| 117 | If you specify an engine name on the SPOE filter line, then you need to define |
| 118 | scope in the SPOE configuration with the same name. You can have several SPOE |
| 119 | scope in the same file. In each scope, you must define one and only one |
| 120 | "spoe-agent" section to configure the SPOA linked to your SPOE and several |
Ilya Shipitsin | 2a950d0 | 2020-03-06 13:07:38 +0500 | [diff] [blame] | 121 | "spoe-message" and "spoe-group" sections to describe, respectively, messages and |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 122 | group of messages sent to servers mananged by your SPOA. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 123 | |
| 124 | A SPOE scope starts with this kind of line : |
| 125 | |
| 126 | [<name>] |
| 127 | |
| 128 | where <name> is the same engine name specified on the SPOE filter line. The |
| 129 | scope ends when the file ends or when another scope is found. |
| 130 | |
| 131 | Example : |
| 132 | [my-first-engine] |
| 133 | spoe-agent my-agent |
| 134 | ... |
| 135 | spoe-message msg1 |
| 136 | ... |
| 137 | spoe-message msg2 |
| 138 | ... |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 139 | spoe-group grp1 |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 140 | ... |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 141 | spoe-group grp2 |
| 142 | ... |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 143 | |
| 144 | [my-second-engine] |
| 145 | ... |
| 146 | |
| 147 | If no engine name is provided on the SPOE filter line, no SPOE scope must be |
| 148 | found in the SPOE configuration file. All the file is considered to be in the |
| 149 | same anonymous and implicit scope. |
| 150 | |
Christopher Faulet | 7ee8667 | 2017-09-19 11:08:28 +0200 | [diff] [blame] | 151 | The engine name must be uniq for a proxy. If no engine name is provided on the |
Joseph Herlant | 71b4b15 | 2018-11-13 16:55:16 -0800 | [diff] [blame] | 152 | SPOE filter line, the SPOE agent name is used by default. |
Christopher Faulet | 7ee8667 | 2017-09-19 11:08:28 +0200 | [diff] [blame] | 153 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 154 | 2.2. "spoe-agent" section |
| 155 | -------------------------- |
| 156 | |
| 157 | For each engine, you must define one and only one "spoe-agent" section. In this |
| 158 | section, you will declare SPOE messages and the backend you will use. You will |
| 159 | also set timeouts and options to customize your agent's behaviour. |
| 160 | |
| 161 | |
| 162 | spoe-agent <name> |
| 163 | Create a new SPOA with the name <name>. It must have one and only one |
| 164 | "spoe-agent" definition by SPOE scope. |
| 165 | |
| 166 | Arguments : |
| 167 | <name> is the name of the agent section. |
| 168 | |
| 169 | following keywords are supported : |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 170 | - groups |
Christopher Faulet | 7250b8f | 2018-03-26 17:19:01 +0200 | [diff] [blame] | 171 | - log |
Christopher Faulet | 4802672 | 2016-11-16 15:01:12 +0100 | [diff] [blame] | 172 | - maxconnrate |
| 173 | - maxerrrate |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 174 | - max-frame-size |
Christopher Faulet | e8ade38 | 2018-01-25 15:32:22 +0100 | [diff] [blame] | 175 | - max-waiting-frames |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 176 | - messages |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 177 | - [no] option async |
Christopher Faulet | 0e0f085 | 2018-03-26 17:20:36 +0200 | [diff] [blame] | 178 | - [no] option dontlog-normal |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 179 | - [no] option pipelining |
| 180 | - [no] option send-frag-payload |
Christopher Faulet | ea62c2a | 2016-11-14 10:54:21 +0100 | [diff] [blame] | 181 | - option continue-on-error |
Christopher Faulet | 336d3ef | 2017-12-22 10:00:55 +0100 | [diff] [blame] | 182 | - option force-set-var |
Christopher Faulet | 985532d | 2016-11-16 15:36:19 +0100 | [diff] [blame] | 183 | - option set-on-error |
Christopher Faulet | 36bda1c | 2018-03-22 09:08:20 +0100 | [diff] [blame] | 184 | - option set-process-time |
| 185 | - option set-total-time |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 186 | - option var-prefix |
Christopher Faulet | 336d3ef | 2017-12-22 10:00:55 +0100 | [diff] [blame] | 187 | - register-var-names |
Christopher Faulet | 03a3449 | 2016-11-19 16:47:56 +0100 | [diff] [blame] | 188 | - timeout hello|idle|processing |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 189 | - use-backend |
| 190 | |
| 191 | |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 192 | groups <grp-name> ... |
| 193 | Declare the list of SPOE groups that an agent will handle. |
| 194 | |
| 195 | Arguments : |
| 196 | <grp-name> is the name of a SPOE group. |
| 197 | |
Joseph Herlant | 71b4b15 | 2018-11-13 16:55:16 -0800 | [diff] [blame] | 198 | Groups declared here must be found in the same engine scope, else an error is |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 199 | triggered during the configuration parsing. You can have many "groups" lines. |
| 200 | |
| 201 | See also: "spoe-group" section. |
| 202 | |
| 203 | |
Christopher Faulet | 7250b8f | 2018-03-26 17:19:01 +0200 | [diff] [blame] | 204 | log global |
| 205 | log <address> [len <length>] [format <format>] <facility> [<level> [<minlevel>]] |
| 206 | no log |
| 207 | Enable per-instance logging of events and traffic. |
| 208 | |
| 209 | Prefix : |
| 210 | no should be used when the logger list must be flushed. |
| 211 | |
| 212 | See the HAProxy Configuration Manual for details about this option. |
| 213 | |
Christopher Faulet | 4802672 | 2016-11-16 15:01:12 +0100 | [diff] [blame] | 214 | maxconnrate <number> |
| 215 | Set the maximum number of connections per second to <number>. The SPOE will |
| 216 | stop to open new connections if the maximum is reached and will wait to |
| 217 | acquire an existing one. So it is important to set "timeout hello" to a |
| 218 | relatively small value. |
| 219 | |
| 220 | |
| 221 | maxerrrate <number> |
| 222 | Set the maximum number of errors per second to <number>. The SPOE will stop |
| 223 | its processing if the maximum is reached. |
| 224 | |
| 225 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 226 | max-frame-size <number> |
| 227 | Set the maximum allowed size for frames exchanged between HAProxy and SPOA. |
| 228 | It must be in the range [256, tune.bufsize-4] (4 bytes are reserved for the |
| 229 | frame length). By default, it is set to (tune.bufsize-4). |
| 230 | |
Christopher Faulet | e8ade38 | 2018-01-25 15:32:22 +0100 | [diff] [blame] | 231 | max-waiting-frames <number> |
| 232 | Set the maximum number of frames waiting for an acknowledgement on the same |
| 233 | connection. This value is only used when the pipelinied or asynchronus |
| 234 | exchanges between HAProxy and SPOA are enabled. By default, it is set to 20. |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 235 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 236 | messages <msg-name> ... |
| 237 | Declare the list of SPOE messages that an agent will handle. |
| 238 | |
| 239 | Arguments : |
| 240 | <msg-name> is the name of a SPOE message. |
| 241 | |
| 242 | Messages declared here must be found in the same engine scope, else an error |
| 243 | is triggered during the configuration parsing. You can have many "messages" |
| 244 | lines. |
| 245 | |
| 246 | See also: "spoe-message" section. |
| 247 | |
| 248 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 249 | option async |
| 250 | no option async |
| 251 | Enable or disable the support of asynchronus exchanges between HAProxy and |
| 252 | SPOA. By default, this option is enabled. |
| 253 | |
| 254 | |
Christopher Faulet | ea62c2a | 2016-11-14 10:54:21 +0100 | [diff] [blame] | 255 | option continue-on-error |
| 256 | Do not stop the events processing when an error occurred on a stream. |
| 257 | |
| 258 | By default, for a specific stream, when an abnormal/unexpected error occurs, |
| 259 | the SPOE is disabled for all the transaction. So if you have several events |
Ilya Shipitsin | 11057a3 | 2020-06-21 21:18:27 +0500 | [diff] [blame] | 260 | configured, such error on an event will disabled all following. For TCP |
Christopher Faulet | ea62c2a | 2016-11-14 10:54:21 +0100 | [diff] [blame] | 261 | streams, this will disable the SPOE for the whole session. For HTTP streams, |
| 262 | this will disable it for the transaction (request and response). |
| 263 | |
| 264 | When set, this option bypass this behaviour and only the current event will |
| 265 | be ignored. |
| 266 | |
Christopher Faulet | 0e0f085 | 2018-03-26 17:20:36 +0200 | [diff] [blame] | 267 | |
| 268 | option dontlog-normal |
| 269 | no option dontlog-normal |
| 270 | Enable or disable logging of normal, successful processing. |
| 271 | |
| 272 | Arguments : none |
| 273 | |
| 274 | See also: "log" and section 4 about logging. |
| 275 | |
| 276 | |
Etienne Carriere | aec8989 | 2017-12-14 09:36:40 +0000 | [diff] [blame] | 277 | option force-set-var |
| 278 | By default, SPOE filter only register already known variables (mainly from |
| 279 | parsing of the configuration). If you want that haproxy trusts the agent and |
| 280 | registers all variables (ex: can be useful for LUA workload), activate this |
| 281 | option. |
| 282 | |
| 283 | Caution : this option opens to a variety of attacks such as a rogue SPOA that |
| 284 | asks to register too many variables. |
| 285 | |
Christopher Faulet | ea62c2a | 2016-11-14 10:54:21 +0100 | [diff] [blame] | 286 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 287 | option pipelining |
| 288 | no option pipelining |
| 289 | Enable or disable the support of pipelined exchanges between HAProxy and |
| 290 | SPOA. By default, this option is enabled. |
| 291 | |
| 292 | |
| 293 | option send-frag-payload |
| 294 | no option send-frag-payload |
| 295 | Enable or disable the sending of fragmented payload to SPOA. By default, this |
| 296 | option is enabled. |
| 297 | |
| 298 | |
Christopher Faulet | 985532d | 2016-11-16 15:36:19 +0100 | [diff] [blame] | 299 | option set-on-error <var name> |
| 300 | Define the variable to set when an error occurred during an event processing. |
| 301 | |
| 302 | Arguments : |
| 303 | |
| 304 | <var name> is the variable name, without the scope. The name may only |
| 305 | contain characters 'a-z', 'A-Z', '0-9', '.' and '_'. |
| 306 | |
| 307 | This variable will only be set when an error occurred in the scope of the |
| 308 | transaction. As for all other variables define by the SPOE, it will be |
| 309 | prefixed. So, if your variable name is "error" and your prefix is |
| 310 | "my_spoe_pfx", the variable will be "txn.my_spoe_pfx.error". |
| 311 | |
Christopher Faulet | b067b06 | 2017-01-04 16:39:11 +0100 | [diff] [blame] | 312 | When set, the variable is an integer representing the error reason. For values |
| 313 | under 256, it represents an error coming from the engine. Below 256, it |
| 314 | reports a SPOP error. In this case, to retrieve the right SPOP status code, |
| 315 | you must remove 256 to this value. Here are possible values: |
| 316 | |
| 317 | * 1 a timeout occurred during the event processing. |
| 318 | |
Michael Prokop | 4438c60 | 2019-05-24 10:25:45 +0200 | [diff] [blame] | 319 | * 2 an error was triggered during the resources allocation. |
Christopher Faulet | b067b06 | 2017-01-04 16:39:11 +0100 | [diff] [blame] | 320 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 321 | * 3 the frame payload exceeds the frame size and it cannot be |
| 322 | fragmented. |
| 323 | |
| 324 | * 4 the fragmentation of a payload is aborted. |
| 325 | |
Christopher Faulet | 344c4ab | 2017-09-22 10:20:13 +0200 | [diff] [blame] | 326 | * 5 The frame processing has been interrupted by HAProxy. |
| 327 | |
Christopher Faulet | b067b06 | 2017-01-04 16:39:11 +0100 | [diff] [blame] | 328 | * 255 an unknown error occurred during the event processing. |
| 329 | |
| 330 | * 256+N a SPOP error occurred during the event processing (see section |
| 331 | "Errors & timeouts"). |
| 332 | |
| 333 | Note that if "option continue-on-error" is set, the variable is not |
| 334 | automatically removed between events processing. |
Christopher Faulet | 985532d | 2016-11-16 15:36:19 +0100 | [diff] [blame] | 335 | |
| 336 | See also: "option continue-on-error", "option var-prefix". |
| 337 | |
Christopher Faulet | 36bda1c | 2018-03-22 09:08:20 +0100 | [diff] [blame] | 338 | |
| 339 | option set-process-time <var name> |
| 340 | Define the variable to set to report the processing time of the last event or |
| 341 | group. |
| 342 | |
| 343 | Arguments : |
| 344 | |
| 345 | <var name> is the variable name, without the scope. The name may only |
| 346 | contain characters 'a-z', 'A-Z', '0-9', '.' and '_'. |
| 347 | |
| 348 | This variable will be set in the scope of the transaction. As for all other |
| 349 | variables define by the SPOE, it will be prefixed. So, if your variable name |
| 350 | is "process_time" and your prefix is "my_spoe_pfx", the variable will be |
| 351 | "txn.my_spoe_pfx.process_time". |
| 352 | |
| 353 | When set, the variable is an integer representing the delay to process the |
| 354 | event or the group, in milliseconds. From the stream point of view, it is the |
| 355 | latency added by the SPOE processing for the last handled event or group. |
| 356 | |
| 357 | If several events or groups are processed for the same stream, this value |
| 358 | will be overrideen. |
| 359 | |
| 360 | See also: "option set-total-time". |
| 361 | |
| 362 | |
| 363 | option set-total-time <var name> |
| 364 | Define the variable to set to report the total processing time SPOE for a |
| 365 | stream. |
| 366 | |
| 367 | Arguments : |
| 368 | |
| 369 | <var name> is the variable name, without the scope. The name may only |
| 370 | contain characters 'a-z', 'A-Z', '0-9', '.' and '_'. |
| 371 | |
| 372 | This variable will be set in the scope of the transaction. As for all other |
| 373 | variables define by the SPOE, it will be prefixed. So, if your variable name |
| 374 | is "total_time" and your prefix is "my_spoe_pfx", the variable will be |
| 375 | "txn.my_spoe_pfx.total_time". |
| 376 | |
| 377 | When set, the variable is an integer representing the sum of processing times |
| 378 | for a stream, in milliseconds. From the stream point of view, it is the |
| 379 | latency added by the SPOE processing. |
| 380 | |
| 381 | If several events or groups are processed for the same stream, this value |
| 382 | will be updated. |
| 383 | |
| 384 | See also: "option set-process-time". |
| 385 | |
| 386 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 387 | option var-prefix <prefix> |
| 388 | Define the prefix used when variables are set by an agent. |
| 389 | |
| 390 | Arguments : |
| 391 | |
| 392 | <prefix> is the prefix used to limit the scope of variables set by an |
| 393 | agent. |
| 394 | |
| 395 | To avoid conflict with other variables defined by HAProxy, all variables |
| 396 | names will be prefixed. By default, the "spoe-agent" name is used. This |
| 397 | option can be used to customize it. |
| 398 | |
| 399 | The prefix will be added between the variable scope and its name, separated |
| 400 | by a '.'. It may only contain characters 'a-z', 'A-Z', '0-9', '.' and '_', as |
| 401 | for variables name. In HAProxy configuration, you need to use this prefix as |
| 402 | a part of the variables name. For example, if an agent define the variable |
| 403 | "myvar" in the "txn" scope, with the prefix "my_spoe_pfx", then you should |
| 404 | use "txn.my_spoe_pfx.myvar" name in your HAProxy configuration. |
| 405 | |
Etienne Carriere | aec8989 | 2017-12-14 09:36:40 +0000 | [diff] [blame] | 406 | By default, an agent will never set new variables at runtime: It can only set |
| 407 | new value for existing ones. If you want a different behaviour, see |
Christopher Faulet | 336d3ef | 2017-12-22 10:00:55 +0100 | [diff] [blame] | 408 | force-set-var option and register-var-names directive. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 409 | |
Christopher Faulet | 336d3ef | 2017-12-22 10:00:55 +0100 | [diff] [blame] | 410 | register-var-names <var name> ... |
| 411 | Register some variable names. By default, an agent will not be allowed to set |
| 412 | new variables at runtime. This rule can be totally relaxed by setting the |
| 413 | option "force-set-var". If you know all the variables you will need, this |
| 414 | directive is a good way to register them without letting an agent doing what |
| 415 | it want. This is only required if these variables are not referenced anywhere |
| 416 | in the HAProxy configuration or the SPOE one. |
| 417 | |
| 418 | Arguments: |
| 419 | <var name> is a variable name without the scope. The name may only |
| 420 | contain characters 'a-z', 'A-Z', '0-9', '.' and '_'. |
| 421 | |
| 422 | The prefix will be automatically added during the registration. You can have |
| 423 | many "register-var-names" lines. |
| 424 | |
| 425 | See also: "option force-set-var", "option var-prefix". |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 426 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 427 | timeout hello <timeout> |
| 428 | Set the maximum time to wait for an agent to receive the AGENT-HELLO frame. |
Christopher Faulet | f7a3092 | 2016-11-10 15:04:51 +0100 | [diff] [blame] | 429 | It is applied on the stream that handle the connection with the agent. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 430 | |
| 431 | Arguments : |
| 432 | <timeout> is the timeout value specified in milliseconds by default, but |
| 433 | can be in any other unit if the number is suffixed by the unit, |
| 434 | as explained at the top of this document. |
| 435 | |
| 436 | This timeout is an applicative timeout. It differ from "timeout connect" |
| 437 | defined on backends. |
| 438 | |
| 439 | |
| 440 | timeout idle <timeout> |
Christopher Faulet | f7a3092 | 2016-11-10 15:04:51 +0100 | [diff] [blame] | 441 | Set the maximum time to wait for an agent to close an idle connection. It is |
| 442 | applied on the stream that handle the connection with the agent. |
| 443 | |
| 444 | Arguments : |
| 445 | <timeout> is the timeout value specified in milliseconds by default, but |
| 446 | can be in any other unit if the number is suffixed by the unit, |
| 447 | as explained at the top of this document. |
| 448 | |
| 449 | |
| 450 | timeout processing <timeout> |
| 451 | Set the maximum time to wait for a stream to process an event, i.e to acquire |
| 452 | a stream to talk with an agent, to encode all messages, to send the NOTIFY |
| 453 | frame, to receive the corrsponding acknowledgement and to process all |
| 454 | actions. It is applied on the stream that handle the client and the server |
| 455 | sessions. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 456 | |
| 457 | Arguments : |
| 458 | <timeout> is the timeout value specified in milliseconds by default, but |
| 459 | can be in any other unit if the number is suffixed by the unit, |
| 460 | as explained at the top of this document. |
| 461 | |
| 462 | |
| 463 | use-backend <backend> |
| 464 | Specify the backend to use. It must be defined. |
| 465 | |
| 466 | Arguments : |
| 467 | <backend> is the name of a valid "backend" section. |
| 468 | |
| 469 | |
| 470 | 2.3. "spoe-message" section |
| 471 | ---------------------------- |
| 472 | |
| 473 | To offload the stream processing, SPOE will send messages with specific |
| 474 | information at a specific moment in the stream life and will wait for |
| 475 | corresponding replies to know what to do. |
| 476 | |
| 477 | |
| 478 | spoe-message <name> |
| 479 | Create a new SPOE message with the name <name>. |
| 480 | |
| 481 | Arguments : |
| 482 | <name> is the name of the SPOE message. |
| 483 | |
| 484 | Here you define a message that can be referenced in a "spoe-agent" |
| 485 | section. Following keywords are supported : |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 486 | - acl |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 487 | - args |
| 488 | - event |
| 489 | |
| 490 | See also: "spoe-agent" section. |
| 491 | |
| 492 | |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 493 | acl <aclname> <criterion> [flags] [operator] <value> ... |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 494 | Declare or complete an access list. |
| 495 | |
| 496 | See section 7 about ACL usage in the HAProxy Configuration Manual. |
| 497 | |
| 498 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 499 | args [name=]<sample> ... |
| 500 | Define arguments passed into the SPOE message. |
| 501 | |
| 502 | Arguments : |
| 503 | <sample> is a sample expression. |
| 504 | |
| 505 | When the message is processed, if a sample expression is not available, it is |
| 506 | set to NULL. Arguments are processed in their declaration order and added in |
Joseph Herlant | 71b4b15 | 2018-11-13 16:55:16 -0800 | [diff] [blame] | 507 | the message in that order. It is possible to declare named arguments. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 508 | |
| 509 | For example: |
| 510 | args frontend=fe_id src dst |
| 511 | |
| 512 | |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 513 | event <name> [ { if | unless } <condition> ] |
| 514 | Set the event that triggers sending of the message. It may optionally be |
| 515 | followed by an ACL-based condition, in which case it will only be evaluated |
| 516 | if the condition is true. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 517 | |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 518 | ACL-based conditions are executed in the context of the stream that handle |
| 519 | the client and the server connections. |
| 520 | |
| 521 | Arguments : |
| 522 | <name> is the event name. |
| 523 | <condition> is a standard ACL-based condition. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 524 | |
| 525 | Supported events are: |
| 526 | - on-client-session |
Christopher Faulet | 1002aac | 2016-12-09 17:41:54 +0100 | [diff] [blame] | 527 | - on-server-session |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 528 | - on-frontend-tcp-request |
| 529 | - on-backend-tcp-request |
| 530 | - on-tcp-response |
| 531 | - on-frontend-http-request |
| 532 | - on-backend-http-request |
| 533 | - on-http-response |
| 534 | |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 535 | See section "Events & Messages" for more details about supported events. |
| 536 | See section 7 about ACL usage in the HAProxy Configuration Manual. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 537 | |
Christopher Faulet | 11610f3 | 2017-09-21 10:23:10 +0200 | [diff] [blame] | 538 | 2.4. "spoe-group" section |
| 539 | -------------------------- |
| 540 | |
| 541 | This section can be used to declare a group of SPOE messages. Unlike messages |
| 542 | referenced in a "spoe-agent" section, messages inside a group are not sent on a |
| 543 | specific event. The sending must be triggered by TCP or HTTP rules, from the |
| 544 | HAProxy configuration. |
| 545 | |
| 546 | |
| 547 | spoe-group <name> |
| 548 | Create a new SPOE group with the name <name>. |
| 549 | |
| 550 | Arguments : |
| 551 | <name> is the name of the SPOE group. |
| 552 | |
| 553 | Here you define a group of SPOE messages that can be referenced in a |
| 554 | "spoe-agent" section. Following keywords are supported : |
| 555 | - messages |
| 556 | |
| 557 | See also: "spoe-agent" and "spoe-message" sections. |
| 558 | |
| 559 | |
| 560 | messages <msg-name> ... |
| 561 | Declare the list of SPOE messages belonging to the group. |
| 562 | |
| 563 | Arguments : |
| 564 | <msg-name> is the name of a SPOE message. |
| 565 | |
| 566 | Messages declared here must be found in the same engine scope, else an error |
| 567 | is triggered during the configuration parsing. Furthermore, a message belongs |
| 568 | at most to a group. You can have many "messages" lines. |
| 569 | |
| 570 | See also: "spoe-message" section. |
| 571 | |
| 572 | |
| 573 | 2.5. Example |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 574 | ------------- |
| 575 | |
| 576 | Here is a simple but complete example that sends client-ip address to a ip |
| 577 | reputation service. This service can set the variable "ip_score" which is an |
| 578 | integer between 0 and 100, indicating its reputation (100 means totally safe |
| 579 | and 0 a blacklisted IP with no doubt). |
| 580 | |
| 581 | ### |
| 582 | ### HAProxy configuration |
| 583 | frontend www |
| 584 | mode http |
| 585 | bind *:80 |
| 586 | |
| 587 | filter spoe engine ip-reputation config spoe-ip-reputation.conf |
| 588 | |
| 589 | # Reject connection if the IP reputation is under 20 |
| 590 | tcp-request content reject if { var(sess.iprep.ip_score) -m int lt 20 } |
| 591 | |
| 592 | default_backend http-servers |
| 593 | |
| 594 | backend http-servers |
| 595 | mode http |
| 596 | server http A.B.C.D:80 |
| 597 | |
| 598 | backend iprep-servers |
| 599 | mode tcp |
| 600 | balance roundrobin |
| 601 | |
| 602 | timeout connect 5s # greater than hello timeout |
| 603 | timeout server 3m # greater than idle timeout |
| 604 | |
| 605 | server iprep1 A1.B1.C1.D1:12345 |
| 606 | server iprep2 A2.B2.C2.D2:12345 |
| 607 | |
| 608 | #### |
| 609 | ### spoe-ip-reputation.conf |
| 610 | [ip-reputation] |
| 611 | |
| 612 | spoe-agent iprep-agent |
| 613 | messages get-ip-reputation |
| 614 | |
| 615 | option var-prefix iprep |
| 616 | |
Christopher Faulet | 03a3449 | 2016-11-19 16:47:56 +0100 | [diff] [blame] | 617 | timeout hello 2s |
| 618 | timeout idle 2m |
| 619 | timeout processing 10ms |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 620 | |
| 621 | use-backend iprep-servers |
| 622 | |
| 623 | spoe-message get-ip-reputation |
| 624 | args ip=src |
Christopher Faulet | 57583e4 | 2017-09-04 15:41:09 +0200 | [diff] [blame] | 625 | event on-client-session if ! { src -f /etc/haproxy/whitelist.lst } |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 626 | |
| 627 | |
| 628 | 3. SPOP specification |
| 629 | ---------------------- |
| 630 | |
| 631 | 3.1. Data types |
| 632 | ---------------- |
| 633 | |
| 634 | Here is the bytewise representation of typed data: |
| 635 | |
| 636 | TYPED-DATA : <TYPE:4 bits><FLAGS:4 bits><DATA> |
| 637 | |
| 638 | Supported types and their representation are: |
| 639 | |
| 640 | TYPE | ID | DESCRIPTION |
| 641 | -----------------------------+-----+---------------------------------- |
| 642 | NULL | 0 | NULL : <0> |
| 643 | Boolean | 1 | BOOL : <1+FLAG> |
| 644 | 32bits signed integer | 2 | INT32 : <2><VALUE:varint> |
| 645 | 32bits unsigned integer | 3 | UINT32 : <3><VALUE:varint> |
| 646 | 64bits signed integer | 4 | INT64 : <4><VALUE:varint> |
| 647 | 32bits unsigned integer | 5 | UNIT64 : <5><VALUE:varint> |
| 648 | IPV4 | 6 | IPV4 : <6><STRUCT IN_ADDR:4 bytes> |
| 649 | IPV6 | 7 | IPV6 : <7><STRUCT IN_ADDR6:16 bytes> |
| 650 | String | 8 | STRING : <8><LENGTH:varint><BYTES> |
| 651 | Binary | 9 | BINARY : <9><LENGTH:varint><BYTES> |
| 652 | 10 -> 15 unused/reserved | - | - |
| 653 | -----------------------------+-----+---------------------------------- |
| 654 | |
| 655 | Variable-length integer (varint) are encoded using Peers encoding: |
| 656 | |
| 657 | |
| 658 | 0 <= X < 240 : 1 byte (7.875 bits) [ XXXX XXXX ] |
| 659 | 240 <= X < 2288 : 2 bytes (11 bits) [ 1111 XXXX ] [ 0XXX XXXX ] |
| 660 | 2288 <= X < 264432 : 3 bytes (18 bits) [ 1111 XXXX ] [ 1XXX XXXX ] [ 0XXX XXXX ] |
| 661 | 264432 <= X < 33818864 : 4 bytes (25 bits) [ 1111 XXXX ] [ 1XXX XXXX ]*2 [ 0XXX XXXX ] |
| 662 | 33818864 <= X < 4328786160 : 5 bytes (32 bits) [ 1111 XXXX ] [ 1XXX XXXX ]*3 [ 0XXX XXXX ] |
| 663 | ... |
| 664 | |
| 665 | For booleans, the value (true or false) is the first bit in the FLAGS |
| 666 | bitfield. if this bit is set to 0, then the boolean is evaluated as false, |
| 667 | otherwise, the boolean is evaluated as true. |
| 668 | |
| 669 | 3.2. Frames |
| 670 | ------------ |
| 671 | |
| 672 | Exchange between HAProxy and agents are made using FRAME packets. All frames |
| 673 | must be prefixed with their size encoded on 4 bytes in network byte order: |
| 674 | |
| 675 | <FRAME-LENGTH:4 bytes> <FRAME> |
| 676 | |
| 677 | A frame always starts with its type, on one byte, followed by metadata |
| 678 | containing flags, on 4 bytes and a two variable-length integer representing the |
| 679 | stream identifier and the frame identifier inside the stream: |
| 680 | |
| 681 | FRAME : <FRAME-TYPE:1 byte> <METADATA> <FRAME-PAYLOAD> |
| 682 | METADATA : <FLAGS:4 bytes> <STREAM-ID:varint> <FRAME-ID:varint> |
| 683 | |
| 684 | Then comes the frame payload. Depending on the frame type, the payload can be |
| 685 | of three types: a simple key/value list, a list of messages or a list of |
| 686 | actions. |
| 687 | |
| 688 | FRAME-PAYLOAD : <LIST-OF-MESSAGES> | <LIST-OF-ACTIONS> | <KV-LIST> |
| 689 | |
| 690 | LIST-OF-MESSAGES : [ <MESSAGE-NAME> <NB-ARGS:1 byte> <KV-LIST> ... ] |
| 691 | MESSAGE-NAME : <STRING> |
| 692 | |
| 693 | LIST-OF-ACTIONS : [ <ACTION-TYPE:1 byte> <NB-ARGS:1 byte> <ACTION-ARGS> ... ] |
| 694 | ACTION-ARGS : [ <TYPED-DATA>... ] |
| 695 | |
| 696 | KV-LIST : [ <KV-NAME> <KV-VALUE> ... ] |
| 697 | KV-NAME : <STRING> |
| 698 | KV-VALUE : <TYPED-DATA> |
| 699 | |
Thierry FOURNIER | c4dcaff | 2018-05-18 12:25:39 +0200 | [diff] [blame] | 700 | FLAGS : |
| 701 | |
| 702 | Flags are a 32 bits field. They are encoded on 4 bytes in network byte |
| 703 | order, where the bit 0 is the LSB. |
| 704 | |
| 705 | 0 1 2-31 |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 706 | +---+---+----------+ |
| 707 | | | A | | |
| 708 | | F | B | | |
| 709 | | I | O | RESERVED | |
| 710 | | N | R | | |
| 711 | | | T | | |
| 712 | +---+---+----------+ |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 713 | |
| 714 | FIN: Indicates that this is the final payload fragment. The first fragment |
| 715 | may also be the final fragment. |
| 716 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 717 | ABORT: Indicates that the processing of the current frame must be |
| 718 | cancelled. This bit should be set on frames with a fragmented |
| 719 | payload. It can be ignore for frames with an unfragemnted |
| 720 | payload. When it is set, the FIN bit must also be set. |
| 721 | |
| 722 | |
Joseph Herlant | 71b4b15 | 2018-11-13 16:55:16 -0800 | [diff] [blame] | 723 | Frames cannot exceed a maximum size negotiated between HAProxy and agents |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 724 | during the HELLO handshake. Most of time, payload will be small enough to send |
| 725 | it in one frame. But when supported by the peer, it will be possible to |
| 726 | fragment huge payload on many frames. This ability is announced during the |
| 727 | HELLO handshake and it can be asynmetric (supported by agents but not by |
| 728 | HAProxy or the opposite). The following rules apply to fragmentation: |
| 729 | |
| 730 | * An unfragemnted payload consists of a single frame with the FIN bit set. |
| 731 | |
| 732 | * A fragemented payload consists of several frames with the FIN bit clear and |
| 733 | terminated by a single frame with the FIN bit set. All these frames must |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 734 | share the same STREAM-ID and FRAME-ID. The first frame must set the right |
| 735 | FRAME-TYPE (e.g, NOTIFY). The following frames must have an unset type (0). |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 736 | |
| 737 | Beside the support of fragmented payload by a peer, some payload must not be |
| 738 | fragmented. See below for details. |
| 739 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 740 | IMPORTANT : The maximum size supported by peers for a frame must be greater |
| 741 | than or equal to 256 bytes. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 742 | |
| 743 | 3.2.1. Frame capabilities |
| 744 | -------------------------- |
| 745 | |
| 746 | Here are the list of official capabilities that HAProxy and agents can support: |
| 747 | |
Christopher Faulet | a1cda02 | 2016-12-21 08:58:06 +0100 | [diff] [blame] | 748 | * fragmentation: This is the ability for a peer to support fragmented |
| 749 | payload in received frames. This is an asymmectical |
| 750 | capability, it only concerns the peer that announces |
| 751 | it. This is the responsibility to the other peer to use it |
| 752 | or not. |
| 753 | |
| 754 | * pipelining: This is the ability for a peer to decouple NOTIFY and ACK |
| 755 | frames. This is a symmectical capability. To be used, it must |
Willy Tarreau | 714f345 | 2021-05-09 06:47:26 +0200 | [diff] [blame] | 756 | be supported by HAProxy and agents. Unlike HTTP pipelining, the |
Christopher Faulet | a1cda02 | 2016-12-21 08:58:06 +0100 | [diff] [blame] | 757 | ACK frames can be send in any order, but always on the same TCP |
| 758 | connection used for the corresponding NOTIFY frame. |
| 759 | |
| 760 | * async: This ability is similar to the pipelining, but here any TCP |
| 761 | connection established between HAProxy and the agent can be used to |
| 762 | send ACK frames. if an agent accepts connections from multiple |
| 763 | HAProxy, it can use the "engine-id" value to group TCP |
| 764 | connections. See details about HAPROXY-HELLO frame. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 765 | |
| 766 | Unsupported or unknown capabilities are silently ignored, when possible. |
| 767 | |
Christopher Faulet | 9536ad7 | 2021-03-02 10:05:03 +0100 | [diff] [blame] | 768 | NOTE: HAProxy does not support the fragmentation for now. This means it is not |
| 769 | able to handle fragmented frames. However, if an agent announces the |
| 770 | fragmentation support, HAProxy may choose to send fragemented frames. |
| 771 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 772 | 3.2.2. Frame types overview |
| 773 | ---------------------------- |
| 774 | |
| 775 | Here are types of frame supported by SPOE. Frames sent by HAProxy come first, |
| 776 | then frames sent by agents : |
| 777 | |
| 778 | TYPE | ID | DESCRIPTION |
| 779 | -----------------------------+-----+------------------------------------- |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 780 | UNSET | 0 | Used for all frames but the first when a |
| 781 | | | payload is fragmented. |
| 782 | -----------------------------+-----+------------------------------------- |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 783 | HAPROXY-HELLO | 1 | Sent by HAProxy when it opens a |
| 784 | | | connection on an agent. |
| 785 | | | |
| 786 | HAPROXY-DISCONNECT | 2 | Sent by HAProxy when it want to close |
| 787 | | | the connection or in reply to an |
| 788 | | | AGENT-DISCONNECT frame |
| 789 | | | |
| 790 | NOTIFY | 3 | Sent by HAProxy to pass information |
| 791 | | | to an agent |
| 792 | -----------------------------+-----+------------------------------------- |
| 793 | AGENT-HELLO | 101 | Reply to a HAPROXY-HELLO frame, when |
| 794 | | | the connection is established |
| 795 | | | |
| 796 | AGENT-DISCONNECT | 102 | Sent by an agent just before closing |
| 797 | | | the connection |
| 798 | | | |
| 799 | ACK | 103 | Sent to acknowledge a NOTIFY frame |
| 800 | -----------------------------+-----+------------------------------------- |
| 801 | |
| 802 | Unknown frames may be silently skipped. |
| 803 | |
| 804 | 3.2.3. Workflow |
| 805 | ---------------- |
| 806 | |
| 807 | * Successful HELLO handshake: |
| 808 | |
| 809 | HAPROXY AGENT SRV |
| 810 | | HAPROXY-HELLO | |
Christopher Faulet | ba7bc16 | 2016-11-07 21:07:38 +0100 | [diff] [blame] | 811 | | (healthcheck: false) | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 812 | | --------------------------> | |
| 813 | | | |
| 814 | | AGENT-HELLO | |
| 815 | | <-------------------------- | |
| 816 | | | |
| 817 | |
Christopher Faulet | ba7bc16 | 2016-11-07 21:07:38 +0100 | [diff] [blame] | 818 | * Successful HELLO healthcheck: |
| 819 | |
| 820 | HAPROXY AGENT SRV |
| 821 | | HAPROXY-HELLO | |
| 822 | | (healthcheck: true) | |
| 823 | | --------------------------> | |
| 824 | | | |
| 825 | | AGENT-HELLO + close() | |
| 826 | | <-------------------------- | |
| 827 | | | |
| 828 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 829 | |
| 830 | * Error encountered by agent during the HELLO handshake: |
| 831 | |
| 832 | HAPROXY AGENT SRV |
| 833 | | HAPROXY-HELLO | |
| 834 | | --------------------------> | |
| 835 | | | |
| 836 | | DISCONNECT + close() | |
| 837 | | <-------------------------- | |
| 838 | | | |
| 839 | |
| 840 | * Error encountered by HAProxy during the HELLO handshake: |
| 841 | |
| 842 | HAPROXY AGENT SRV |
| 843 | | HAPROXY-HELLO | |
| 844 | | --------------------------> | |
| 845 | | | |
| 846 | | AGENT-HELLO | |
| 847 | | <-------------------------- | |
| 848 | | | |
| 849 | | DISCONNECT | |
| 850 | | --------------------------> | |
| 851 | | | |
| 852 | | DISCONNECT + close() | |
| 853 | | <-------------------------- | |
| 854 | | | |
| 855 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 856 | * Notify / Ack exchange (unfragmented payload): |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 857 | |
| 858 | HAPROXY AGENT SRV |
| 859 | | NOTIFY | |
| 860 | | --------------------------> | |
| 861 | | | |
| 862 | | ACK | |
| 863 | | <-------------------------- | |
| 864 | | | |
| 865 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 866 | * Notify / Ack exchange (fragmented payload): |
| 867 | |
| 868 | HAPROXY AGENT SRV |
| 869 | | NOTIFY (frag 1) | |
| 870 | | --------------------------> | |
| 871 | | | |
| 872 | | UNSET (frag 2) | |
| 873 | | --------------------------> | |
| 874 | | ... | |
| 875 | | UNSET (frag N) | |
| 876 | | --------------------------> | |
| 877 | | | |
| 878 | | ACK | |
| 879 | | <-------------------------- | |
| 880 | | | |
| 881 | |
| 882 | * Aborted fragmentation of a NOTIFY frame: |
| 883 | |
| 884 | HAPROXY AGENT SRV |
| 885 | | ... | |
| 886 | | UNSET (frag X) | |
| 887 | | --------------------------> | |
| 888 | | | |
| 889 | | ACK/ABORT | |
| 890 | | <-------------------------- | |
| 891 | | | |
| 892 | | UNSET (frag X+1) | |
| 893 | | -----------X | |
| 894 | | | |
| 895 | | | |
| 896 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 897 | * Connection closed by haproxy: |
| 898 | |
| 899 | HAPROXY AGENT SRV |
| 900 | | DISCONNECT | |
| 901 | | --------------------------> | |
| 902 | | | |
| 903 | | DISCONNECT + close() | |
| 904 | | <-------------------------- | |
| 905 | | | |
| 906 | |
| 907 | * Connection closed by agent: |
| 908 | |
| 909 | HAPROXY AGENT SRV |
| 910 | | DISCONNECT + close() | |
| 911 | | <-------------------------- | |
| 912 | | | |
| 913 | |
| 914 | 3.2.4. Frame: HAPROXY-HELLO |
| 915 | ---------------------------- |
| 916 | |
| 917 | This frame is the first one exchanged between HAProxy and an agent, when the |
| 918 | connection is established. The payload of this frame is a KV-LIST. It cannot be |
| 919 | fragmented. STREAM-ID and FRAME-ID are must be set 0. |
| 920 | |
| 921 | Following items are mandatory in the KV-LIST: |
| 922 | |
| 923 | * "supported-versions" <STRING> |
| 924 | |
| 925 | Last SPOP major versions supported by HAProxy. It is a comma-separated list |
| 926 | of versions, following the format "Major.Minor". Spaces must be ignored, if |
| 927 | any. When a major version is announced by HAProxy, it means it also support |
| 928 | all previous minor versions. |
| 929 | |
| 930 | Example: "2.0, 1.5" means HAProxy supports SPOP 2.0 and 1.0 to 1.5 |
| 931 | |
| 932 | * "max-frame-size" <UINT32> |
| 933 | |
| 934 | This is the maximum size allowed for a frame. The HAPROXY-HELLO frame must |
| 935 | be lower or equal to this value. |
| 936 | |
| 937 | * "capabilities" <STRING> |
| 938 | |
| 939 | This a comma-separated list of capabilities supported by HAProxy. Spaces |
| 940 | must be ignored, if any. |
| 941 | |
Christopher Faulet | ba7bc16 | 2016-11-07 21:07:38 +0100 | [diff] [blame] | 942 | Following optional items can be added in the KV-LIST: |
| 943 | |
| 944 | * "healthcheck" <BOOLEAN> |
| 945 | |
| 946 | If this item is set to TRUE, then the HAPROXY-HELLO frame is sent during a |
| 947 | SPOE health check. When set to FALSE, this item can be ignored. |
| 948 | |
Christopher Faulet | a1cda02 | 2016-12-21 08:58:06 +0100 | [diff] [blame] | 949 | * "engine-id" <STRING> |
| 950 | |
| 951 | This is a uniq string that identify a SPOE engine. |
| 952 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 953 | To finish the HELLO handshake, the agent must return an AGENT-HELLO frame with |
| 954 | its supported SPOP version, the lower value between its maximum size allowed |
| 955 | for a frame and the HAProxy one and capabilities it supports. If an error |
| 956 | occurs or if an incompatibility is detected with the agent configuration, an |
| 957 | AGENT-DISCONNECT frame must be returned. |
| 958 | |
| 959 | 3.2.5. Frame: AGENT-HELLO |
| 960 | -------------------------- |
| 961 | |
| 962 | This frame is sent in reply to a HAPROXY-HELLO frame to finish a HELLO |
| 963 | handshake. As for HAPROXY-HELLO frame, STREAM-ID and FRAME-ID are also set |
| 964 | 0. The payload of this frame is a KV-LIST and it cannot be fragmented. |
| 965 | |
| 966 | Following items are mandatory in the KV-LIST: |
| 967 | |
| 968 | * "version" <STRING> |
| 969 | |
| 970 | This is the SPOP version the agent supports. It must follow the format |
| 971 | "Major.Minor" and it must be lower or equal than one of major versions |
| 972 | announced by HAProxy. |
| 973 | |
| 974 | * "max-frame-size" <UINT32> |
| 975 | |
| 976 | This is the maximum size allowed for a frame. It must be lower or equal to |
| 977 | the value in the HAPROXY-HELLO frame. This value will be used for all |
| 978 | subsequent frames. |
| 979 | |
| 980 | * "capabilities" <STRING> |
| 981 | |
| 982 | This a comma-separated list of capabilities supported by agent. Spaces must |
| 983 | be ignored, if any. |
| 984 | |
| 985 | At this time, if everything is ok for HAProxy (supported version and valid |
| 986 | max-frame-size value), the HELLO handshake is successfully completed. Else, |
| 987 | HAProxy sends a HAPROXY-DISCONNECT frame with the corresponding error. |
| 988 | |
Christopher Faulet | ba7bc16 | 2016-11-07 21:07:38 +0100 | [diff] [blame] | 989 | If "healthcheck" item was set to TRUE in the HAPROXY-HELLO frame, the agent can |
| 990 | safely close the connection without DISCONNECT frame. In all cases, HAProxy |
Ilya Shipitsin | 11057a3 | 2020-06-21 21:18:27 +0500 | [diff] [blame] | 991 | will close the connection at the end of the health check. |
Christopher Faulet | ba7bc16 | 2016-11-07 21:07:38 +0100 | [diff] [blame] | 992 | |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 993 | 3.2.6. Frame: NOTIFY |
| 994 | --------------------- |
| 995 | |
| 996 | Information are sent to the agents inside NOTIFY frames. These frames are |
| 997 | attached to a stream, so STREAM-ID and FRAME-ID must be set. The payload of |
| 998 | NOTIFY frames is a LIST-OF-MESSAGES and, if supported by agents, it can be |
| 999 | fragmented. |
| 1000 | |
| 1001 | NOTIFY frames must be acknowledge by agents sending an ACK frame, repeating |
| 1002 | right STREAM-ID and FRAME-ID. |
| 1003 | |
| 1004 | 3.2.7. Frame: ACK |
| 1005 | ------------------ |
| 1006 | |
| 1007 | ACK frames must be sent by agents to reply to NOTIFY frames. STREAM-ID and |
| 1008 | FRAME-ID found in a NOTIFY frame must be reuse in the corresponding ACK |
| 1009 | frame. The payload of ACK frames is a LIST-OF-ACTIONS and, if supported by |
| 1010 | HAProxy, it can be fragmented. |
| 1011 | |
| 1012 | 3.2.8. Frame: HAPROXY-DISCONNECT |
| 1013 | --------------------------------- |
| 1014 | |
| 1015 | If an error occurs, at anytime, from the HAProxy side, a HAPROXY-DISCONNECT |
| 1016 | frame is sent with information describing the error. HAProxy will wait an |
| 1017 | AGENT-DISCONNECT frame in reply. All other frames will be ignored. The agent |
| 1018 | must then close the socket. |
| 1019 | |
| 1020 | The payload of this frame is a KV-LIST. It cannot be fragmented. STREAM-ID and |
| 1021 | FRAME-ID are must be set 0. |
| 1022 | |
| 1023 | Following items are mandatory in the KV-LIST: |
| 1024 | |
| 1025 | * "status-code" <UINT32> |
| 1026 | |
| 1027 | This is the code corresponding to the error. |
| 1028 | |
| 1029 | * "message" <STRING> |
| 1030 | |
| 1031 | This is a textual message describing the error. |
| 1032 | |
| 1033 | For more information about known errors, see section "Errors & timeouts" |
| 1034 | |
| 1035 | 3.2.9. Frame: AGENT-DISCONNECT |
| 1036 | ------------------------------- |
| 1037 | |
| 1038 | If an error occurs, at anytime, from the agent size, a AGENT-DISCONNECT frame |
Michael Prokop | 4438c60 | 2019-05-24 10:25:45 +0200 | [diff] [blame] | 1039 | is sent, with information describing the error. such frame is also sent in reply |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1040 | to a HAPROXY-DISCONNECT. The agent must close the socket just after sending |
| 1041 | this frame. |
| 1042 | |
| 1043 | The payload of this frame is a KV-LIST. It cannot be fragmented. STREAM-ID and |
| 1044 | FRAME-ID are must be set 0. |
| 1045 | |
| 1046 | Following items are mandatory in the KV-LIST: |
| 1047 | |
| 1048 | * "status-code" <UINT32> |
| 1049 | |
| 1050 | This is the code corresponding to the error. |
| 1051 | |
| 1052 | * "message" <STRING> |
| 1053 | |
| 1054 | This is a textual message describing the error. |
| 1055 | |
| 1056 | For more information about known errors, see section "Errors & timeouts" |
| 1057 | |
| 1058 | 3.3. Events & Messages |
| 1059 | ----------------------- |
| 1060 | |
| 1061 | Information about streams are sent in NOTIFY frames. You can specify which kind |
| 1062 | of information to send by defining "spoe-message" sections in your SPOE |
| 1063 | configuration file. for each "spoe-message" there will be a message in a NOTIFY |
| 1064 | frame when the right event is triggered. |
| 1065 | |
| 1066 | A NOTIFY frame is sent for an specific event when there is at least one |
| 1067 | "spoe-message" attached to this event. All messages for an event will be added |
| 1068 | in the same NOTIFY frame. |
| 1069 | |
| 1070 | Here is the list of supported events: |
| 1071 | |
| 1072 | * on-client-session is triggered when a new client session is created. |
| 1073 | This event is only available for SPOE filters |
| 1074 | declared in a frontend or a listen section. |
| 1075 | |
| 1076 | * on-frontend-tcp-request is triggered just before the evaluation of |
| 1077 | "tcp-request content" rules on the frontend side. |
| 1078 | This event is only available for SPOE filters |
| 1079 | declared in a frontend or a listen section. |
| 1080 | |
| 1081 | * on-backend-tcp-request is triggered just before the evaluation of |
| 1082 | "tcp-request content" rules on the backend side. |
| 1083 | This event is skipped for SPOE filters declared |
| 1084 | in a listen section. |
| 1085 | |
| 1086 | * on-frontend-http-request is triggered just before the evaluation of |
| 1087 | "http-request" rules on the frontend side. This |
| 1088 | event is only available for SPOE filters declared |
| 1089 | in a frontend or a listen section. |
| 1090 | |
| 1091 | * on-backend-http-request is triggered just before the evaluation of |
| 1092 | "http-request" rules on the backend side. This |
| 1093 | event is skipped for SPOE filters declared in a |
| 1094 | listen section. |
| 1095 | |
| 1096 | * on-server-session is triggered when the session with the server is |
| 1097 | established. |
| 1098 | |
| 1099 | * on-tcp-response is triggered just before the evaluation of |
| 1100 | "tcp-response content" rules. |
| 1101 | |
| 1102 | * on-http-response is triggered just before the evaluation of |
| 1103 | "http-response" rules. |
| 1104 | |
| 1105 | |
| 1106 | The stream processing will loop on these events, when triggered, waiting the |
| 1107 | agent reply. |
| 1108 | |
| 1109 | 3.4. Actions |
| 1110 | ------------- |
| 1111 | |
| 1112 | An agent must acknowledge each NOTIFY frame by sending the corresponding ACK |
| 1113 | frame. Actions can be added in these frames to dynamically take action on the |
| 1114 | processing of a stream. |
| 1115 | |
| 1116 | Here is the list of supported actions: |
| 1117 | |
| 1118 | * set-var set the value for an existing variable. 3 arguments must be |
| 1119 | attached to this action: the variable scope (proc, sess, txn, |
Kevin Zhu | 730323e | 2018-06-01 05:38:00 +0200 | [diff] [blame] | 1120 | req or res), the variable name (a string) and its value. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1121 | |
| 1122 | ACTION-SET-VAR : <SET-VAR:1 byte><NB-ARGS:1 byte><VAR-SCOPE:1 byte><VAR-NAME><VAR-VALUE> |
| 1123 | |
| 1124 | SET-VAR : <1> |
| 1125 | NB-ARGS : <3> |
| 1126 | VAR-SCOPE : <PROCESS> | <SESSION> | <TRANSACTION> | <REQUEST> | <RESPONSE> |
| 1127 | VAR-NAME : <STRING> |
| 1128 | VAR-VALUE : <TYPED-DATA> |
| 1129 | |
| 1130 | PROCESS : <0> |
| 1131 | SESSION : <1> |
| 1132 | TRANSACTION : <2> |
| 1133 | REQUEST : <3> |
Christopher Faulet | a1cda02 | 2016-12-21 08:58:06 +0100 | [diff] [blame] | 1134 | RESPONSE : <4> |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1135 | |
| 1136 | * unset-var unset the value for an existing variable. 2 arguments must be |
| 1137 | attached to this action: the variable scope (proc, sess, txn, |
Kevin Zhu | 730323e | 2018-06-01 05:38:00 +0200 | [diff] [blame] | 1138 | req or res) and the variable name (a string). |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1139 | |
Christopher Faulet | 1002aac | 2016-12-09 17:41:54 +0100 | [diff] [blame] | 1140 | ACTION-UNSET-VAR : <UNSET-VAR:1 byte><NB-ARGS:1 byte><VAR-SCOPE:1 byte><VAR-NAME> |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1141 | |
Christopher Faulet | 1002aac | 2016-12-09 17:41:54 +0100 | [diff] [blame] | 1142 | UNSET-VAR : <2> |
| 1143 | NB-ARGS : <2> |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1144 | VAR-SCOPE : <PROCESS> | <SESSION> | <TRANSACTION> | <REQUEST> | <RESPONSE> |
| 1145 | VAR-NAME : <STRING> |
| 1146 | |
| 1147 | PROCESS : <0> |
| 1148 | SESSION : <1> |
| 1149 | TRANSACTION : <2> |
| 1150 | REQUEST : <3> |
Christopher Faulet | a1cda02 | 2016-12-21 08:58:06 +0100 | [diff] [blame] | 1151 | RESPONSE : <4> |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1152 | |
| 1153 | |
| 1154 | NOTE: Name of the variables will be automatically prefixed by HAProxy to avoid |
| 1155 | name clashes with other variables used in HAProxy. Moreover, unknown |
| 1156 | variable will be silently ignored. |
| 1157 | |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 1158 | 3.5. Errors & timeouts |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1159 | ---------------------- |
| 1160 | |
| 1161 | Here is the list of all known errors: |
| 1162 | |
| 1163 | STATUS CODE | DESCRIPTION |
| 1164 | ----------------+-------------------------------------------------------- |
| 1165 | 0 | normal (no error occurred) |
| 1166 | 1 | I/O error |
| 1167 | 2 | A timeout occurred |
| 1168 | 3 | frame is too big |
| 1169 | 4 | invalid frame received |
| 1170 | 5 | version value not found |
| 1171 | 6 | max-frame-size value not found |
| 1172 | 7 | capabilities value not found |
| 1173 | 8 | unsupported version |
| 1174 | 9 | max-frame-size too big or too small |
Christopher Faulet | d1307ce | 2017-02-27 21:59:39 +0100 | [diff] [blame] | 1175 | 10 | payload fragmentation is not supported |
| 1176 | 11 | invalid interlaced frames |
| 1177 | 12 | frame-id not found (it does not match any referenced frame) |
| 1178 | 13 | resource allocation error |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1179 | 99 | an unknown error occurrde |
| 1180 | ----------------+-------------------------------------------------------- |
| 1181 | |
| 1182 | An agent can define its own errors using a not yet assigned status code. |
| 1183 | |
Christopher Faulet | ea62c2a | 2016-11-14 10:54:21 +0100 | [diff] [blame] | 1184 | IMPORTANT NOTE: By default, for a specific stream, when an abnormal/unexpected |
| 1185 | error occurs, the SPOE is disabled for all the transaction. So |
| 1186 | if you have several events configured, such error on an event |
Ilya Shipitsin | 11057a3 | 2020-06-21 21:18:27 +0500 | [diff] [blame] | 1187 | will disabled all following. For TCP streams, this will |
Christopher Faulet | ea62c2a | 2016-11-14 10:54:21 +0100 | [diff] [blame] | 1188 | disable the SPOE for the whole session. For HTTP streams, this |
| 1189 | will disable it for the transaction (request and response). |
| 1190 | See 'option continue-on-error' to bypass this limitation. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1191 | |
Joseph Herlant | 71b4b15 | 2018-11-13 16:55:16 -0800 | [diff] [blame] | 1192 | To avoid a stream to wait undefinetly, you must carefully choose the |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1193 | acknowledgement timeout. In most of cases, it will be quiet low. But it depends |
| 1194 | on the responsivness of your service. |
| 1195 | |
| 1196 | You must also choose idle timeout carefully. Because connection with your |
| 1197 | service depends on the backend configuration used by the SPOA, it is important |
| 1198 | to use a lower value for idle timeout than the server timeout. Else the |
| 1199 | connection will be closed by HAProxy. The same is true for hello timeout. You |
| 1200 | should choose a lower value than the connect timeout. |
| 1201 | |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 1202 | 4. Logging |
| 1203 | ----------- |
| 1204 | |
| 1205 | Activity of an SPOE is logged using HAProxy's logger. The messages are logged |
| 1206 | in the context of the streams that handle the client and the server |
| 1207 | connections. A message is emitted for each event or group handled by an |
| 1208 | SPOE. Depending on the status code, the log level will be different. In the |
| 1209 | normal case, when no error occurred, the message is logged with the level |
| 1210 | LOG_NOTICE. Otherwise, the message is logged with the level LOG_WARNING. |
| 1211 | |
Christopher Faulet | 3b8e349 | 2018-03-26 17:20:58 +0200 | [diff] [blame] | 1212 | The messages are logged using the agent's logger, if defined, and use the |
| 1213 | following format: |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 1214 | |
Christopher Faulet | 6e0d5e7 | 2018-04-26 14:25:43 +0200 | [diff] [blame] | 1215 | SPOE: [AGENT] <TYPE:NAME> sid=STREAM-ID st=STATUS-CODE reqT/qT/wT/resT/pT \ |
Christopher Faulet | caf2fec | 2018-04-04 10:25:50 +0200 | [diff] [blame] | 1216 | <idles>/<applets> <nb_sending>/<nb_waiting> <nb_error>/<nb_processed> |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 1217 | |
| 1218 | AGENT is the agent name |
| 1219 | TYPE is EVENT of GROUP |
| 1220 | NAME is the event or the group name |
| 1221 | STREAM-ID is an integer, the unique id of the stream |
| 1222 | STATUS_CODE is the processing's status code |
| 1223 | reqT/qT/wT/resT/pT are the following time events: |
| 1224 | |
| 1225 | * reqT : the encoding time. It includes ACLs processing, if any. For |
| 1226 | fragmented frames, it is the sum of all fragments. |
| 1227 | * qT : the delay before the request gets out the sending queue. For |
| 1228 | fragmented frames, it is the sum of all fragments. |
Joseph Herlant | 71b4b15 | 2018-11-13 16:55:16 -0800 | [diff] [blame] | 1229 | * wT : the delay before the response is received. No fragmentation |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 1230 | supported here. |
| 1231 | * resT : the delay to process the response. No fragmentation supported |
Christopher Faulet | 36bda1c | 2018-03-22 09:08:20 +0100 | [diff] [blame] | 1232 | here. |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 1233 | * pT : the delay to process the event or the group. From the stream |
Christopher Faulet | 36bda1c | 2018-03-22 09:08:20 +0100 | [diff] [blame] | 1234 | point of view, it is the latency added by the SPOE processing. |
| 1235 | It is more or less the sum of values above. |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 1236 | |
Christopher Faulet | caf2fec | 2018-04-04 10:25:50 +0200 | [diff] [blame] | 1237 | <idle> is the numbers of idle SPOE applets |
| 1238 | <applets> is the numbers of SPOE applets |
| 1239 | <nb_sending> is the numbers of streams waiting to send data |
| 1240 | <nb_waiting> is the numbers of streams waiting for a ack |
| 1241 | <nb_error> is the numbers of processing errors |
| 1242 | <nb_processed> is the numbers of events/groups processed |
| 1243 | |
| 1244 | |
Christopher Faulet | b2dd1e0 | 2018-03-22 09:07:41 +0100 | [diff] [blame] | 1245 | For all these time events, -1 means the processing was interrupted before the |
| 1246 | end. So -1 for the queue time means the request was never dequeued. For |
| 1247 | fragmented frames it is harder to know when the interruption happened. |
Christopher Faulet | f7e4e7e | 2016-10-27 22:29:49 +0200 | [diff] [blame] | 1248 | |
| 1249 | /* |
| 1250 | * Local variables: |
| 1251 | * fill-column: 79 |
| 1252 | * End: |
| 1253 | */ |