Forum Discussion

peter_booth_716's avatar
peter_booth_716
Icon for Nimbostratus rankNimbostratus
Aug 10, 2012

LTM create unique request IDs?

I have an LTM that balances a pool of webserver IP+ports. Each webserver forwards requests to a pool of app servers. Currently there's no way to correlate requests between web and app tiers. I was wondering if the LTM could add a custom header that identifies each request. I could then log this header at web and app tiers and so identify which app server handled a specific webservers request. Can this be done cheaply by the LTM?

 

 

Much thanks,

 

 

 

 

 

Peter

 

 

 

3 Replies

  • bigip can insert header into request to web server.

     

     

    HTTP::header wiki

     

    https://devcentral.f5.com/wiki/irules.HTTP__header.ashx

     

     

    but wondering if web server will send that header when connecting to application server.
  • Nate_7016's avatar
    Nate_7016
    Historic F5 Account
    Depending on the info you need you might be able to do it with cookie persistence since each cookie will be specific to the connection. Otherwise, as nitass suggested, an irule would be a great option.
  • We discussed having LTM generate a unique request ID here using rand or AES::key:

     

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aff/5/afv/topic/aft/2163201/afc/2263687/Default.aspx

     

     

    Here are two options. The rand option should be more efficient but not cryptographically secure. You can compare the CPU usage using the timing command.

     

     

    Use rand() to generate a psuedo-random 8 digit number (not cryptographically secure)

     

    format %010s expr [{ int(100000000 * rand()) }]

     

     

    Use AES::key to generate a cryptographically secure unique ID

     

    set uid [string range [AES::key 256] 8 end]

     

     

    Use timing to do a performance comparison:

     

    https://devcentral.f5.com/wiki/iRules.timing.ashx

     

     

    Aaron