Re: Outbound HTTP throttling (Kelly Vista)

Owen Garrett <[email protected]>
Newsgroups gmane.comp.programming.load-balancing.general
Message-ID <502AF0BB0010CA4A93EEF0D028B4340625010B9D46@THHS2E12BE1X.hostedservice2.net>
Hi Kelly,

Another solution would be Zeus' software ZXTM traffic manager.  We've got a selection of solutions on KnowledgeHub that will illustrate how to achieve what you need.

ZXTM has a scripting language called TrafficScript, and that is what you would need to use to create your rate shaping policy.

The rate shaping can be achieved using the TrafficScript function 'rate.use()' which queues requests according to policies you set, such as "5 requests per second".  You can queue all requests at an aggregate of 5 per second, or you can queue requests individually (by host header for example, so each web service is allowed 5 requests per second).  Take a look at the following examples:

Rate-limit requests to a web form: http://knowledgehub.zeus.com/articles/2007/02/06/the_contact_us_attack_against_mail_serve

Rate limit individual clients (e.g. web spiders):
http://knowledgehub.zeus.com/articles/2006/12/11/zxtm_spider_catcher

Dynamically rate shaping traffic when services run slowly (probably overkill for your example):
http://knowledgehub.zeus.com/articles/2009/03/26/dynamic_rate_shaping_of_slow_application


If I understand correctly, you want to rate-shape outgoing traffic to external web services.  Load balancers commonly operate in 'reverse proxy' mode, where they send traffic to a small number of pre-configured servers.  If you have a small number of web service targets, then it will be straightforward to configure ZXTM (and most other load balancers) to send traffic to the correct target.

However, if you don't know in advance where the web services request should go to, you're operating in 'forward proxy mode'.  This happens if, for example, you don't know the IPs of the services in advance so you can't configure your load balancer to send traffic to them.  In this case, ZXTM's 'forward proxy' function will fit well; you can extract the host header (for example) from the request, resolve it to an IP and send the request there:

  # TrafficScript:  
  $ip = net.dns.resolveHost( $host );
  pool.use( "Forward Proxy Pool", $ip, $port );

KnowledgeHub again has a good explanation: http://knowledgehub.zeus.com/code/2007/10/17/using_zxtm_as_a_forward_proxy


Zeus' support team will help you piece together a TrafficScript rule to achieve what you need, or drop me a line directly and I'll put together a complete KnowledgeHub article.  If you want to try it out yourself, you can download a 30-day evaluation copy of ZXTM, or download a development copy you can keep for as long as you need.  Install it on any Linux/Solaris/FreeBSD server (physical or virtual), or download the ZXTM Virtual Appliance for VMware.

Regards

Owen
[email protected]
_______________________________________________
lb-l mailing list
[email protected]
http://vegan.net/mailman/listinfo/lb-l
Searchable Archive: http://vegan.net/lb/archive
http://lbdigest.com Load Balancing Digest
http://lbwiki.com Load Balancing Wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.