Forum Discussion
hooleylist
Jan 19, 2012Cirrostratus
Currently,we have a few iRule associate with the virtual server and average is about 25% CPU load.
Will this iRule cause additional check for each and every request and increase te CPU load?
I don't think this iRule will add that much load. But to be safe, you could only use it temporarily during a low traffic period to log details on large requests. Once you get some data logged, you can disable the iRule.Any pros or cons you can think off other then the resource loading?
I'm not sure what you mean. Can you rephrase this question?
As for your edit: If you want to only check if the total headers are over 32k, you can use this:
when HTTP_REQUEST {
Check the total HTTP headers size
if {[string length [HTTP::request]] > 32768}{
Check if the URI is very long
if {[string length [HTTP::uri]] > 1000}{
log local0. "Uri is long. Length [string length [HTTP::uri]], URI: [HTTP::uri]"
Exit this event from this iRule
return
}
Loop through the headers by name
foreach header {[HTTP::header names]} {
Check for a long header value
if {[string length [HTTP::header value $header]] > 1000 } {
log local0. "Header is long. Header Name: $header,\
Length: [string length [HTTP::header value $header]], Value: [HTTP::header value $header]"
Exit this event from this iRule
return
}
}
If we are still here the request was large, but not the URI or any single header.
Log the first 1k bytes of the full request
log local0. "Request is long: [HTTP::request]"
}
}
Aaron