新安装的 SuiterCRM 8 速度很慢,怎么办?

在同一台服务器上安装了 SuiteCRM 7 和 8。版本 7 非常活泼。在版本 8 中,每次单击之间我必须等待大约一秒钟。

为了更深入地了解我接下来要说的内容,您可以阅读以下内容:

SuiterCRM 8
SuiterCRM 8

从上面可以尝试一些事情,也许影响最大的是:

启用 opcache

在 php.ini 上设置和配置 opcache

以下示例基于上述 Symfony 文档:

[opcache]
; Determines if Zend OPCache is enabled
zend_extension=opcache.so
opcache.enable=1

; The OPcache shared memory storage size.
opcache.memory_consumption=256

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=20000

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
opcache.validate_timestamps=0
默认opcache未开启
默认opcache未开启

以下性能(Symfony 文档)

置 OPcache 以获得最佳性能

默认的 OPcache 配置不适合 Symfony 应用程序,因此建议按如下方式更改这些设置:

; php.ini
; maximum memory that OPcache can use to store compiled PHP files
opcache.memory_consumption=256

; maximum number of files that can be stored in the cache
opcache.max_accelerated_files=20000

不要检查 PHP 文件时间戳

在生产服务器中,PHP 文件不应更改,除非部署了新的应用程序版本。但是,默认情况下 OPcache 会检查缓存文件自被缓存以来是否更改了它们的内容。此检查引入了一些可以避免的开销,如下所示: 

; php.ini
opcache.validate_timestamps=0

每次部署后,必须清空并重新生成 OPcache 的缓存。否则,您将看不到应用程序中所做的更新。鉴于在 PHP 中,CLI 和 Web 进程不共享相同的 OPcache,您无法通过在终端中执行某些命令来清除 Web 服务器 OPcache。这些是一些可能的解决方案:

  1. 重启网络服务器;
  2. 通过网络服务器调用apc_clear_cache()opcache_reset()函数(即通过将这些放在您在网络上执行的脚本中);
  3. 使用cachetool实用程序从 CLI 控制 APC 和 OPcache。

配置 PHPrealpath缓存

当相对路径转换为真实路径和绝对路径时,PHP 会缓存结果以提高性能。打开许多 PHP 文件的应用程序,例如 Symfony 项目,应该至少使用这些值: 

; php.ini
; maximum memory allocated to store the results
realpath_cache_size=4096K

; save the results for 10 minutes (600 seconds)
realpath_cache_ttl=600

realpath当open_basedir配置选项启用时,PHP 会禁用缓存。

推荐阅读

  1. SuiteCRM 8.1.2 刚刚发布!
  2. SuiteCRM 8.1.1 & 7.12.6 发布
  3. 为了官方更好的技术服务,请捐赠SuiteCRM
  4. SuiteCRM 8.1发布-官方版本再更新!
  5. 苏格兰公司 SuiteCRM 再次获奖
  6. 安全和维护补丁:SuiteCRM 8.0.4 & 7.12.5 发布
  7. 将 SuiteCRM 升级到更新版本
  8. SuiteCRM 升级环境(PHP\MySQL\Apache)要求

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注