Forum Discussion

Vivek_Datta_263's avatar
Vivek_Datta_263
Icon for Nimbostratus rankNimbostratus
Nov 27, 2017

iRule not getting executed for a URI apparently due to it's 6000+ char length

Hi all,

 

We have an iRule which directs a request to certain Pools depending on a regex match. However, we are observing that one particular URI doesn't follow this iRule and goes to random Pools. I have tried following things: * I have checked that the regex is working fine i.e. it extracts the correct value from the URI to be passed to SWITCH statement which selects the Pools. * Though when we enable the logs in the iRule for troubleshooting, we are not able to find any log traces which suggests that the iRule didn't get processed in the first place.

 

This iRule is the first one to be executed for the associated vServer. The length of this URI is 6000+, does this impact any capability of an iRule?

 

Thanks

 

3 Replies

  • Hi Vivek,

     

    LTM and iRule are fine to handle URI's till the maximum HTTP-request size limit has been reached (default is 32768 bytes for the entire request). But APM's HUD filter and probably other TMOS modules too, are not able to handle such large URIs and may complain when URIs with >4095 chars are getting requested.

     

    Although the Hyper Text Transfer Protocol specs (RFC2616) are not specifying any min/max requirement for the URL length. Some browsers are having a build-in restriction and failing to send request URIs longer than 2000 chars. So better not use those long URIs if you can't control which browser is used to access your application (aka. public website).

     

    For further reading how the internet community handles this topic..

     

    https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers

     

    Cheers, Kai

     

  • Hi Vivek,

    We have confirmed that the regex works fine, it's just that this particular request never hits the Pool selection iRule somehow, hence it keeps landing on random F5 pools

    is it random pool or pool selected by previous request in the same TCP connection.

    if a request doesn't match condition to assign pool, it will keep previous request assigned pool.

    in you irule, can you check if URI length is right with command:

    log local0. [string length [HTTP::uri]]
    

    Do you really require regex to match URI instead of starts_with / contains / ends_with commands? Regex must be used only if necessary.

    Can you filter on [HTTP::path], [HTTP::query] or on a dedicated query parameter [URI::query [HTTP::uri] myparam]?