You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
::: danger NEVER EXPOSE THE RPC API TO THE PUBLIC INTERNET
@@ -70,7 +71,7 @@ You can run Kubo IPFS inside Docker to simplify your deployment processes, as we
70
71
When starting a container running ipfs for the first time with an empty data directory, it will call `ipfs init` to initialize configuration files and generate a new keypair. At this time, you can choose which profile to apply using the `IPFS_PROFILE` environment variable:
See the `gateway` example on the [go-ipfs-docker-examples repository](https://github.com/ipfs-shipyard/go-ipfs-docker-examples)
106
107
:::
107
108
109
+
## Configuring resource limits
110
+
111
+
When deploying IPFS Kubo in containerized environments, it's crucial to align the Go runtime's resource awareness with the container's defined resource constraints via environment variables:
112
+
113
+
- `GOMAXPROCS`: Configures the maximum number of OS threads that can execute Go code concurrently (should not be bigger than the hard container limit set via `docker --cpus`)
114
+
- `GOMEMLIMIT`: Sets the soft [memory allocation limit for the Go runtime](https://tip.golang.org/doc/gc-guide#Memory_limit) (should be slightly below the hard limit setfor container via `docker --memory`)
115
+
116
+
Example:
117
+
118
+
```shell
119
+
docker run # (....)
120
+
--cpus="4.0" -e GOMAXPROCS=4 \
121
+
--memory="8000m" -e GOMEMLIMIT=7500MiB \
122
+
ipfs/kubo:v0.32.1
123
+
```
124
+
108
125
## Private swarms inside Docker
109
126
110
127
It is possible to initialize the container with a swarm key file (`/data/ipfs/swarm.key`) using the variables `IPFS_SWARM_KEY` and `IPFS_SWARM_KEY_FILE`. The `IPFS_SWARM_KEY` creates `swarm.key` with the contents of the variable itself, while`IPFS_SWARM_KEY_FILE` copies the key from a path stored in the variable. The `IPFS_SWARM_KEY_FILE`**overwrites** the key generated by `IPFS_SWARM_KEY`.
0 commit comments