Operations

Monitoring a small Linux server with useful signals

Choose a compact set of service and resource measurements, interpret pressure correctly, and keep alerts actionable.

A small server can run several reliable services, but its margin for waste is limited. Monitoring should reveal whether those services work and whether their resource margin is shrinking. Collecting every available metric at a very short interval can consume the capacity the monitoring system is meant to protect. Start with a few questions that would change an operational decision, then add measurements that answer those questions.

Define what healthy means for each service

A process can exist while its useful behavior is broken. Write one explicit contract for each service: a website serves the expected page over verified HTTPS, a worker completes a small test job, or a collector sends fresh measurements. Check the contract from outside the server when external reachability matters.

Keep service availability separate from host reachability. A successful ping only demonstrates a response to that probe. Conversely, filtered ICMP does not prove a website is down. Include the timestamp of the last successful application check, the selected endpoint, and the response latency so that stale measurements cannot masquerade as current health.

Read a compact baseline before installing collectors

A read-only baseline can begin with:

uptime
free -h
df -h /
df -i /
ss -lnt
cat /proc/pressure/cpu
cat /proc/pressure/memory
cat /proc/pressure/io

Use the installed tools' manuals to confirm platform-specific output. Record the kernel version and the number of vCPUs alongside these values. Disk space and inode availability answer different questions: a filesystem can refuse new files because either resource is exhausted.

For memory, distinguish a small free value from genuinely limited headroom. Linux uses memory for caches. The kernel's proc filesystem documentation describes MemAvailable as an estimate of memory available to start applications without swapping. Watch its trend together with swapping activity and application latency rather than alarming on the free column alone.

Measure contention as well as utilization

A busy CPU may be doing useful work. A low average utilization can also hide short periods in which important tasks wait. Linux Pressure Stall Information exposes time lost to contention through /proc/pressure/. Its some values represent periods when at least some tasks are stalled; full has a stricter meaning, and system-wide CPU full pressure has a documented limitation. See the kernel PSI documentation.

Use pressure measurements as supporting evidence. If page response times rise while memory pressure and swapping increase, investigate memory demand. If storage operations become slow while I/O pressure increases, examine the disk workload. A correlation narrows the inquiry; it does not identify the responsible application without process-level observations.

For a virtual server, also track CPU steal time when available. A guest may wait for the hypervisor to schedule it even when its own applications are configured correctly. Keep those observations distinct from CPU time consumed by a local process.

Keep collectors small and their endpoints private

A host collector should run with only the permissions needed for its measurements. Bind its metrics endpoint to a private or loopback interface when possible, or restrict access to the intended monitoring system. Host metrics can expose filesystem names, interfaces, software details, and capacity information that do not belong on an unrestricted public endpoint.

Prometheus Node Exporter guidance demonstrates host metrics collection and scraping. It is one implementation, not a requirement to deploy a full monitoring stack on the monitored machine. For a constrained VPS, an existing remote collector may be the more manageable place to retain history and evaluate alerts.

Measure the collector's own memory, CPU, and log growth after installation. Avoid enabling optional collectors without a use case. Choose retention and scrape intervals deliberately, and account for the network and disk costs of sending measurements over months rather than minutes.

Build alerts around decisions

An alert should tell its recipient what needs attention, which service is affected, and where to investigate. A brief CPU spike from a scheduled task may require no action. A sustained failure of the public service contract deserves more attention than a dashboard color changing during normal maintenance.

Prometheus's alerting practices emphasize symptom-oriented alerts and avoiding unnecessary noise. Apply that principle with a duration appropriate to the service. Require repeated failures for transient-sensitive checks, but do not hide a serious outage behind an excessively long delay. Include a recovery notification and a short investigation link where the monitoring system supports them.

Capacity alerts should provide time to act. A percentage threshold is a starting point; disk growth per day and remaining usable space can support a more practical estimate. Document assumptions, particularly when traffic accounting resets on a provider schedule different from the monitoring application's calendar.

Maintain a small operational record

Keep deployment times, package changes, service restarts, and unusual traffic events beside the metrics history. These annotations help explain a trend without inventing a causal story afterward. Protect diagnostic records and review them before sharing, because logs can contain addresses, tokens, and request paths.

Periodically remove a measurement that nobody uses and repair a check that silently stopped reporting. A compact, current monitoring system with clear service contracts is easier to trust than a large dashboard whose freshness and alert meaning are uncertain.

Keep reading

Networking · 4 min read

Understanding TCP Connections

Follow a TCP connection from its handshake to its final acknowledgment, and learn what throughput measurements can actually tell you.

Web · 5 min read

Reverse Proxies Explained

Trace requests through a reverse proxy and understand the separate decisions around upstreams, headers, streaming, and failures.

Search notes

Press Escape to close.