irule processing and performance of 2 irules both doing http_request
I have a VIP that receives a peak of 2,500 current client
connections. It has a current irule that "when http_request" doing basic pool decisions. I need to
apply another irule that does high speed logging. I
have both irules working fine.
for
high speed loggingirule
1. performs a "when client_accept" and also "when http_request".
2. sets some variables like client
IP, http query, http path, etc.
3. sends high speed log
current
vip
irule
1. performs a "when http_request" with "if" pool decision based
on URI match.
Question:
1. How will the box behave once I apply the new irule to the top of the list? Both irules
are doing the http_request and I want to avoid having
the packets inspected twice in separate irules.
2. Will I benefit from extracting the parts in the high
speed logging irule and pasted into the appropriate
section of the current prod irule?
high speed logging - irule that needs to be added
high speed logging - will grab
certain fields to be used for forensics data
when CLIENT_ACCEPTED {
set
hsl [HSL::open -proto UDP -pool pool_syslog_514]
set
clientip [IP::remote_addr]
}
when HTTP_REQUEST {
set
method [HTTP::method]
set
path [HTTP::path]
set
host [HTTP::host]
set
query [HTTP::query]
set uri [HTTP::uri]
}
when HTTP_RESPONSE {
set now [clock
format [clock seconds] -format "%d/%b/%Y:%H:%M:%S
%z"]
set contentlength [HTTP::header "Content-Length"]
log
local0. "<;190> src_ip=$clientipdest_vip=$host http_method=$method http_path=$path
$query http_version=HTTP/[HTTP::version] return_code=[HTTP::status]"
HSL::send $hsl "<;190> src_ip=$clientipdest_vip=$host http_method=$method
http_path=$path $query http_version=HTTP/[HTTP::version]
return_code=[HTTP::status]"
}
--currentirule
already applied making pool decisions--
when HTTP_REQUEST {
if
{ [HTTP::path] starts_with "/123/help" } {
pool serverpool01_8080
persist none }
{ [HTTP::path] elseif
starts_with
"/123/petsemail" } {
pool serverpool02_8080
persist none }
{ [HTTP::path] elseif
starts_with
"/123/profileeditor" } {
pool serverpool03_8080
persist none }
{ [HTTP::path] elseif
starts_with
"/123/activitystream" } {
pool serverpool04_8080
persist none }
{ [HTTP::path] elseif
starts_with
"/123/core" } {
pool serverpool05_8080
persist none }
{ [HTTP::path] elseif
starts_with
"/123/" } {
pool serverpool06_8080
persist none }
{ not ([HTTP::path] elseif
starts_with
"/admin/") } {
pool serverpool07_8080 }
{ ([IP::elseif
client_addr]
== "10.1.1.1" or [IP::client_addr] ==
"10.50.1.1" or [IP::client_addr] ==
"10.100.1.1" ) and [HTTP::path] starts_with
"/admin/"} {
pool pool_qlaxorin_8080 }
else
{ HTTP::respond 404 content { 404 Not Found 404 Not
Found }
}
}