Forum Discussion

JHally_43299's avatar
JHally_43299
Icon for Nimbostratus rankNimbostratus
Dec 21, 2011

Injecting latency into application requests?

Hello All,

 

 

is it possible to inject latency into client requests for an application to degrade the user experience?

 

 

 

the goal is to degrade performance of an application by a set amount no matter what the usage is to help expedite migration from one application to another.

 

 

 

Initially I thought of limiting the bandwidth, but when traffic is below the threshold, the application will perform normally. I want the performance to be degraded no matter what the traffic amount is.

 

 

 

Is this possible with an iRule?

 

 

 

thanks in advance,

 

 

 

John.

 

  • If I put myself into a loop or run an open collect, that TMM is now busy until the command returns, and will be unable to process any other traffic until that time. thanks Colin. anyway, i do not think collect such as HTTP::collect is a blocking command since i am able to get response from another connection while the first connetion is stalled. please let me know if i misunderstood anything here.

    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
            if {[HTTP::uri] equals "/test"} {
                    HTTP::collect
            }
    }
    }
    
    [root@ve1023:Active] config  curl -i http://172.28.19.79/test <<< 1st connection
    
    [root@ve1023:Active] config  curl -i http://172.28.19.79 <<< 2nd connection on another ssh session
    HTTP/1.1 200 OK
    Date: Wed, 28 Dec 2011 20:47:29 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
    ETag: "4183e4-3e-9c564780"
    Accept-Ranges: bytes
    Content-Length: 62
    Content-Type: text/html; charset=UTF-8
    
    
    
    
    This is 101 host.
    
    
    
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    You can get another request, certainly, but not another request from the same TMM. As long as the TMM is in a collect state, it isn't going to be available to any other traffic.

     

     

    Colin
  • thanks again Colin. so, if there is only 1 tmm, only one request can be served at a time, can't it?

    my unit has only 1 tmm. is there anything i missed??

    [root@ve1023:Active] config  b tmm
    TMM 0.0     process 26866 on CPU 0   TMM id 0   Total TMMs = 1
    |     client (cur, max, limit, tot) = (2, 25, 0, 343331)
    |     client (pkts,bits) in = (1.398M, 636.9M), out = (762781, 440.5M)
    |     server (cur, max, limit, tot) = (2, 25, 0, 343173)
    |     server (pkts,bits) in = (1.398M, 637.1M), out = (762747, 440.4M)
    |     TMM cycles (total, idle, sleep) = (1.759P, 77.59T, 1.675P)
    |     denials (maint, addr full, serv full) = (0, 0, 0)
    |             (no serv, no listen, no mem, no lic) = (0, 243981, 0, 0)
    |     memory (total, used) = (282.0M, 35.65M)
    |     packets (drop, err in, err out) = (0, 0, 0)
    |     HTTP requests = 166
    |     Conn re-directed = 0
    
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    HTTP::collect has an inherent release built in. Try using TCP::collect without a TCP::release, and specify a meg or so of data.

     

     

    Colin
  • HTTP::collect with no byte size will stall the connection until HTTP::release is called:

     

     

     

    http://devcentral.f5.com/wiki/iRules.http__collect.ashx

     

     

    Also, if you use HTTP::collect without specifying a length, you must have some non-HTTP event (e.g. AUTH_SUCCESS or NAME_RESOLVED) run HTTP::release, or HTTP processing will not continue, and the collected data will be discarded when the connection times out.

     

     

     

    Aaron