Repository navigation
fix: use container-aware load averages - #1162
Conversation
027d9db to
5384d40
Compare
| return sys_getloadavg(); | ||
| $load = $this->backend->getAverageLoad(); | ||
|
|
||
| return $load !== false ? $load : sys_getloadavg(); |
There was a problem hiding this comment.
if (function_exists('sys_getloadavg')) {
return sys_getloadavg();
}
return false;
-
Please check if the function is available (e.g. when disabled with disabled_functions).
-
Please remove
getAverageLoadin Cpu.php.
There was a problem hiding this comment.
Done! Added function_exists('sys_getloadavg') check for fallback and removed the redundant getAverageLoad method from CPU.php.
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
53a5bd3 to
f9acf3e
Compare
Assisted-by: ClaudeCode:claude-sonnet-5-5 Assisted-by: Codex:gpt-5 Signed-off-by: jiri001meitner <jiri001meitner@gmail.com> Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
f9acf3e to
c42f7e7
Compare
|
/backport to stable35 |
Summary
/proc/loadavgsys_getloadavg()as a portable fallback when the OS backend cannot provide a value/proc/loadavgdataProblem
Inside an LXC container, PHP's
sys_getloadavg()can report the physical host load while/proc/loadavgis correctly virtualized for the container. Server Info then divides the host load by the container's CPU count, producing persistent values such as 500% on an otherwise idle 8-vCPU container.Observed on the affected system:
Linux now prefers its namespace-aware procfs value. Non-Linux systems and installations where procfs is unavailable keep the existing PHP fallback.
Validation
/proc/loadavgnow return the same three valuesAI assistance
This contribution was prepared with assistance from OpenAI Codex (GPT-5). The contributor reviewed, tested, and is responsible for the submitted changes.