How it works
Centralized logs make errors searchable across many servers. Host metrics such as CPU and memory show local pressure; tier metrics show the health of the whole database or cache fleet; business metrics such as active users and retention show whether the product is serving people. Common tools include Prometheus for collecting metrics and Grafana for dashboards.
Evidence shortens an incident. Imagine, as an example, that p99 latency, the time within which 99% of requests finish, jumps from 200 ms to 900 ms at 14:05. Web CPU is flat, so adding web servers will not help. Database reads have risen sixfold, because the cache hit rate fell from 95% to 70%. A deploy at 14:03 changed the cache key format. The fix is a rollback, not a bigger database. Distributed tracing, which records one request’s path through every service, helps when the cause is less obvious.
Automated build, test, and deployment reduce mistakes as the number of servers and regions grows. Use latency, errors, saturation, queue age, and workload shape to decide which tier to change. A rising user count by itself does not prove the database needs sharding.
Monitoring has costs too. At 1,000 requests per second, a 1 KB log line per request is about 86 GB per day, so teams sample or shorten retention. A metric labeled by user ID can create millions of time series and strain the metrics system. A small app can start with error tracking, an uptime check, and a few dashboards.
Search has slowed down all week. Web CPU is flat at 30%, database CPU is climbing, and no deploy matches the start of the slowdown.
Start with the database evidence: slow query logs, query counts, and the cache hit rate. Web servers are not the constraint, so adding them will not help. Without a matching deploy, suspect gradual change such as growing tables or a shifting query mix. Trace one slow request to confirm, then make one targeted change and watch the same metrics.
Use this as a guide for self review; written answers are not graded.Keep in mind
- Logs explain failures; metrics show scale and trends.
- Automation helps keep deployments consistent across servers and regions.