{# Capacity of the Portal Host (Hani #1 2026-10-21, R5): the Capacity tab of the Portal Host and the old page. #} {% set h = cap.human %}{% set smp = cap.sample %}
{% from "_donut.html" import donut %} {{ donut(smp.get('disk'), 75, 90, 'Disk', h(smp.get('disk_used')) ~ ' of ' ~ h(smp.get('disk_total')) ~ ' · ' ~ h((smp.get('disk_total') or 0) - (smp.get('disk_used') or 0)) ~ ' free') }} {{ donut(smp.get('memory'), 80, 95, 'Memory', h(smp.get('memory_used')) ~ ' of ' ~ h(smp.get('memory_total'))) }} {{ donut(smp.get('cpu'), 75, 90, 'CPU', (smp.get('cpu_count') or '?')|string ~ ' processors · load ' ~ (smp.get('load') or [])|join(' · ')) }}

Forecast

{% if cap.forecast.days is not none %}{{ cap.forecast.days }} days{% elif cap.forecast.state == 'steady' %}Steady{% else %}Learning{% endif %}

{# Hani #1 2026-10-24: a page no longer than the others - the figures stay on top, every block is a tab. #}

Room for the next update

{% if cap.update_room.enough %}Enough room{% else %}Not enough room{% endif %} {{ cap.update_room.text }}

{% if not cap.update_room.enough %}

Updates will not start until there is room. Free space below (update copies: sudo nexxvu-portal prune-updates), or add disk to this server.

{% endif %}

What uses the disk

{% for k in cap.kinds %}{% endfor %}
KindSizeShare of used diskWhat it is
{{ k.label }}{{ k.human }} {{ k.percent }} %{{ k.help }}{% if k.get('action') %} {{ k.action }}{% endif %}{% if k.get('measured') %} (measured {{ k.measured[:16]|replace('T', ' ') }} UTC){% endif %}
Database tables, largest first ({{ h(cap.database) }} in all)
    {% for t in cap.tables %}
  • {{ t.table }}{% if t.label %} - {{ t.label }}{% endif %}: {{ h(t.bytes) }}{% if t.estimated %} (estimated){% endif %}
  • {% endfor %}

Last 30 days

{% if cap.history %}
{% for r in cap.history|reverse %}{% endfor %}
DayDisk usedDatabaseMemory (highest)CPU (highest)
{{ r.day }}{{ h(r.disk_used) }} {{ h(r.database_bytes) }}{{ h(r.memory_used_max) }}{{ '%.0f'|format(r.cpu_max or 0) }} %
{% else %}

The history starts today: one row a day from now on.

{% endif %}
{% set rt = cap.retention %}{% set qp = request.query_params %}

Monitoring history: how long to keep it

{% if qp.get('capacity_done') %}
{{ qp.get('capacity_done') }}
{% endif %} {% if qp.get('capacity_error') %}{% endif %} {% if rt.task %}{% set t = rt.task %}
{% if t.state == 'running' %} {{ 'Cleaning up' if t.action == 'cleanup' else 'Compacting the database' }} (started {{ t.started }})… {% elif t.state == 'done' and t.action == 'cleanup' and t.result.get('on_data_server') %}Clean-up finished on the data server: {{ t.result.days_dropped }} old days summarised and removed, {{ '{:,}'.format(t.result.hourly_deleted) }} old summaries removed; {{ '{:,}'.format(t.result.local_removed) }} readings older than {{ t.result.local_hours or 6 }} hours removed from the Portal's own copy. Compact the database to give that space back to the disk. {% elif t.state == 'done' and t.action == 'cleanup' %}Clean-up finished: {{ '{:,}'.format(t.result.raw_deleted) }} readings summarised and removed, {{ '{:,}'.format(t.result.hourly_deleted) }} old summaries removed. Compact the database to give the space back to the disk. {% elif t.state == 'done' %}Compaction finished: the database went from {{ h(t.result.before) }} to {{ h(t.result.after) }}. {% else %}{{ 'Clean-up' if t.action == 'cleanup' else 'Compaction' }} stopped: {{ t.error }}{% endif %}
{% endif %} {% set ds = rt.get('data_server') %}{% if ds %}

{% if ds.mode == 'data_server' %}On the data server The history is kept on the data server{% if ds.remote %} ({{ '{:,}'.format(ds.remote.readings_estimate) }} readings, {{ ds.remote.days }} days from {{ ds.remote.oldest_day }}, {{ h(ds.remote.monitoring_bytes) }}){% endif %}; this Portal keeps the last {{ ds.local_hours }} hours for its live pages. The periods below apply on the data server.{% else %}Moving The history is being copied to the data server{% if ds.progress is not none %} ({{ ds.progress }} %){% endif %}; see Settings → Data server.{% endif %}

{% endif %}

Every reading is kept for {{ rt.raw_days }} days, then summarised into hourly averages kept for {{ rt.hourly_days }} days. Right now: {{ '{:,}'.format(rt.rows) }} readings since {{ (rt.oldest or '')[:10] }}, about {{ '{:,}'.format(rt.per_day|int) }} new readings a day (about {{ h(rt.per_day * rt.bytes_per_row) }} a day).

{% for d in rt.raw_choices %}{% endfor %}
Keep every reading forMonitoring history at today's rate
{{ d }} days{% if d == rt.raw_days %} current{% endif %}about {{ h(rt.projection[d]) }}
{% if qp.get('preview') %}

{{ qp.get('preview') }}

{% endif %}
{% if processes is defined and processes %}{% set pr = processes %}

Busiest processes

Measured just now over half a second, across {{ pr.cpus }} processors (100 % = one processor fully busy). Load {{ pr.load|join(' · ') }}. Names only: command lines are not shown, as they can hold passwords.

{% if pr.suggestion %}
{{ pr.suggestion }}
{% endif %}
{% for title, rows, key in [('By CPU', pr.by_cpu, 'cpu'), ('By memory', pr.by_memory, 'memory')] %}
{% for p in rows %}{% endfor %}
{{ title }}
ProcessUserCPUMemoryWhat it is / what to do
{{ p.name }} PID {{ p.pid }}{{ p.user }}{{ p.cpu }} %{{ h(p.memory) }}{{ p.what or '' }}{% if p.advice %} {{ p.advice }}{% endif %}{% if p.stop and (p.cpu > 50 or loop.index == 1 and key == 'cpu' and p.cpu > 20) %} To stop it, on the server: {{ p.stop }}{% endif %}
{% endfor %}
{% endif %} {% if growth is defined and growth %}{% set g = growth %}{% set qp = request.query_params %}

Add capacity through Proxmox

When this Portal runs in a VM on a Proxmox node in your inventory, NEXXVU can add disk (right away, no restart) or memory and processors (after a restart). The node's root account and this server's sudo account are entered for each action and never stored.

{% if qp.get('grow_done') %}
{{ qp.get('grow_done') }}
{% endif %} {% if qp.get('grow_error') %}{% endif %} {% if not g.ready %}

{{ g.reason }}

{% elif not g.plan %}

1. Check: NEXXVU finds this server's VM on {{ g.node.name }} and reads its disk, memory and processors. Nothing changes.

{% else %}{% set vm = g.plan %}
VM
{{ vm.get('vmid') }} on {{ vm.get('node') }}
Disk
{{ vm.get('disk-size') }} on {{ vm.get('disk-storage') }} · {{ h((vm.get('storage-free-kb')|int(0)) * 1024) }} free in that storage
Memory
{{ ((vm.get('memory')|int(0)) / 1024)|round(1) }} GB · {{ h(vm.get('node-memory-free')|int(0)) }} free on the node
Processors
{{ vm.get('cores') }} cores{% if vm.get('sockets') %} × {{ vm.get('sockets') }} socket(s){% endif %} · {{ vm.get('node-cpus') }} on the node

Disk: added on {{ vm.get('node') }}, then this server's partition and filesystem are grown with its sudo account{% if not g.own_ssh %} - add this server's SSH address under Tools › SNMP first{% endif %}. Memory and processors take effect after a restart.

{% if g.last and g.last.get('restart_needed') %}
{% endif %} {% endif %}
{% endif %}