Article · 4 min read · Servers and performance

Monitoring a server

Each server has a Monitoring tab: charts of what the server is doing, second by second, with deploys, updates and memory trouble marked on them. kubespin also tells you when a server runs out of memory, and before it does.

Each server has a Monitoring tab: charts of what the server is doing, second by second, with deploys, updates and memory trouble marked on them. kubespin also tells you when a server runs out of memory, and before it does.

What the agent reads

Every second, the agent reads:

  • CPU, overall (user, system, waiting for I/O, stolen) and per core;
  • memory, split into programs and cache, and swap;
  • time spent waiting for memory, and major page faults;
  • each disk and each network interface;
  • the busiest containers, by CPU and by memory.

It sends the samples with each report. If kubespin can’t be reached, up to 10 minutes of samples wait on the server and are sent later.

How long it’s kept

Detail Kept for
Every second 6 hours
Each minute: average, lowest and highest 30 days
Each hour 13 months

The charts pick the detail that fits the span, and say which: Every second, Each minute or Each hour.

In kubespin

  1. Open the server and choose the Monitoring tab.
  2. Pick a span for every chart at once: 15 min, 1 h, 6 h, Day, Week or 30 days.
  3. Move over any chart to see the same moment on all of them. Drag across a chart to zoom in, and Reset zoom to go back.
  4. On each chart, Table shows the figures as a table, and Full screen opens it larger.

The charts are CPU, CPU per core, Memory, swap, waiting for memory, major page faults, disk, network, and the busiest containers by CPU and by memory. A server with no swap says so on the memory chart, and points to the optimiser (kubespin: Small servers).

Events lists what happened in the span, and marks it on the charts: deploys and their results, OS updates, the optimiser, restarts, out of memory, and running low. Warnings and critical events are labelled.

A server whose agent is older than 0.90.0 sends no samples; the charts fill in after its next update.

Out of memory, and running low

  • Out of memory: when the kernel stops a program for memory, you’re told straight away. The notice names the program (from the server’s kernel log, where it has one), the deploy running at the time, and what used the most memory. It stays in the server’s Needs you for a day.
  • Running low: when programs have waited for memory for more than 10% of 5 minutes, or swap is 90% full, you’re told before it runs out. It’s in Needs you, and clears by itself when memory is back to normal.

Both are emailed by default: Settings › Notifications, “A server runs out of memory, or runs low”. See kubespin: Alarms and alerting.

To stop it happening, see kubespin: Small servers: swap in compressed memory, stopping the biggest program early, and memory limits for your apps.

Command line

The kubespin command has no monitoring commands yet. Use kubespin api, or a script with an API token:

bash
kubespin api GET "/servers/$SERVER_ID/monitoring?range=1h"

API

bash
curl -s "https://kubespin.io/api/v1/servers/$SERVER_ID/monitoring?range=1d" \
  -H "Authorization: Bearer $KUBESPIN_TOKEN"

range is 15m, 1h, 6h, 1d, 7d or 30d. For a span of your own, give from and to as ISO times instead, up to 13 months apart. It returns the times t, each chart’s figures (cpu, cores, mem, swap, containers and so on), the source (seconds, minutes or hours) and the events.

[!permissions] Permissions Area: Servers

Step Needs Default roles
See the Monitoring tab View Admin, Developer, Operator, Viewer

API token: Read only.