Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Load balancing using an API


Hello team,


We have a bunch of hosts running behind F5.

Every host is running few services.

One particular service is capable of providing free memory information through the API we developed:

GET http://hostname/myservice/usageAPI   Response: {    "freeMemory": 369959592 }


Is it possible to consume this API in F5, and load balance accordingly?


E.g. If freeMemory is less than threshold, than no request should be sent to that host for the time being.

After sometime, when freeMemory is above the threshold value, then F5 should redirect request to that host.


How to load balance in F5 through such API?


Note that we don't want to mark server/host status Up and Down. We just want to make sure that particular service has enough memory to take up the next memory intensive request.


We know Dynamic Ratio Load Balancing but that considers the overall health of the host.


We want to load balance based on status of one service out of few other services running on the host.



Hi Hitesh,


Yes, you can using monitors to mark pool members up or don based on value returned for "freeMemory" parameter. When pool member is down, no application traffic will be sent to it until is it backup again.


BigIP has a feature called custom monitors. Using it, you can write a scrip to check for "freeMemory" and set pool member status accordingly.




Hope this helps,




We don't want to mark servers Up and Down.

We want to load balance using the parameter.


E.g. Out of all the servers in the pool, redirect the request to the server which has freeMemory more.

Or in another terms, if freeMemory is less than some thresold, then don't redirect request to that server.


After sometime, when the freeMemory is above the thresold, then that server should get new requests.