Created
March 9, 2023 17:43
-
-
Save dasginganinja/c5884ef8fde320b661b16b213ebb3195 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
// This code checks for largest opcache consumers | |
$status = opcache_get_status(); | |
// remap | |
foreach ($status['scripts'] as $path => $script) { | |
$sizes[$path] = $script['memory_consumption']; | |
} | |
// Sort in descending order | |
arsort($sizes); | |
// Show top 20 cache users | |
$sortedSizes = array_slice($sizes, 0, 20); | |
?> | |
<h1>Top 20 Largest OpCached files</h1> | |
<pre> | |
<?php var_dump($sortedSizes); ?> | |
</pre> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment