openresty / openresty/set-misc-nginx-module
random initiate value for set_rotate
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 401
- Forks
- 100
- Avg merge
- 1h 28m
- Merged PRs (30d)
- 2
Description
Hi,
Is it possible to make the set_rotate start from a random number between 1 and $server_key_max instead of starting at 1 for the first request?
I am using this for some kind of load balancing and when I deploy new instances I have the problem alwas hitting the first key at first request.
set_rotate $server_key 1 $server_key_max;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the C implementation and tests for the set_rotate directive shown in the issue. Read how its initial value is selected and how server_key_max is handled. Done means new instances no longer begin every sequence at 1, while the directive continues to produce valid values between 1 and server_key_max.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100