Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tweak scheduler score

Now the time since last activity is "positive", i.e. the bigger the time,
the greater chance of selecting this backend.

The point of this change is to keep scheduler scores roughly decreasing in
round-robin order, and to keep the iteration count of the main loop of
ngx_http_upstream_choose_fair_peer as short as possible.
  • Loading branch information...
commit 33c3bc2a42cae89ad36d2bf6b24a6c3af89cdc5a 1 parent 9c25ccd
@gnosek authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  ngx_http_upstream_fair_module.c
View
2  ngx_http_upstream_fair_module.c
@@ -230,7 +230,7 @@ ngx_http_upstream_fair_sched_score(ngx_peer_connection_t *pc,
*/
return -fs->nreq * FS_TIME_SCALE_OFFSET;
} else {
- return (1 - fs->nreq) * (last_active_delta + FS_TIME_SCALE_OFFSET);
+ return (1 - fs->nreq) * FS_TIME_SCALE_OFFSET + last_active_delta;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.