Bug 49822 - Add hash lb worker method
Summary: Add hash lb worker method
Status: NEW
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: 1.2.30
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Keywords: PatchAvailable
Depends on:
Reported: 2010-08-25 12:28 UTC by Ryan Fox
Modified: 2017-09-01 14:42 UTC (History)
0 users

Patch to add hash lb worker method (3.13 KB, application/octet-stream)
2010-08-25 12:28 UTC, Ryan Fox
Patch to add hash lb worker method (3.95 KB, patch)
2010-08-25 17:23 UTC, Ryan Fox
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Fox 2010-08-25 12:28:50 UTC
Created attachment 25938 [details]
Patch to add hash lb worker method

The attached patch adds a hash method to the LB worker.  This is useful for scenarios where back-end cache affinity is more desirable than other load balancing methods.

This works by taking a hash of the req_uri + query_string, seeding the random number generator with this value, and using the first random number returned mod num_of_workers.  This will consistently send a given uri/query string to a particular worker.  If that worker is unavailable, fall back to default method.
Comment 1 Ryan Fox 2010-08-25 17:23:39 UTC
Created attachment 25941 [details]
Patch to add hash lb worker method

Previous patch was incomplete
Comment 2 Christopher Schultz 2017-09-01 14:42:26 UTC
Note the age of the patch.