Infrastructure5 min read

Monitor a VPS with signals that lead to a useful first response

Monitoring is useful when it changes the next decision. A server can respond to ping while the application fails, and a busy CPU can be healthy during expected work. Start with what users need, then collect enough evidence to explain when that experience changes.

The practical takeaway

Watch the application from outside and its resource constraints from inside, compare changes with a baseline, and give every urgent alert a clear owner and first action.

Define health in terms of one important user journey

Choose an application journey that matters: opening a public page, signing in or reading a representative API resource. Define what a successful result looks like, including response content and a reasonable completion time. An HTTP 200 response containing an error page should not automatically count as success. Keep synthetic checks safe and avoid creating real orders or sending customer messages.

Run an external check from outside the VPS so it can notice failures that an internal process cannot see. Add internal service and host measurements to explain the failure. Together they answer two different questions: can a user complete the request, and which part of the system is under pressure? Neither view replaces the other.

Document the check identity, frequency and expected permissions. If it uses an account, give that account only the access needed for the synthetic journey. Monitor whether the monitoring system itself is collecting data. A blank graph may represent missing collection rather than zero traffic, and those two situations require different first actions.

Build a small dashboard around symptoms and constraints

SignalUseful viewQuestion it answers
Request latencySuccessful and failed requests, including slower percentilesWhich users are waiting longer?
TrafficRequests, jobs or connections per intervalDid demand or background work change?
ErrorsFailure rate with the underlying request countHow much useful work is failing?
SaturationCPU, available memory, storage pressure and queuesWhich resource may be limiting progress?
Operational changesReleases, configuration changes and scheduled jobsWhat changed near the symptom onset?

Avoid relying on an average latency alone. A small group of very slow requests can be hidden by many quick ones. Separate important routes or workload classes without giving every customer identifier its own metric label. Keep the measurements stable enough to compare Tuesday morning with an equivalent earlier period rather than mixing unrelated traffic into one reassuring number.

A CPU graph needs application context. High utilisation during a planned batch job may be expected, while growing request latency and a queue during normal traffic can indicate a capacity problem. Similarly, inspect available memory and application behaviour rather than interpreting all filesystem cache as a leak. Look for sustained pressure and relevant errors before deciding to resize the server.

Choose alerts someone can act on

An urgent alert should describe a meaningful symptom and a response the recipient can begin. A failed external application journey sustained across several checks is different from a brief CPU spike. Route planned capacity work to a review queue when immediate interruption is unnecessary. Every alert needs an owner, a working notification path and a short diagnostic note.

Thresholds are workload decisions. As an example, a team may investigate when a normally fast API has a 95th-percentile latency above 900 milliseconds for ten minutes while receiving enough requests for the measurement to be useful. That is an illustrative policy, not a universal limit or an HM Bastion latency guarantee. Review false alarms and missed incidents against actual user impact.

Storage alerts should consider how quickly free space is changing. Twenty gigabytes remaining means something different when growth is one gigabyte per day or ten gigabytes per hour. Include inode pressure where relevant and distinguish persistent application growth from a runaway log. Prefer an early, actionable capacity warning to waiting until writes have already failed.

Use the first diagnostic pass to narrow the failing layer

  • Confirm the symptom from an independent location and record its start time.
  • Check whether DNS, connection setup, HTTPS or the application response is failing.
  • Compare request errors and latency with traffic and the most recent change markers.
  • Inspect the affected service status, bounded recent logs and dependency connectivity.
  • Compare CPU, memory, storage and queue behaviour with the normal baseline.
  • Escalate with the observed failing layer before making unrelated changes.

Suppose the home page works but API requests return 502 after a release. Start with the proxy error and application process or socket it references, rather than assuming a wider network incident. If all local checks pass but external requests time out, examine the public path and listening entry point. These are diagnostic branches to verify, not automatic conclusions from one status code.

On a systemd-based Linux server, the journal can be filtered to the affected unit and time interval. Compare it with application and reverse-proxy logs using consistent timestamps. Retain enough context to connect an error with a request, but redact credentials and sensitive payloads before sharing excerpts. A targeted recent interval is usually more useful than a complete unfiltered log archive.

Review coverage and turn evidence into a capacity decision

Metrics describe trends, logs describe particular events and traces can show how a request spends time across components. Introduce the smallest combination that answers your current questions. An elaborate tracing system adds little if nobody receives the application-down alert or the backup job has not reported a usable result for a week.

After a release or meaningful workload change, confirm that checks still exercise the right journey and that collection still works. Use sustained measurements to decide whether an application fix, query improvement, schedule change or different resource allocation is justified. Keep incident coordination and service recovery in a separate procedure so the dashboard remains a clear starting point rather than a collection of emergency instructions.

Sources and further reading