Monitoring
- What is server monitoring?
Server monitoring is the process of continuously observing a server's health and performance metrics, such as CPU, memory, disk, and network, to detect issues and ensure uptime. - How do I monitor CPU and memory usage on Linux?
Use command-line tools like top, htop, vmstat, free, and mpstat for real-time and historical CPU/memory monitoring. For ongoing monitoring, set up Prometheus with node_exporter or similar. - How do I read system logs with journalctl?
Use journalctl -u servicename to see logs for one service, add -f to follow new lines live, and use --since with a time to narrow the range. - What is a health check endpoint?
A health check endpoint is a simple URL, such as /health, that returns a success response when the app is running. Load balancers and monitors call it to decide whether the app is healthy. - Which is better for a small server, Prometheus or a hosted uptime service?
A hosted uptime service is simpler for knowing whether a site is up, while Prometheus gives deeper metrics but takes more setup. Many small setups start with a hosted check and add Prometheus later.