1

What is an open source load balancer that allows for hash based balancing? I would like to do hash based load balancing of a URL but first remove the user specific arguments from the URL. Basically want to increase Varnish's cache performance by adding URL to node persistence.

Example: example.com/foo/usertoken/bar

Where the hash would be based on: example.com/foo/bar.

  • Edited for clarity, bias, and URL modification. *
CarpeNoctem
  • 2,437
  • 4
  • 23
  • 32
  • 2
    Can you re-write this so that it is less subjective? Questions asking for the 'best nnn' tend to get crappy answers. Instead please be more specific about your situation and ask for solutions and request that they support their suggestion with factual detail. – Zoredache Sep 29 '11 at 01:44
  • Edited, my apologies. – CarpeNoctem Oct 10 '11 at 23:13

3 Answers3

3

"Best" is in the eye of the beholder, so this answer is only an approximation.

HAProxy is great if:

  • You need the highest possible per-machine load balancer performance.
  • You don't need SSL termination on the load balancer.
  • You value reliability and version stability highly.

nginx is great if:

  • You want more pre- and post-processing of the HTTP stream on the load balancer, such as GZip compression or SSL termination.
  • You value connection buffering, where the load balancer will buffer content between the clients and the backend servers (useful for some 'scripting language' backends which have a high connection overhead).
  • Would either of these allow a hash to be created based on a certain portion of the URL? For example: foo.com/bar/usertoken/something with the hash based on the url with the "usertoken" arg removed. – CarpeNoctem Oct 10 '11 at 23:10
0

HAProxy and nginx are both able to load balance according to a hash of the requested URL.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
  • What nginx directive achieves URL-hash based load balancing? I cannot find one, except the third-party module ngx_http_upstream_consistent_hash, which is unmaintained and seems to work only with memcache backends not HTTP – rmalayter Mar 19 '12 at 17:08
0

Varnish is a capable load balancer. It does HTTP/1.1 against the client and the backend, has health probles, can do target URL hashing. You just turn off the caching if you plan on doing caching in a separate tier.

perbu
  • 441
  • 3
  • 4