为IISPHP应用程序缓存UNC共享文件

问题描述

我正在尝试将Windows 2019用作Web节点以通过IIS进行负载平衡。直接从UNC共享中检索文件。

到目前为止,我已经进行了以下配置

使用WinCache进行文件缓存:

[PHP_WINCACHE]
extension=php_wincache.dll
wincache.fcachesize=255
wincache.maxfilesize=2048
wincache.ttlmax=0
wincache.chkinterval=0
wincache.fcndetect=0
wincache.filecount=3500
wincache.reroute_enabled=0

使用php Opache进行操作码和文件缓存:

[OPCACHE]
zend_extension = "php_opcache.dll"
opcache.memory_consumption=2048
opcache.cache_id=loadbalance2
opcache.error_log="D:\temp\php\opcache_errors.log"
opcache.validate_timestamps=0
opcache.interned_strings_buffer=32
opcache.save_comments=0
opcache.max_file_size=0
opcache.file_update_protection=0
opcache.file_cache_consistency_checks=0
opcache.file_cache="D:\temp\php\opcache_filecache"

SMB Performance注册表项:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\FileInfoCacheLifetime (DWORD 3600)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\DirectoryCacheLifetime (DWORD 3600)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\FileInfoCacheEntriesMax (DWORD 65536)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\DirectoryCacheEntriesMax (DWORD 4096)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\DisableBandwidthThrottling (BINARY 1)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\CacheFileTimeout (DWORD 3600)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\DirectoryCacheEntrySizeMax (DWORD 1024)
HKLM\System\CurrentControlSet\Control\Session Manager\Executive\AdditionalCriticalWorkerThreads (DWORD 64)

IIS输出缓存注册表项(仅缓存静态文件):

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters\ObjectCacheTTL (DWORD 3600)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters\OutputCacheTTL (DWORD 3600)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters\FileAttributeCheckThreshold (DWORD 3600)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters\DoDirMonitoringForUNC (BINARY 0)

到目前为止,我仅调整了一个虚拟机以直接从UNC共享工作。所有其他虚拟机都具有完全相同的CPU-RAM-HDD配置,并且文件在本地。

问题在于,直接从UNC共享运行的VM虽然性能不佳,但与具有本地文件的其他VM相比仍然落后。

虽然WinCache在缓存所有文件方面做得很好,但我怀疑仍有一些网络活动会减慢速度。查看性能计数器SMB客户端共享->元数据请求/秒,看来该计数器仍然很高。从每秒1000到4000个请求。

总有没有缓存元数据信息的信息? 还有其他建议吗?

谢谢 亚历克斯

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...