Forum Discussion
ingard
Jan 25, 2016Nimbostratus
irule 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
Feb 02, 2016MVP
Hi Ingard,
I've added additional error handles to avoid any can't read "debug(xyz)": no such variable errors. In addition I've moved the [after] code to the HTTP_REQUEST_SEND event to not depend on the LB_SELECTED getting triggered.
when RULE_INIT {
set static::timeout 10000 ; msec
}
when HTTP_REQUEST {
set debug(request_url) "[HTTP::host][HTTP::uri]"
}
when HTTP_REQUEST_SEND {
set debug(server_addr) "[LB::server addr]"
set debug(id) [after $static::timeout {
if { [info exist debug(server_addr)] and [info exist debug(request_url)] } then {
log local0.warn "$static::timeout msec timeout reached on Node \"$debug(server_addr)\" for \"$debug(request_url)\""
} elseif { [info exist debug(request_url)] } then {
log local0.warn "$static::timeout msec timeout reached on Node \"UNKNOWN\" for \"$debug(request_url)\""
}
}]
}
when HTTP_RESPONSE {
if { [info exist debug(id)] } then {
after cancel $debug(id)
}
unset -nocomplain debug
}
when CLIENT_CLOSED {
if { [info exist debug(server_addr)] and [info exist debug(request_url)] } then {
log local0.warn "Connection closed without HTTP response on Node \"$debug(server_addr)\" for \"$debug(request_url)\""
} elseif { [info exist debug(request_url)] } then {
log local0.warn "Connection closed without HTTP response on Node \"UNKNOWN\" for \"$debug(request_url)\""
}
}
Cheers, Kai
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects