Configure 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

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.

Rick Donato

Want to become an F5 Loadbalancers expert?

Here is our hand-picked selection of the best courses you can find online:
F5 BIG-IP 101 Certification Exam – Complete Course
F5 BIG-IP 201 Certification Exam – Complete Course
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial