soketi
Search…
πŸš€
Installation
The Network Watcher is only used when deploying soketi via Kubernetes.
If you run soketi standalone in a cluster at scale, you may run into capacity issues. For example, RAM usage might be near the limit supported by your server and even if you decide to horizontally scale the servers, new connections might still come to servers that are near their memory limit.
Running the soketi Network Watcher inside the same pod will solve these issues by continuously monitoring the soketi Server Usage API, labeling the pods that get over a specified threshold with ws.soketi.app/accepts-new-connections: "no", so that the services watching for the pods will ignore them.
The Network Watcher source code is available on GitHub (soketi/network-watcher).

Docker Container

The Network Watcher is available as a Docker container. It can either be installed manually by adding a container in your pods that also run soketi, or you can use the soketi/soketi Helm Chart, which includes an already-set Network Watcher container you can easily turn on and off.
When a new Network Watcher release is created on GitHub, a Docker image with the same tag is automatically pushed to the soketi/network-watcher registry where you may view the available tags.

Helm Chart

To deploy using Helm, please consult the documentation the soketi Helm chart GitHub repository.

Kubernetes YAML

The following configuration example demonstrates how you may configure the Network Watcher container in your pods that run soketi.
Service
Deployment
1
apiVersion: v1
2
kind: Service
3
metadata:
4
name: soketi-service
5
spec:
6
selector:
7
app: soketi
8
ws.soketi.app/accepts-new-connections: "yes" # required
9
ports:
10
- protocol: TCP
11
port: 6001
12
targetPort: 6001
13
name: ws
Copied!
1
ap
2
​
3
iVersion: apps/v1
4
kind: Deployment
5
metadata:
6
name: soketi
7
labels:
8
app: soketi
9
spec:
10
replicas: 3
11
selector:
12
matchLabels:
13
app: soketi
14
template:
15
metadata:
16
labels:
17
app: soketi
18
ws.soketi.app/accepts-new-connections: "yes" # optional
19
spec:
20
containers:
21
- name: soketi
22
image: soketi/soketi:0.17-16-alpine
23
ports:
24
- containerPort: 6001
25
- name: network-watcher
26
image: quay.io/soketi/network-watcher:6
27
env:
28
- name: KUBE_CONNECTION
29
value: cluster
30
- name: MEMORY_PERCENT
31
value: "75" # if > 75% memory, reject new connections
32
- name: CHECKING_INTERVAL
33
value: "5" # every 5 seconds
34
- name: POD_NAMESPACE
35
valueFrom:
36
fieldRef:
37
fieldPath: metadata.namespace
38
- name: POD_NAME
39
valueFrom:
40
fieldRef:
41
fieldPath: metadata.name
42
Copied!
Last modified 1mo ago
Copy link
Edit on GitHub