Settings: Performance

The Performance page with the budget and the polling rates

The tab Performance under Settings. Viewing it needs the permission view_diagnostics. Apply works only over HTTPS, and each row needs the right of what it changes: edit_setup for the budget, the live update and the learning level, automations for the rule checks and the regulator, system_actions for the node agent and the device services.

Budget and polling rates

Settings, Performance reads /proc and the cgroups of the node services every 15 seconds and keeps six hours of samples in memory only. After a restart the measurement starts again. Proposals need six hours of measurement, until then the page asks for a confirmation before it applies anything.

The budget is the share of the CPU the node may use. The default limit is 60 % on one core and 70 % from two cores. Warning signals such as throttling, high temperature, little free RAM or swapping reduce the available budget by up to 40 points. You can change the limit in steps of 5 % between 20 and 95 %.

Every row is one polling rate with the steps the device allows. The lowest step is the device limit of the service, for example 2 s for Shelly. The limit is stored as poll_floor_s in the manifest of each service. The page of each service states the source of its value.

Nothing changes without a click. After you apply, the page records the change and checks it for 15 minutes. If the 95th percentile of the measured load then stays below the available budget, the check passes. If it does not, the page shows the measurement instead of the estimate and makes the rollback the main button. The rollback puts back the values from before the change. A row that someone changed in the meantime is a conflict. The page then offers to roll back only the other rows or to leave everything as it is. The last change is kept in performance/last-change.json in the data directory and survives a restart. A check that was running then measures again from the start.

If the node stays over the available budget for 30 minutes, the diagnostics raise the finding Performance over budget. It clears after 10 minutes below the budget minus 5 points. The measurement itself costs less than 0.5 % of one core.

Breakdown of the dashboard and automation load

In the card Measurements, the rows Dashboard and Automations open on a click. They show what the load of that row is made of. The label next to the values says how the shares were found.

Dashboard (measured). The dashboard times its own work in five parts:

Part What it covers
Push to browsers building and sending the live update stream
Other requests all web requests except the live update stream itself
MQTT input processing each state message
Node agent the regular runs of the node agent
Background the other periodic jobs, such as storage checks, the sweep, the scheduler and the energy recorder

The sixth entry is the garbage collection, read from the Go runtime. The parts add up to the load of the dashboard, so each bar reads as a share of that row. Push also shows the highest number of open browsers in the window. The live update stream is left out of the request time because a connection stays open for hours and would otherwise count as work the whole time.

Automations (estimated). The automation service does not time its rules one by one. The page spreads the cost of the row “Checking rules” evenly over all active rules and scenarios, and the cost of the row “Regulator” evenly over the active scenarios that have a regulator. A scenario with a regulator appears in both groups. Disabled entries do not count. Each group lists at most six entries, the rest is shown as “more”. The regulator row only exists while at least one active scenario has a regulator.

Right after a start nothing is measured yet, and the rows look as before without a button.

The split also feeds the cost model of the other rows. Live update takes the push share of the dashboard, Node agent takes the node share, and the MQTT share goes into the cost of each message. Requests and background work stay in the base load. The garbage collection is spread over the parts in proportion, so the sum of the rows does not change. The split is kept in memory only, like the rest of the measurement.

Learning level

The card Polling rates has the row Learning features. The level is one of Automatic, Economical, Balanced and Full. Automatic lets the node choose. A click on a level only changes the draft. Apply saves it together with the polling rates.

The effort of learning is part of the total load at the top. The measured share is already counted there. When the draft level is higher or lower, the total moves by the estimated difference, so you see the effect before you save. In the card Measurements, learning is listed inside the breakdown of the dashboard, with its detectors.

Each level has a target share of the load: 5 percent on Economical and 10 percent on the others. If the draft level would exceed its target, the page says so, and the choice stays possible.

When the share stays below half of the target for 7 days in a row, the page marks the next higher level as suggested. Selecting it puts it into the draft like any other level.

Written for Energy Node v0.12.0.

Edit on GitHub