如何解决OPcache统计数据看起来不正确
我已在运行PHP 7.3的Windows服务器上启用了OPcache。该盒子运行两个Laravel应用程序。
这是我通过phpinfo()从OPcache查看的统计信息:
+------------------------------+------------------+
| Item | Value |
+------------------------------+------------------+
| Opcode Caching | Up and Running |
+------------------------------+------------------+
| Optimization | Enabled |
+------------------------------+------------------+
| SHM Cache | Enabled |
+------------------------------+------------------+
| File Cache | Disabled |
+------------------------------+------------------+
| Startup | OK |
+------------------------------+------------------+
| Shared memory model | win32 |
+------------------------------+------------------+
| Cache hits | 281148 |
+------------------------------+------------------+
| Cache misses | 16310726 |
+------------------------------+------------------+
| Used memory | 134043808 |
+------------------------------+------------------+
| Free memory | 44136 |
+------------------------------+------------------+
| Wasted memory | 129784 |
+------------------------------+------------------+
| Interned Strings Used memory | 6289280 |
+------------------------------+------------------+
| Interned Strings Free memory | 1728 |
+------------------------------+------------------+
| Cached scripts | 16 |
+------------------------------+------------------+
| Cached keys | 33 |
+------------------------------+------------------+
| Max keys | 16229 |
+------------------------------+------------------+
| OOM restarts | 1 |
+------------------------------+------------------+
| Hash keys restarts | 0 |
+------------------------------+------------------+
| Manual restarts | 0 |
+------------------------------+------------------+
我关心的值是命中和未命中之间的巨大差异,以及缓存的脚本和键的数量很少。
我不明白OPcache如何设法使用134043808内存来缓存16个脚本和33个键?
这是我的php.ini文件中的配置:
zend_extension="C:\UFIS\PHPs\7_3_8_64_ts\ext\php_opcache.dll"
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.max_wasted_percentage=5
opcache.validate_timestamps=1
opcache.revalidate_freq=30
opcache.save_comments=1
opcache.load_comments=1
我当然不是OPcache(或任何缓存系统)专家。因此,我希望有人对这些看似奇怪的结果有所了解。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。