Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR : gh-481 Support for selection of LB end-points based on least-connections #566

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ const (
LbSelPrio
// LbSelRrPersist - persist connectons from same client
LbSelRrPersist
// LbSelLeastConnections - select client based on least connections
LbSelLeastConnections
)

// LBMode - Variable to define LB mode
Expand Down
1 change: 1 addition & 0 deletions loxinet/dpbroker.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ const (
EpHash
EpPrio
EpRRPersist
EpLeastConn
)

// NatEP - a nat end-point
Expand Down
2 changes: 2 additions & 0 deletions loxinet/dpebpf_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,8 @@ func DpNatLbRuleMod(w *NatDpWorkQ) int {
dat.sel_type = C.NAT_LB_SEL_HASH
case w.EpSel == EpRRPersist:
dat.sel_type = C.NAT_LB_SEL_RR_PERSIST
case w.EpSel == EpLeastConn:
dat.sel_type = C.NAT_LB_SEL_LC
/* Currently not implemented in DP */
/*case w.EpSel == EP_PRIO:
dat.sel_type = C.NAT_LB_SEL_PRIO*/
Expand Down
2 changes: 2 additions & 0 deletions loxinet/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -2306,6 +2306,8 @@ func (r *ruleEnt) Nat2DP(work DpWorkT) int {
nWork.EpSel = EpRR
case at.sel == cmn.LbSelRrPersist:
nWork.EpSel = EpRRPersist
case at.sel == cmn.LbSelLeastConnections:
nWork.EpSel = EpLeastConn
default:
nWork.EpSel = EpRR
}
Expand Down
Loading