oscarnet_69487
Mar 27, 2017Nimbostratus
how can i use http requests clock to select pool
hi
i have 3 file are "image1.jpg , image2.jpg , image3.jpg",
i have client_start_time and 3 file time clock.
when http request i can get http request time.
so i want use http request time latency to select pool.
i try the irule but it not work.
code
when CLIENT_ACCEPTED {
set IP_req_start_time [clock clicks -milliseconds]
}
when HTTP_REQUEST {
if {[HTTP::uri] ends_with "image1.jpg"} {
set image1_request_time [expr [clock clicks -milliseconds] - $IP_req_start_time]
}
if {[HTTP::uri] ends_with "image2.jpg"} {
set image2_request_time [expr [clock clicks -milliseconds] - $IP_req_start_time]
}
if {[HTTP::uri] ends_with "image3.jpg"} {
set image3_request_time [expr [clock clicks -milliseconds] - $IP_req_start_time]
}
if { image1_request_time > image2_request_time > image1_request_time} { pool pool_Server_A }
if { image1_request_time > image2_request_time < image1_request_time} { pool pool_Server_B }
if { image1_request_time < image2_request_time < image1_request_time} { pool pool_Server_C }
}
anyone can help me to do it. thank's