Repository navigation
perf(page): poll the live values less often and only while they are shown - #1232
Open
karlitschek wants to merge 4 commits into
Open
karlitschek wants to merge 4 commits into
karlitschek wants to merge 4 commits into
Conversation
karlitschek
force-pushed
the
feat/os-status-collector
branch
2 times, most recently
from
October 25, 2026 19:19
6d327c2 to
34014ec
Compare
karlitschek
force-pushed
the
perf/live-polling
branch
from
October 25, 2026 19:28
894fadc to
d7bb029
Compare
The Status page asked for /update every two seconds, and kept asking on the Database, Background jobs and Operating system pages, because those only hide the other pages with v-show. Each request is a full Nextcloud request cycle, and the CPU chart plots the 1-minute load average, which the kernel recomputes only every five seconds, so most samples repeated the previous one. useLiveData now polls every five seconds by default and takes an "active" flag. The Status page passes "the Status page is shown", so the poll pauses on the other pages and resumes with a fresh request the moment the Status page is shown again. The pause for a hidden browser tab and the back-off on failures stay as they were. The charts keep 60 points, which now cover five minutes. The Database page's live charts already stopped while another page was shown, but switching away and back while a request was under way started a second polling loop next to the first. Both pollers now wait for the request under way instead. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Every /update read all hardware temperature sensors. Some of them wake sleeping drives or send NVMe or ATA commands, which a page polling every few seconds should not trigger, and temperatures change slowly anyway. LiveData keeps the readings in the local memory cache for 15 seconds. The cache is per host, like the sensors, and an empty list is cached too, so a host without sensors is not scanned again on every request. The payload is unchanged, so the Temperature section keeps refreshing on its own, just less often. Without a local memory cache configured the sensors are read on every request as before. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
The Database page polls /database/live every three seconds. Each request called DatabaseProbe::ping() and LiveMetrics::collect(), and each of them opened its own connection (a fresh TCP connection with a database override) and detected the database type with a query of its own. The latency was timed over SHOW TABLES, or a pg_tables scan on PostgreSQL, so it grew with the number of tables rather than showing the round trip. PostgreSQL then queried pg_stat_activity twice and pg_settings once for the connection counts. LiveMetrics::collect() now builds the whole response over one connection whose type is detected once: it times SELECT 1 on that connection, and on PostgreSQL reads used, active and maximum connections in one query with count(*) FILTER. A database the probe does not support is not queried further. The JSON is unchanged; the cache hit ratio, which collect() computed but the endpoint never returned, is no longer read. ping() had no other caller and is gone. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
karlitschek
force-pushed
the
perf/live-polling
branch
from
October 25, 2026 19:45
d7bb029 to
e032383
Compare
karlitschek
marked this pull request as ready for review
October 25, 2026 20:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on
feat/os-status-collector(#1214).AI disclosure: this change was written with Claude Code (claude-opus-5-5) and is to be reviewed by the author before it leaves draft; every commit carries an
Assisted-bytrailer.🤖 Generated with Claude Code