Deployment FAQ
Deployment FAQ
Section titled “Deployment FAQ”Service fails to start: etcd connection refused
Section titled “Service fails to start: etcd connection refused”Check that etcd is running and reachable from the service container:
# Test connectivitync -zv etcd-host 2379
# Check etcd healthetcdctl --endpoints=http://etcd-host:2379 endpoint healthIn Kubernetes, use the etcd service DNS name, not localhost.
bind: address already in use
Section titled “bind: address already in use”Another process is listening on the same port. Find and stop it:
lsof -i :8888kill -9 <PID>In Kubernetes, ensure no two pods use the same hostPort.
High memory usage after load spike
Section titled “High memory usage after load spike”Check for goroutine leaks:
curl http://localhost:6060/debug/pprof/goroutine?debug=1Enable pprof in your config:
Log: Mode: console# Add pprof route in main.go:import _ "net/http/pprof"go http.ListenAndServe(":6060", nil)Requests time out under load
Section titled “Requests time out under load”- Check
MaxConns— increase if connection pool is exhausted. - Check
Timeout— too low for your workload. - Check downstream RPC timeouts.
- Check CPU-based load shedding threshold (
CpuThreshold).
MaxConns: 50000Timeout: 5000CpuThreshold: 950How to do zero-downtime deployments?
Section titled “How to do zero-downtime deployments?”Use Kubernetes rolling deployments with proper readiness probes:
strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0readinessProbe: httpGet: {path: /healthz, port: 8888} initialDelaySeconds: 5 periodSeconds: 5