Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #106 from vania-pooh/master
Browse files Browse the repository at this point in the history
Added docs limiting container resources
  • Loading branch information
vania-pooh authored Jun 3, 2017
2 parents 7901f15 + 6f76139 commit e4ec764
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/cli-flags.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The following flags are supported by ```selenoid``` command:
```
-conf string
Browsers configuration file (default "config/browsers.json")
-cpu value
Containers cpu limit as float e.g. 0.2 or 1.0
-disable-docker
Disable docker support
-limit int
Expand All @@ -12,10 +14,12 @@ The following flags are supported by ```selenoid``` command:
Network address to accept connections (default ":4444")
-log-conf string
Container logging configuration file (default "config/container-logs.json")
-mem value
Containers memory limit e.g. 128m or 1g
-session-attempt-timeout duration
New session attempt timeout in time.Duration format (default 30s)
-session-delete-timeout duration
Session delete timeout in time.Duration format (default 30s)
Session delete timeout in time.Duration format (default 30s)
-timeout duration
Session idle timeout in time.Duration format (default 1m0s)
-version
Expand Down
8 changes: 8 additions & 0 deletions docs/docker-settings.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
# docker info | grep Storage
```
* Total number of simultaneously running containers (adjusted via ```-limit``` flag) depends on your host machine hardware. Our experience shows that depending on your tests the recommended limit is something like: ```1.5-2.0 x numCores```, where ```numCores``` is total number of cores on your host machine.
* You may also want to limit memory and CPU consumption for each started container. To do this use ```-mem``` and ```-cpu``` flags. For example to limit memory type:
# ./selenoid -mem 128m
+
Here values are specified in https://docs.docker.com/engine/admin/resource_constraints/[Docker format]. Similarly to limit CPU comsumption specify total number of CPUs per container as a float:

# ./selenoid -cpu 1.5

* We use the same client as `docker` command does. This is why all environment variables like `DOCKER_API_VERSION` or `DOCKER_CERT_PATH` are applicable. See full list of supported variables in https://docs.docker.com/engine/reference/commandline/cli/#environment-variables[Docker documentation]. For example you may encounter the following error when running Selenoid:

[SERVICE_STARTUP_FAILED] [unknown] [create container: Error response from daemon: client is newer than server (client API version: 1.30, server API version: 1.24)]
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func init() {
flag.DurationVar(&newSessionAttemptTimeout, "session-attempt-timeout", 30*time.Second, "New session attempt timeout in time.Duration format")
flag.DurationVar(&sessionDeleteTimeout, "session-delete-timeout", 30*time.Second, "Session delete timeout in time.Duration format")
flag.BoolVar(&version, "version", false, "Show version and exit")
flag.Var(&mem, "mem", "Containers memory limit")
flag.Var(&cpu, "cpu", "Containers cpu limit")
flag.Var(&mem, "mem", "Containers memory limit e.g. 128m or 1g")
flag.Var(&cpu, "cpu", "Containers cpu limit as float e.g. 0.2 or 1.0")
flag.Parse()

if version {
Expand Down

0 comments on commit e4ec764

Please sign in to comment.