Forum Discussion
oscarnet_69487
Nimbostratus
Mar 27, 2017how 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
1 Reply
- Vijay_E
Cirrus
You seem to be sending everything to a single pool - pool_ServerA. What is the purpose of identifying the time if you are using the same pool ? Also, have you checked out "Fastest (application)" load balancing method ?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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