fir3net
PPS-Firenetbanner-780.5x190-30-03-17
  • Home
  • Articles
  • Loadbalancers
  • F5 BIG-IP
  • F5 LTM - How do I configure my F5 to equally distribute HTTP requests ?

F5 LTM - How do I configure my F5 to equally distribute HTTP requests ?

Question

How do I configure my F5 to equally distribute HTTP requests so that each request goes to a different server ?

Answer

To ensure that each request goes to a different server rather then all requests for a single connection going to the same server you will need to:

Disable CMP

Clustered Multi-Processing (CMP) is a feature that spawns multiple instances of the Traffic Management Microkernel (TMM) across multiple cores. Though this can improve system performance this can affect the behaviour of how traffic is distributed.

An example how traffic is distributed when CMP is enabled (with round robin) is shown below:

Note : This example is based on a platform with 2 cores.

Connection 1--> TMM0 --> 192.168.1.1:80
Connection 2--> TMM1 --> 192.168.1.1:80
Connection 3--> TMM0 --> 192.168.1.2:80
Connection 4--> TMM1 --> 192.168.1.2:80

Here you can see that the first 2 connections are sent to 192.168.1.1, and then the following 2 sent to 192.168.1.2.
So how is traffic distributed when CMP is disabled ?

Connection 1--> 192.168.1.1:80
Connection 2--> 192.168.1.2:80
Connection 3--> 192.168.1.1:80
Connection 4--> 192.168.1.2:80

To disable CMP the following bigpipe commands are used,

[root@f5ltm:Active] config # bigpipe virtual VS-172.16.100.10-80 cmp disable

[root@f5ltm:Active] config # bigpipe save
/config/bigip.conf was renamed to /config/bigip.conf.bak (482 lines).
/config/bigip_local.conf was renamed to /config/bigip_local.conf.bak (1 lines).
/config/bigip_sys.conf was renamed to /config/bigip_sys.conf.bak (29 lines).

[root@f5ltm:Active] config # bigpipe virtual VS-172.16.100.10-80 cmp show
VIRTUAL VS-172.16.100.10-80 - CMP: disable

Further details on CMP can be found here - http://support.f5.com/kb/en-us/solutions/public/7000/700/sol7751.html.

LB::detach

To ensure that each request is sent to a different server the LB::detach command is used.
This command detaches the server-side connection from the client-side.

Based on this create an iRule (using the syntax below) and assign it to your virtual server.

when HTTP_REQUEST { 
        LB::detach
}

Gotcha

At the point that you make the changes above if you still still do not see the expected behaviour force the nodes offline, wait for 5-10 minutes and then re enable. Otherwise (if using HA without connection mirroring) failover to the other node.

Tags: BIG-IP F5

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001