load balance based on OS

Answered Question
Sep 20th, 2010
User Badges:

Is it possible to load balance incoming requests based on client's operating system on ACE?


For example, we have different web pages specifically for Blackberry or iPhones.

Instead of having multiple URL's & VIP's, we'd like to have a single VIP, but load balance traffic to different serverfarms based on client's OS.

Correct Answer by litrenta about 6 years 8 months ago

You can loadbalance based on User-Agent header, first you need to quantify what Iphone and blackberry use for user-agent for instance from a regular browser you might see:


User-AgentT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)


from an iphone you will typically see:


User-Agent=Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)
AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3


you can go to http://www.user-agents.org to find out what strings are used


That being the case you can make classes on the header to match for loadbalancing decisions:


class-map type http loadbalance match-any mobile

2 match http header User-Agent header-value .*iphone

4 match http header Uswer-Agent header-value .*blackberry


then in LB policy say we want to go to farmA for mobile and farmB for pc's


policy-map type loadbalance first-match L7POLICY

   class mobile

     serverfarm farmA

    class class-default

    serverfarm farmB


see:


http://www.cisco.com/en/US/docs/interfaces_modules/services_modules/ace/v3.00_A2/configuration/slb/guide/classlb.html#wp1021388

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
litrenta Mon, 09/20/2010 - 12:14
User Badges:
  • Cisco Employee,

You can loadbalance based on User-Agent header, first you need to quantify what Iphone and blackberry use for user-agent for instance from a regular browser you might see:


User-AgentT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)


from an iphone you will typically see:


User-Agent=Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)
AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3


you can go to http://www.user-agents.org to find out what strings are used


That being the case you can make classes on the header to match for loadbalancing decisions:


class-map type http loadbalance match-any mobile

2 match http header User-Agent header-value .*iphone

4 match http header Uswer-Agent header-value .*blackberry


then in LB policy say we want to go to farmA for mobile and farmB for pc's


policy-map type loadbalance first-match L7POLICY

   class mobile

     serverfarm farmA

    class class-default

    serverfarm farmB


see:


http://www.cisco.com/en/US/docs/interfaces_modules/services_modules/ace/v3.00_A2/configuration/slb/guide/classlb.html#wp1021388

Actions

This Discussion