Skip to content

Commit 0496646

Browse files
authored
Adding support for SE_NODE_OVERRIDE_MAX_SESSIONS (#1255) [deploy][prerelease]
1 parent 0ba9433 commit 0496646

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

Base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ COPY supervisord.conf /etc
7171
RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
7272
&& touch /opt/selenium/config.toml \
7373
&& chmod -R 777 /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor /etc/passwd \
74-
&& wget --no-verbose https://github.com/SeleniumHQ/docker-selenium/raw/beta-jars/selenium-server-4.0.0-prerelease-beta-3-d798b52c4c.jar \
74+
&& wget --no-verbose https://github.com/SeleniumHQ/docker-selenium/raw/beta-jars/selenium-server-4.0.0-prerelease-beta-3-fcfbc6ba25.jar \
7575
-O /opt/selenium/selenium-server.jar \
7676
# && wget --no-verbose https://selenium-release.storage.googleapis.com/4.0-beta-1/selenium-server-4.0.0-beta-1.jar \
7777
# -O /opt/selenium/selenium-server.jar \

NodeBase/Dockerfile.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ ENV START_XVFB true
163163
ENV SE_NODE_MAX_SESSIONS 1
164164
# As integer, maps to "session-timeout" in seconds
165165
ENV SE_NODE_SESSION_TIMEOUT 300
166+
# As boolean, maps to "override-max-sessions"
167+
ENV SE_NODE_OVERRIDE_MAX_SESSIONS false
166168

167169
# Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87
168170
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null

NodeBase/generate_config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ else
3131
echo "grid-url = \"${SE_NODE_GRID_URL}\"" >> /opt/selenium/config.toml
3232
fi
3333
echo "session-timeout = \"${SE_NODE_SESSION_TIMEOUT}\"" >> /opt/selenium/config.toml
34+
echo "override-max-sessions = ${SE_NODE_OVERRIDE_MAX_SESSIONS}" >> /opt/selenium/config.toml
3435
echo "max-sessions = ${SE_NODE_MAX_SESSIONS}
3536
" >> /opt/selenium/config.toml
3637

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,20 @@ can do that through the `SE_NODE_GRID_URL` environment variable.
417417
Grid has a default session timeout of 300 seconds, where the session can be on a stale state until it is killed. You can use
418418
`SE_NODE_SESSION_TIMEOUT` to overwrite that value in seconds.
419419

420+
### Increasing session concurrency per container
421+
422+
By default, only one session is configured to run per container through the `SE_NODE_MAX_SESSIONS` environment variable. It is
423+
possible to increase that number up to the maximum available processors, this is because more stability is achieved when one
424+
container/browser has 1 CPU to run.
425+
426+
However, if you have measured performance and based on that, you think more sessions can be executed in each container, you can
427+
override the maximum limit by setting both `SE_NODE_MAX_SESSIONS` to a desired number and `SE_NODE_OVERRIDE_MAX_SESSIONS` to
428+
`true`. Nevertheless, running more browser sessions than the available processors is not recommended since you will be overloading
429+
the resources.
430+
431+
Overriding this setting has a undesired side effect when video recording is enabled, since more than one browser session might be
432+
captured in the same video.
433+
420434
### Running in Headless mode
421435

422436
[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode),

Standalone/start-selenium-standalone.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ fi
99
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server.jar standalone \
1010
--relax-checks ${SE_RELAX_CHECKS} \
1111
--session-timeout ${SE_NODE_SESSION_TIMEOUT} \
12+
--max-sessions ${SE_NODE_MAX_SESSIONS} \
13+
--override-max-sessions ${SE_NODE_OVERRIDE_MAX_SESSIONS} \
1214
${SE_OPTS}

0 commit comments

Comments
 (0)