Skip to content

Scaling

Scale Ops Atlas for high availability and performance.

Horizontal Scaling

Multiple Replicas

yaml
# docker-compose.yml
services:
  ops-atlas:
    deploy:
      replicas: 3

Kubernetes HPA

yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: ops-atlas
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: ops-atlas
  minReplicas: 2
  maxReplicas: 10
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70

Database Scaling

Read Replicas

yaml
database:
  primary: postgres://primary:5432/opsatlas
  replicas:
    - postgres://replica1:5432/opsatlas
    - postgres://replica2:5432/opsatlas
  read_from_replica: true

Connection Pooling

Use PgBouncer for connection pooling:

yaml
pgbouncer:
  pool_mode: transaction
  max_client_conn: 1000
  default_pool_size: 20

Redis Scaling

Redis Cluster

yaml
redis:
  cluster:
    nodes:
      - redis-1:6379
      - redis-2:6379
      - redis-3:6379

Load Balancing

Nginx

nginx
upstream ops-atlas {
    least_conn;
    server ops-atlas-1:3000;
    server ops-atlas-2:3000;
    server ops-atlas-3:3000;
}

Kubernetes Ingress

yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/load-balance: "round_robin"

Performance Tuning

Resource Limits

yaml
resources:
  requests:
    cpu: 500m
    memory: 512Mi
  limits:
    cpu: 2000m
    memory: 2Gi

JVM Tuning (if applicable)

bash
JAVA_OPTS="-Xms512m -Xmx2g -XX:+UseG1GC"

Released under the MIT License.