Forum Discussion
mario_112401
Nimbostratus
May 30, 2008HTTP response timeout
Hello, when an HTTP_REQ arrives, LTM should send the request to one server in the pool and wait for 1 sec for the server's answer: if TO expires, LTM should send a specific answer to the client and drop the server's real answer arrived after the TO. Can anyone help me writing an iRule ? Thanks in advance. Mario
- hoolio
Cirrostratus
I don't think it's really possible to do exactly what you've described with an iRule. I can't think of a way to start a counter and then check to see if it's passed the timeout x number of seconds later. The check would have to be done in an event. - mario_112401
Nimbostratus
Hi Colin, thanks for your answer. About your curiosity, this is a requirement for a project (I don't know the reason ... :-). About your suggestion, can you send me an example ? Thanks in advance. Mario - mario_112401
Nimbostratus
Sorry, my reply is addressed to Aaron (Hoolio) ... BR Mario - hoolio
Cirrostratus
Mario,when HTTP_REQUEST { Save the start time when HTTP request headers were parsed set start_time [clock clicks -milliseconds] } when HTTP_RESPONSE { Check if the response headers from the server were parsed in more than 1000ms if {[expr {[clock clicks -milliseconds] - $start}] > 1000}{ Respond back to client HTTP::respond 200 content "Response time was too long" } }
- mario_112401
Nimbostratus
Hi Aaron, thank you very much for your help. Kind regards, Mario - eantolo_25676
Nimbostratus
Hi, - hoolio
Cirrostratus
The timing command allows you to monitor how many CPU cycles are used when processing a command or event. It's strictly for reporting purposes. You can get more detail on the command from the timing wiki page (Click here). - mario_112401
Nimbostratus
Hello Aaron (Hoolio), I have tested your example and it works. However, it doesn't cover exactly what requested: in fact the HTTP response for timeout too long should be sent by BIGIP if a timer of 1 sec expires and the real server doesn't send the answer. In your example the irule is instead triggered when the BIGIP receives the answer by the server. I think we should use a timeout event but I can't find anything like this. Do you have any idea ? Thank you very much for your help. Mario - hoolio
Cirrostratus
Hi Mario,
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