Forum Discussion
ingard
Nimbostratus
10 years agoirule to log slow and/or tcp profile timed out requests to backend
Hi
I'm trying to identify which requests are causing our backends to stop responding/hang/fail.
I was thinking some sort of timer and/or catch the tcp timeout rst maybe? I've been trying to figu...
Kai_Wilke
MVP
10 years agoHi Ingard,
unfortunately there is no way to access TCP flags (PSH, RST, etc.) using iRules.
But you may try this snipped as a starting point to identify slow server responses...
when RULE_INIT {
set static::timeout 10000 ; msec
}
when HTTP_REQUEST {
set debug(request_url) "[HTTP::host][HTTP::uri]"
set debug(id) [after $static::timeout {
log local0.warn "$static::timeout msec timeout reached for \"$debug(request_url)\""
}]
}
when HTTP_RESPONSE {
after cancel $debug(id)
unset -nocomplain debug
}
when CLIENT_CLOSED {
if { [info exist debug(request_url)] } then {
log local0.warn "Connection closed without HTTP response for \"$debug(request_url)\""
}
}
Cheers, Kai
JRahm
Admin
3 years agoFYI Kai_Wilke, you can access the TCP flags in the FLOW_INIT event with the DATAGRAM::tcp flags command.