Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Low-CPU way to insert CorrelationID

rogerwow
Nimbostratus
Nimbostratus

We would like to implement a correlationID HTTP header for every HTTP message that comes through the frontend VLAN.

 

i.e. it's going to need to inspect every single HTTP and

 

  • if there is a CorrelationID then ignore
  • if there is not a CorrelationID
  • generate one
  • add it to the header

Obviously the easy way is to just slap an irule on each VIP, but i'm concerned about the CPU cost here. I've seen on the F5 forums ways to measure the time cost... do you know how to extrapolate this to millions of hits? is it likely to be linear?

 

Is there functionality for this stuff lower level in the LB processing stack? Asic maybe?

 

1 REPLY 1

Hello rogerwow

Depending on your application, you could use cookie persistence to generate a random number for each query, which is less cost intensive.

REF - https://support.f5.com/csp/article/K83419154

Other option is to implement an iRule. Below is one idea.

when HTTP_REQUEST {
    if { !([HTTP::header exists "X-Correlation-ID"])} { HTTP::header insert "X-Correlation-ID" [string range [AES::key 256] 8 end] }
}

Other interesting topics to generate unique identifiers.

REF - https://devcentral.f5.com/questions/how-to-generate-visitor-id-uuid

REF - https://devcentral.f5.com/questions/How-random-is-rand-790690

To evaluate the cpu cost you should try it first in pre-production.

 show ltm rule IRULE_NAME

KR, Dario.

Regards,
Dario.