1---
2name: server-management
3description: Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.
4category: AI & Agents
5source: antigravity
6tags: [node, api, ai, workflow, security, docker, kubernetes]
7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/server-management
8metadata:
9 source: https://skillmd.com/skills/sickn33/server-management
10---
11
12
13# Server Management
14
15> Server management principles for production operations.
16> **Learn to THINK, not memorize commands.**
17
18---
19
20## 1. Process Management Principles
21
22### Tool Selection
23
24| Scenario | Tool |
25|----------|------|
26| **Node.js app** | PM2 (clustering, reload) |
27| **Any app** | systemd (Linux native) |
28| **Containers** | Docker/Podman |
29| **Orchestration** | Kubernetes, Docker Swarm |
30
31### Process Management Goals
32
33| Goal | What It Means |
34|------|---------------|
35| **Restart on crash** | Auto-recovery |
36| **Zero-downtime reload** | No service interruption |
37| **Clustering** | Use all CPU cores |
38| **Persistence** | Survive server reboot |
39
40---
41
42## 2. Monitoring Principles
43
44### What to Monitor
45
46| Category | Key Metrics |
47|----------|-------------|
48| **Availability** | Uptime, health checks |
49| **Performance** | Response time, throughput |
50| **Errors** | Error rate, types |
51| **Resources** | CPU, memory, disk |
52
53### Alert Severity Strategy
54
55| Level | Response |
56|-------|----------|
57| **Critical** | Immediate action |
58| **Warning** | Investigate soon |
59| **Info** | Review daily |
60
61### Monitoring Tool Selection
62
63| Need | Options |
64|------|---------|
65| Simple/Free | PM2 metrics, htop |
66| Full observability | Grafana, Datadog |
67| Error tracking | Sentry |
68| Uptime | UptimeRobot, Pingdom |
69
70---
71
72## 3. Log Management Principles
73
74### Log Strategy
75
76| Log Type | Purpose |
77|----------|---------|
78| **Application logs** | Debug, audit |
79| **Access logs** | Traffic analysis |
80| **Error logs** | Issue detection |
81
82### Log Principles
83
841. **Rotate logs** to prevent disk fill
852. **Structured logging** (JSON) for parsing
863. **Appropriate levels** (error/warn/info/debug)
874. **No sensitive data** in logs
88
89---
90
91## 4. Scaling Decisions
92
93### When to Scale
94
95| Symptom | Solution |
96|---------|----------|
97| High CPU | Add instances (horizontal) |
98| High memory | Increase RAM or fix leak |
99| Slow response | Profile first, then scale |
100| Traffic spikes | Auto-scaling |
101
102### Scaling Strategy
103
104| Type | When to Use |
105|------|-------------|
106| **Vertical** | Quick fix, single instance |
107| **Horizontal** | Sustainable, distributed |
108| **Auto** | Variable traffic |
109
110---
111
112## 5. Health Check Principles
113
114### What Constitutes Healthy
115
116| Check | Meaning |
117|-------|---------|
118| **HTTP 200** | Service responding |
119| **Database connected** | Data accessible |
120| **Dependencies OK** | External services reachable |
121| **Resources OK** | CPU/memory not exhausted |
122
123### Health Check Implementation
124
125- Simple: Just return 200
126- Deep: Check all dependencies
127- Choose based on load balancer needs
128
129---
130
131## 6. Security Principles
132
133| Area | Principle |
134|------|-----------|
135| **Access** | SSH keys only, no passwords |
136| **Firewall** | Only needed ports open |
137| **Updates** | Regular security patches |
138| **Secrets** | Environment vars, not files |
139| **Audit** | Log access and changes |
140
141---
142
143## 7. Troubleshooting Priority
144
145When something's wrong:
146
1471. **Check if running** (process status)
1482. **Check logs** (error messages)
1493. **Check resources** (disk, memory, CPU)
1504. **Check network** (ports, DNS)
1515. **Check dependencies** (database, APIs)
152
153---
154
155## 8. Anti-Patterns
156
157| ❌ Don't | ✅ Do |
158|----------|-------|
159| Run as root | Use non-root user |
160| Ignore logs | Set up log rotation |
161| Skip monitoring | Monitor from day one |
162| Manual restarts | Auto-restart config |
163| No backups | Regular backup schedule |
164
165---
166
167> **Remember:** A well-managed server is boring. That's the goal.
168
169## When to Use
170This skill is applicable to execute the workflow or actions described in the overview.