Stream: least_time balancer module

Example configuration:

upstream u {
    least_time connect | first_byte | last_byte [inflight];
    server a;
    server b;
}

Co-authored-by: Roman Arutyunyan <arut@nginx.com>
This commit is contained in:
Vladimir HomutovandRoman Arutyunyan authored and Sai Krishna Kumar Reddy YADAMAKANTI committed 2026-05-04 21:19:40 +05:30
1 parent 5760d6148e
commit 3b5da468b3
7 files changed
+732 -1

No files matched your search

+12
View File
@@ -1244,6 +1244,18 @@ if [ $STREAM != NO ]; then
. auto/module
fi
if [ $STREAM_UPSTREAM_LEAST_TIME = YES ]; then
have=NGX_STREAM_UPSTREAM_LEAST_TIME . auto/have
ngx_module_name=ngx_stream_upstream_least_time_module
ngx_module_deps=
ngx_module_srcs=src/stream/ngx_stream_upstream_least_time_module.c
ngx_module_libs=
ngx_module_link=$STREAM_UPSTREAM_LEAST_TIME
. auto/module
fi
if [ $STREAM_UPSTREAM_RANDOM = YES ]; then
ngx_module_name=ngx_stream_upstream_random_module
ngx_module_deps=
+5
View File
@@ -133,6 +133,7 @@ STREAM_PASS=YES
STREAM_SET=YES
STREAM_UPSTREAM_HASH=YES
STREAM_UPSTREAM_LEAST_CONN=YES
STREAM_UPSTREAM_LEAST_TIME=YES
STREAM_UPSTREAM_RANDOM=YES
STREAM_UPSTREAM_ZONE=YES
STREAM_SSL_PREREAD=NO
@@ -355,6 +356,8 @@ use the \"--with-mail_ssl_module\" option instead"
STREAM_UPSTREAM_HASH=NO ;;
--without-stream_upstream_least_conn_module)
STREAM_UPSTREAM_LEAST_CONN=NO ;;
--without-stream_upstream_least_time_module)
STREAM_UPSTREAM_LEAST_TIME=NO ;;
--without-stream_upstream_random_module)
STREAM_UPSTREAM_RANDOM=NO ;;
--without-stream_upstream_zone_module)
@@ -579,6 +582,8 @@ cat << END
disable ngx_stream_upstream_hash_module
--without-stream_upstream_least_conn_module
disable ngx_stream_upstream_least_conn_module
--without-stream_upstream_least_time_module
disable ngx_stream_upstream_least_time_module
--without-stream_upstream_random_module
disable ngx_stream_upstream_random_module
--without-stream_upstream_zone_module