From c76b9a67c6d1971b54d9227f1aca95b1b49d4d90 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sat, 18 Oct 2025 23:58:04 +0700 Subject: [PATCH] Docker: Roll back default value of `SE_DISTRIBUTOR_SLOT_SELECTOR` as empty Signed-off-by: Viet Nguyen Duc --- Base/Dockerfile | 2 +- ENV_VARIABLES.md | 2 +- README.md | 14 ++++++++++---- scripts/generate_list_env_vars/description.yaml | 4 ++-- scripts/generate_list_env_vars/value.yaml | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Base/Dockerfile b/Base/Dockerfile index 327aa1484..b9e7ff662 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -206,7 +206,7 @@ ENV SE_BIND_HOST="false" \ SE_SERVER_PROTOCOL="http" \ # Boolean value, maps "--reject-unsupported-caps" SE_REJECT_UNSUPPORTED_CAPS="false" \ - SE_DISTRIBUTOR_SLOT_SELECTOR="org.openqa.selenium.grid.distributor.selector.GreedySlotSelector" \ + SE_DISTRIBUTOR_SLOT_SELECTOR="" \ SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED="true" \ SE_OTEL_TRACES_EXPORTER="otlp" \ SE_SUPERVISORD_LOG_LEVEL="info" \ diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md index 46ef42814..1bf3ed722 100644 --- a/ENV_VARIABLES.md +++ b/ENV_VARIABLES.md @@ -154,4 +154,4 @@ | SE_VIDEO_MAXRATE | | | | | SE_NODE_DELETE_SESSION_ON_UI | true | Enable capability to support deleting session on Grid UI | --delete-session-on-ui | | SE_UPDATE_CHROME_COMPONENTS | | Applicable for node-chrome, standalone-chrome (arch linux/amd64). Update the latest version of Chrome and ChromeDriver at the beginning of the container startup. Read more: [#2872](https://github.com/SeleniumHQ/docker-selenium/pull/2872) | | -| SE_DISTRIBUTOR_SLOT_SELECTOR | org.openqa.selenium.grid.distributor.selector.GreedySlotSelector | Full class name of non-default slot selector. This is used to select a slot in a Node once the Node has been matched. Switch to default, use class name `org.openqa.selenium.grid.distributor.selector.DefaultSlotSelector` | --slot-selector | +| SE_DISTRIBUTOR_SLOT_SELECTOR | | Full class name of non-default slot selector. This is used to select a slot in a Node once the Node has been matched. Switch to built-in Greedy strategy, use class name `org.openqa.selenium.grid.distributor.selector.GreedySlotSelector` | --slot-selector | diff --git a/README.md b/README.md index 8d2358314..cbc5ab6f0 100644 --- a/README.md +++ b/README.md @@ -630,10 +630,16 @@ instructions on top of it. #### Distributor configuration -| Environment variable | Option | Type | Default value | Description | -|------------------------------|-----------------------------|---------|---------------|--------------------------------------------------------------------------------------------------------------| -| `SE_REJECT_UNSUPPORTED_CAPS` | `--reject-unsupported-caps` | boolean | `false` | Allow the Distributor to reject a request immediately if the Grid does not support the requested capability. | -| `SE_HEALTHCHECK_INTERVAL` | `--healthcheck-interval` | int | `120` | This ensures the server can ping all the Nodes successfully after an interval. | +| Environment variable | Option | Type | Default value | Description | +|--------------------------------|-----------------------------|---------|---------------|-----------------------------------------------------------------------------------------------------------------------| +| `SE_REJECT_UNSUPPORTED_CAPS` | `--reject-unsupported-caps` | boolean | `false` | Allow the Distributor to reject a request immediately if the Grid does not support the requested capability. | +| `SE_HEALTHCHECK_INTERVAL` | `--healthcheck-interval` | int | `120` | This ensures the server can ping all the Nodes successfully after an interval. | +| `SE_DISTRIBUTOR_SLOT_SELECTOR` | `--slot-selector` | string | `` | Full class name of non-default slot selector. This is used to select a slot in a Node once the Node has been matched. | + +Distributor component comes with two main built-in Slot Selector implementations +* `org.openqa.selenium.grid.distributor.selector.DefaultSlotSelector`: Grid’s default strategy (used if you don’t configure anything else). It follows the balanced, least-recently-used approach described above. The `DefaultSlotSelector` will choose the Node that has been free for the longest time, ensuring no single node is overused when others are idle. This simple strategy has minimal overhead and works well for most general testing scenarios where an even distribution of sessions is desired. + +* `org.openqa.selenium.grid.distributor.selector.GreedySlotSelector`: An alternative built-in provided. The `GreedySlotSelector` aims to maximize node utilization by concentrating sessions on one node before using another. As noted, it will tend to fill up a node’s slots one by one, reducing the number of nodes that are partially utilized at any given time. This strategy is beneficial for resource-intensive or high-concurrency scenarios (for example, load testing or running in an environment where you scale nodes on demand). More insight, let's refer to [#2990](https://github.com/SeleniumHQ/docker-selenium/issues/2990). ___ diff --git a/scripts/generate_list_env_vars/description.yaml b/scripts/generate_list_env_vars/description.yaml index 14c474125..f705f5824 100644 --- a/scripts/generate_list_env_vars/description.yaml +++ b/scripts/generate_list_env_vars/description.yaml @@ -491,6 +491,6 @@ cli: '' - name: SE_DISTRIBUTOR_SLOT_SELECTOR description: Full class name of non-default slot selector. This is used to select - a slot in a Node once the Node has been matched. Switch to default, use class - name `org.openqa.selenium.grid.distributor.selector.DefaultSlotSelector` + a slot in a Node once the Node has been matched. Switch to built-in Greedy strategy, + use class name `org.openqa.selenium.grid.distributor.selector.GreedySlotSelector` cli: --slot-selector diff --git a/scripts/generate_list_env_vars/value.yaml b/scripts/generate_list_env_vars/value.yaml index 12b8f16c9..6f87ab0b5 100644 --- a/scripts/generate_list_env_vars/value.yaml +++ b/scripts/generate_list_env_vars/value.yaml @@ -19,7 +19,7 @@ - name: SE_DISTRIBUTOR_PORT default: '5553' - name: SE_DISTRIBUTOR_SLOT_SELECTOR - default: org.openqa.selenium.grid.distributor.selector.GreedySlotSelector + default: '' - name: SE_DRAIN_AFTER_SESSION_COUNT default: '0' - name: SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP