Skip to content

Commit

Permalink
update: adjust default value of env var `SE_BROWSER_LEFTOVERS_PROCESS…
Browse files Browse the repository at this point in the history
…ES_SECS`

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Mar 26, 2024
1 parent 3909301 commit c419716
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ jobs:
cluster: 'kind'
helm-version: 'v3.10.3'
test-existing-keda: true
- k8s-version: 'v1.26.14'
- k8s-version: 'v1.26.15'
test-strategy: deployment
cluster: 'kind'
helm-version: 'v3.11.3'
test-existing-keda: true
- k8s-version: 'v1.27.11'
- k8s-version: 'v1.27.12'
test-strategy: job_https
cluster: 'kind'
helm-version: 'v3.12.3'
test-existing-keda: true
- k8s-version: 'v1.28.7'
- k8s-version: 'v1.28.8'
test-strategy: job_hostname
cluster: 'minikube'
helm-version: 'v3.13.3'
test-existing-keda: false
- k8s-version: 'v1.29.2'
- k8s-version: 'v1.29.3'
test-strategy: deployment_https
cluster: 'minikube'
helm-version: 'v3.14.3'
Expand Down
2 changes: 1 addition & 1 deletion NodeBase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ RUN chmod -R 775 ${HOME} /tmp/.X11-unix \
#============================================
ENV SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP false
ENV SE_BROWSER_LEFTOVERS_INTERVAL_SECS 3600
ENV SE_BROWSER_LEFTOVERS_PROCESSES_SECS 1200
ENV SE_BROWSER_LEFTOVERS_PROCESSES_SECS 7200
ENV SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS 1

#===================================================
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Talk to us at https://www.selenium.dev/support/
* [Increasing session concurrency per container](#increasing-session-concurrency-per-container)
* [Running in Headless mode](#running-in-headless-mode)
* [Stopping the Node/Standalone after N sessions have been executed](#stopping-the-nodestandalone-after-n-sessions-have-been-executed)
* [Automatic browser leftovers cleanup](#automatic-browser-leftovers-cleanup)
* [Building the images](#building-the-images)
* [Waiting for the Grid to be ready](#waiting-for-the-grid-to-be-ready)
* [Adding a HEALTHCHECK to the Grid](#adding-a-healthcheck-to-the-grid)
Expand Down Expand Up @@ -956,7 +957,7 @@ environment variables:

* `SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP`: default value `false`, set to `true` to enable the cleanup.
* `SE_BROWSER_LEFTOVERS_INTERVAL_SECS`: default value `3600` (1 hour), cleanup interval in seconds.
* `SE_BROWSER_LEFTOVERS_PROCESSES_SECS`: default value `1200` (2 hours), browsers running for longer than this time will be killed.
* `SE_BROWSER_LEFTOVERS_PROCESSES_SECS`: default value `7200` (2 hours), browsers running for longer than this time will be killed.
* `SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS`: default value `1` (1 day), files generated by Chrome-based browsers in `/tmp` will be removed after these number of days (ignored when using Firefox).

If you use Selenium for long-running sessions and expect browsers to be running for longer than 20 minutes, either do
Expand All @@ -970,11 +971,15 @@ $ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true --shm-size="2g" seleniu
With the previous command, the cleanup will be enabled with the default timings.

``` bash
$ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true -e SE_BROWSER_LEFTOVERS_INTERVAL_SECS=7200 -e SE_BROWSER_LEFTOVERS_PROCESSES_SECS=3600 -e SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=2 --shm-size="2g" selenium/node-chrome:4.18.1-20240224
$ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true \
-e SE_BROWSER_LEFTOVERS_INTERVAL_SECS=7200 \
-e SE_BROWSER_LEFTOVERS_PROCESSES_SECS=3600 \
-e SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=2 \
--shm-size="2g" selenium/node-chrome:4.18.1-20240224
```

With the previous command, the cleanup will be enabled, but will run every 2 hours (instead of 1), will kill browsers
running longer than 1 hour (instead of 20 minutes), and will remove temp files older than 2 days (instead of 1).
running longer than 1 hour (instead of 2 hours), and will remove temp files older than 2 days (instead of 1).

___

Expand Down

0 comments on commit c419716

Please sign in to comment.