openresty / openresty/set-misc-nginx-module

random initiate value for set_rotate

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.