Server Management
Server management principles for production operations.
Learn to THINK, not memorize commands.
1. Process Management Principles
Tool Selection
| Scenario |
Tool |
| Node.js app |
PM2 (clustering, reload) |
| Any app |
systemd (Linux native) |
| Containers |
Docker/Podman |
| Orchestration |
Kubernetes, Docker Swarm |
Process Management Goals
| Goal |
What It Means |
| Restart on crash |
Auto-recovery |
| Zero-downtime reload |
No service interruption |
| Clustering |
Use all CPU cores |
| Persistence |
Survive server reboot |
2. Monitoring Principles
What to Monitor
| Category |
Key Metrics |
| Availability |
Uptime, health checks |
| Performance |
Response time, throughput |
| Errors |
Error rate, types |
| Resources |
CPU, memory, disk |
Alert Severity Strategy
| Level |
Response |
| Critical |
Immediate action |
| Warning |
Investigate soon |
| Info |
Review daily |
Monitoring Tool Selection
| Need |
Options |
| Simple/Free |
PM2 metrics, htop |
| Full observability |
Grafana, Datadog |
| Error tracking |
Sentry |
| Uptime |
UptimeRobot, Pingdom |
3. Log Management Principles
Log Strategy
| Log Type |
Purpose |
| Application logs |
Debug, audit |
| Access logs |
Traffic analysis |
| Error logs |
Issue detection |
Log Principles
- Rotate logs to prevent disk fill
- Structured logging (JSON) for parsing
- Appropriate levels (error/warn/info/debug)
- No sensitive data in logs
4. Scaling Decisions
When to Scale
| Symptom |
Solution |
| High CPU |
Add instances (horizontal) |
| High memory |
Increase RAM or fix leak |
| Slow response |
Profile first, then scale |
| Traffic spikes |
Auto-scaling |
Scaling Strategy
| Type |
When to Use |
| Vertical |
Quick fix, single instance |
| Horizontal |
Sustainable, distributed |
| Auto |
Variable traffic |
5. Health Check Principles
What Constitutes Healthy
| Check |
Meaning |
| HTTP 200 |
Service responding |
| Database connected |
Data accessible |
| Dependencies OK |
External services reachable |
| Resources OK |
CPU/memory not exhausted |
Health Check Implementation
- Simple: Just return 200
- Deep: Check all dependencies
- Choose based on load balancer needs
6. Security Principles
| Area |
Principle |
| Access |
SSH keys only, no passwords |
| Firewall |
Only needed ports open |
| Updates |
Regular security patches |
| Secrets |
Environment vars, not files |
| Audit |
Log access and changes |
7. Troubleshooting Priority
When something's wrong:
- Check if running (process status)
- Check logs (error messages)
- Check resources (disk, memory, CPU)
- Check network (ports, DNS)
- Check dependencies (database, APIs)
8. Anti-Patterns
| ❌ Don't |
✅ Do |
| Run as root |
Use non-root user |
| Ignore logs |
Set up log rotation |
| Skip monitoring |
Monitor from day one |
| Manual restarts |
Auto-restart config |
| No backups |
Regular backup schedule |
Remember: A well-managed server is boring. That's the goal.
AGI Framework Integration
Qdrant Memory Integration
Before executing complex tasks with this skill:
python3 execution/memory_manager.py auto --query "<task summary>"
Decision Tree:
- Cache hit? Use cached response directly — no need to re-process.
- Memory match? Inject
context_chunks into your reasoning.
- No match? Proceed normally, then store results:
python3 execution/memory_manager.py store \
--content "Description of what was decided/solved" \
--type decision \
--tags server-management <relevant-tags>
Note: Storing automatically updates both Vector (Qdrant) and Keyword (BM25) indices.
Agent Team Collaboration
- Strategy: This skill communicates via the shared memory system.
- Orchestration: Invoked by
orchestrator via intelligent routing.
- Context Sharing: Always read previous agent outputs from memory before starting.
Local LLM Support
When available, use local Ollama models for embedding and lightweight inference:
- Embeddings:
nomic-embed-text via Qdrant memory system
- Lightweight analysis: Local models reduce API costs for repetitive patterns
1---2name: server-management3description: Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.4---56# Server Management78> Server management principles for production operations.9> **Learn to THINK, not memorize commands.**1011---1213## 1. Process Management Principles1415### Tool Selection1617| Scenario | Tool |18|----------|------|19| **Node.js app** | PM2 (clustering, reload) |20| **Any app** | systemd (Linux native) |21| **Containers** | Docker/Podman |22| **Orchestration** | Kubernetes, Docker Swarm |2324### Process Management Goals2526| Goal | What It Means |27|------|---------------|28| **Restart on crash** | Auto-recovery |29| **Zero-downtime reload** | No service interruption |30| **Clustering** | Use all CPU cores |31| **Persistence** | Survive server reboot |3233---3435## 2. Monitoring Principles3637### What to Monitor3839| Category | Key Metrics |40|----------|-------------|41| **Availability** | Uptime, health checks |42| **Performance** | Response time, throughput |43| **Errors** | Error rate, types |44| **Resources** | CPU, memory, disk |4546### Alert Severity Strategy4748| Level | Response |49|-------|----------|50| **Critical** | Immediate action |51| **Warning** | Investigate soon |52| **Info** | Review daily |5354### Monitoring Tool Selection5556| Need | Options |57|------|---------|58| Simple/Free | PM2 metrics, htop |59| Full observability | Grafana, Datadog |60| Error tracking | Sentry |61| Uptime | UptimeRobot, Pingdom |6263---6465## 3. Log Management Principles6667### Log Strategy6869| Log Type | Purpose |70|----------|---------|71| **Application logs** | Debug, audit |72| **Access logs** | Traffic analysis |73| **Error logs** | Issue detection |7475### Log Principles76771. **Rotate logs** to prevent disk fill782. **Structured logging** (JSON) for parsing793. **Appropriate levels** (error/warn/info/debug)804. **No sensitive data** in logs8182---8384## 4. Scaling Decisions8586### When to Scale8788| Symptom | Solution |89|---------|----------|90| High CPU | Add instances (horizontal) |91| High memory | Increase RAM or fix leak |92| Slow response | Profile first, then scale |93| Traffic spikes | Auto-scaling |9495### Scaling Strategy9697| Type | When to Use |98|------|-------------|99| **Vertical** | Quick fix, single instance |100| **Horizontal** | Sustainable, distributed |101| **Auto** | Variable traffic |102103---104105## 5. Health Check Principles106107### What Constitutes Healthy108109| Check | Meaning |110|-------|---------|111| **HTTP 200** | Service responding |112| **Database connected** | Data accessible |113| **Dependencies OK** | External services reachable |114| **Resources OK** | CPU/memory not exhausted |115116### Health Check Implementation117118- Simple: Just return 200119- Deep: Check all dependencies120- Choose based on load balancer needs121122---123124## 6. Security Principles125126| Area | Principle |127|------|-----------|128| **Access** | SSH keys only, no passwords |129| **Firewall** | Only needed ports open |130| **Updates** | Regular security patches |131| **Secrets** | Environment vars, not files |132| **Audit** | Log access and changes |133134---135136## 7. Troubleshooting Priority137138When something's wrong:1391401. **Check if running** (process status)1412. **Check logs** (error messages)1423. **Check resources** (disk, memory, CPU)1434. **Check network** (ports, DNS)1445. **Check dependencies** (database, APIs)145146---147148## 8. Anti-Patterns149150| ❌ Don't | ✅ Do |151|----------|-------|152| Run as root | Use non-root user |153| Ignore logs | Set up log rotation |154| Skip monitoring | Monitor from day one |155| Manual restarts | Auto-restart config |156| No backups | Regular backup schedule |157158---159160> **Remember:** A well-managed server is boring. That's the goal.161162## AGI Framework Integration163164### Qdrant Memory Integration165166Before executing complex tasks with this skill:167```bash168python3 execution/memory_manager.py auto --query "<task summary>"169```170171**Decision Tree:**172- **Cache hit?** Use cached response directly — no need to re-process.173- **Memory match?** Inject `context_chunks` into your reasoning.174- **No match?** Proceed normally, then store results:175176```bash177python3 execution/memory_manager.py store \178 --content "Description of what was decided/solved" \179 --type decision \180 --tags server-management <relevant-tags>181```182183> **Note:** Storing automatically updates both Vector (Qdrant) and Keyword (BM25) indices.184185### Agent Team Collaboration186187- **Strategy**: This skill communicates via the shared memory system.188- **Orchestration**: Invoked by `orchestrator` via intelligent routing.189- **Context Sharing**: Always read previous agent outputs from memory before starting.190191### Local LLM Support192193When available, use local Ollama models for embedding and lightweight inference:194- Embeddings: `nomic-embed-text` via Qdrant memory system195- Lightweight analysis: Local models reduce API costs for repetitive patterns