Feature Request: Prevent Cache Expiration on high Server Load #347
Labels
Milestone
Comments
Just wanted to comment that implementing this will be super simple once the work in #288 is complete. We can simply connect this to the new |
This is ready for work IMO.
|
A new utility was implemented in wpsharks/comet-cache-pro#127 /*
* System load averages.
*
* @since 15xxxx Adding cache directory statistics.
*
* @return array System load averages.
*/
$self->sysLoadAverages = function () use ($self) {
if (!is_null($averages = &$self->cacheKey('sysLoadAverages'))) {
return $averages; // Already cached these.
}
if (!$self->functionIsPossible('sys_getloadavg')) {
return ($averages = array());
}
if (!is_array($averages = sys_getloadavg()) || !$averages) {
return ($averages = array());
}
$averages = array_map('floatval', $averages);
$averages = array_slice($averages, 0, 3);
// i.e., 1m, 5m, 15m; see: <http://jas.xyz/1gWyJLt>
return $averages;
}; Example Usage$load_averages = $self->sysLoadAverages();
if ($load_averages) {
// 1 minute ago = (float) $load_averages[0];
// 5 minutes ago = (float) $load_averages[1];
// 15 minutes ago = (float) $load_averages[2];
} |
jaswrks
pushed a commit
to wpsharks/comet-cache-pro
that referenced
this issue
Aug 21, 2015
raamdev
added a commit
to wpsharks/comet-cache-pro
that referenced
this issue
Aug 27, 2015
raamdev
added a commit
to wpsharks/comet-cache-pro
that referenced
this issue
Aug 27, 2015
raamdev
added a commit
to wpsharks/comet-cache-pro
that referenced
this issue
Aug 27, 2015
raamdev
added a commit
to wpsharks/comet-cache-pro
that referenced
this issue
Aug 27, 2015
Next Pro Release Changelog:
|
ZenCache Pro v151002 has been released and includes changes from this GitHub Issue. See the v151002 release announcement for further details. This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#347). |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Requested on WordPress.org:
Such a feature, utilizing the PHP
sys_getloadavg()
function, would only work in non-Windows hosting platforms, but nevertheless we could detect ifsys_getloadavg()
works on the current platform and then provide options for letting a site owner configure a specific server-load at which Quick Cache should not allow cache expiration.Support threads referencing this issue
The text was updated successfully, but these errors were encountered: