TYPO3 10 中是否有提高登录速度和总体性能的选项?

Te *_* Oh 7 php typo3 typo3-10.x typo3-11.x

介绍

我们运行大量TYPO3 7.6TYPO3 10.4安装,仅作为前端应用程序的后端。我们编写了几个中间件和 extbase 插件来管理我们的数据。

问题

从TYPO3 7.6迁移到TYPO3 10.4后,总体执行性能明显变慢。例如登录前端用户。TYPO3 7.6与PHP 7.0一起运行,TYPO3 10.4PHP 7.4一起运行。

PHP 性能测试

首先,我使用一个小型基准脚本测试了 PHP 的总体性能。结果是,PHP 7.4​​ PHP 7.0快 30%左右。我在同一硬件上使用 docker 容器在本地进行了此测试。操作码缓存已启动并正在运行。

因此 TYPO3 使用 PHP 7.4 的执行速度应该快 30%。但事实并非如此。它比较慢。

TYPO3性能测试

因此,我使用TYPO3 7.6 LTSTYPO3 10.4 LTSTYPO3 11.1进行了几次性能测试。一般执行速度差别很大。我为这 3 个版本安装了标准 TYPO3,仅添加了登录表单并测量了响应时间。

TYPO3版本 行动 响应时间(毫秒) 比 TYPO3 7.6 慢一些
7.6 前端用户登录 185
10.4 前端用户登录 第759章 4.1
11.1 前端用户登录 802 4.3
7.6 前端用户注销 26
10.4 前端用户注销 185 7.2
11.1 前端用户注销 187 7.3

所有动作连续运行5次并计算平均值。

问题

  • 我如何理解这种行为?从 PHP 方面来看,我的速度提高了 30%,但 TYPO3 获得了一切,并且需要更多资源来完成相同的操作。
  • 我有哪些选项可以加速 TYPO3 10.4 或 11.1?
  • TYPO3 和/或 PHP 设置中是否有配置选项以获得更好的性能?

非常感谢您的每一个提示或暗示。

更新

这是精确测量的设置和描述。

错字3 7.6.32

软件版本

Ubuntu 18.04 / Apache 2.4.29 / MariaDB 10.1.44 / PHP 7.0.33

核心 PHP 设置

max_execution_time: 240  
max_input_time: 60  
max_input_vars: 1500  
memory_limit: 512M  
xdebug: Off
Run Code Online (Sandbox Code Playgroud)

Zend OPcache PHP 设置

Opcode Caching: Up and Running  
Optimization: Enabled  
SHM Cache: Enabled  
File Cache: Disabled  
Startup: OK  
Shared memory model: mmap  
Cache hits: 9544  
Cache misses: 694  
Used memory: 23044360  
Free memory: 44064504  
Wasted memory: 0  
Interned Strings Used memory: 2361632  
Interned Strings Free memory: 1832672  
Cached scripts: 686  
Cached keys: 1356  
Max keys: 3907  
OOM restarts: 0  
Hash keys restarts: 0  
Manual restarts: 0
Run Code Online (Sandbox Code Playgroud)

Zend OPcache 指令

opcache.blacklist_filename: no value  
opcache.consistency_checks: 0  
opcache.dups_fix: Off  
opcache.enable: On  
opcache.enable_cli: Off  
opcache.enable_file_override: Off  
opcache.error_log: no value  
opcache.fast_shutdown: 0  
opcache.file_cache: no value  
opcache.file_cache_consistency_checks: 1  
opcache.file_cache_only: 0  
opcache.file_update_protection: 2  
opcache.force_restart_timeout: 180  
opcache.huge_code_pages: Off  
opcache.inherited_hack: On  
opcache.interned_strings_buffer: 4  
opcache.lockfile_path: /tmp  
opcache.log_verbosity_level: 1  
opcache.max_accelerated_files: 2000  
opcache.max_file_size: 0  
opcache.max_wasted_percentage: 5  
opcache.memory_consumption: 64  
opcache.optimization_level: 0x7FFFBFFF  
opcache.preferred_memory_model: no value  
opcache.protect_memory: 0  
opcache.restrict_api: no value  
opcache.revalidate_freq: 2  
opcache.revalidate_path: Off  
opcache.save_comments: 1  
opcache.use_cwd: On  
opcache.validate_permission: Off  
opcache.validate_root: Off  
opcache.validate_timestamps: On
Run Code Online (Sandbox Code Playgroud)

安装

max_execution_time: 240  
max_input_time: 60  
max_input_vars: 1500  
memory_limit: 512M  
xdebug: Off
Run Code Online (Sandbox Code Playgroud)

设置:创建空白页面

激活扩展
about/aboutmodules/backend/belog/beuser/context_help/core/cshmanual/extbase/extensionmanager/felogin/filelist/fluid/fluid_styled_content/form/frontend/impexp/info/info_pagetsconfig/install/lang/recordlist/rsaauth/rtehtmlarea/ saltedpasswords/调度程序/设置/sv/sys_note/t3editor/t3skin/tstemplate/typo3_console/viewpage

设置

Configuration presets > Debug settings: Live  
All configurations: [FE][loginSecurityLevel] = normal
Run Code Online (Sandbox Code Playgroud)

设置

1.更新根TypoScript模板的设置

page = PAGE
page.100 < styles.content.get
Run Code Online (Sandbox Code Playgroud)

2.为fe_users创建文件夹

3. 创建网站用户组

  • 组名:测试

4.创建网站用户

  • 用户名: 测试
  • 密码:[密码]
  • 组别:测试

5.主页添加登录表单

测量响应时间

使用 Postman 向 TYPO3 发送请求。

登录

POST http://typo3-76-standard.localhost/
正文 (x-www-form-urlencoded)

  • 用户: 测试
  • 通过:[密码]
  • pid: [feUserPid]
  • 登录类型: 登录

登出

POST http://typo3-76-standard.localhost/
正文 (x-www-form-urlencoded)

  • 登录类型: 注销

打字错误3 10.4.15

软件版本

Ubuntu 18.04 / Apache 2.4.29 / MariaDB 10.3.22 / PHP 7.4.16

核心 PHP 设置

max_execution_time: 240  
max_input_time: 60  
max_input_vars: 1500  
memory_limit: 1024M  
xdebug: Off
Run Code Online (Sandbox Code Playgroud)

Zend OPcache PHP 设置

Opcode Caching: Up and Running  
Optimization: Enabled  
SHM Cache: Enabled  
File Cache: Disabled  
Startup: OK  
Shared memory model: mmap  
Cache hits: 71894  
Cache misses: 1146  
Used memory: 34302304  
Free memory: 99899120  
Wasted memory: 16304  
Interned Strings Used memory: 3942240  
Interned Strings Free memory: 2348768  
Cached scripts: 1120  
Cached keys: 2146  
Max keys: 16229  
OOM restarts: 0  
Hash keys restarts: 0  
Manual restarts: 0
Run Code Online (Sandbox Code Playgroud)

Zend OPcache 指令

opcache.blacklist_filename: no value  
opcache.consistency_checks: 0  
opcache.dups_fix: Off  
opcache.enable: On  
opcache.enable_cli: Off  
opcache.enable_file_override: Off  
opcache.error_log: no value  
opcache.file_cache: no value  
opcache.file_cache_consistency_checks: On  
opcache.file_cache_only: Off  
opcache.file_update_protection: 2  
opcache.force_restart_timeout: 180  
opcache.huge_code_pages: Off  
opcache.interned_strings_buffer: 8  
opcache.lockfile_path: /tmp  
opcache.log_verbosity_level: 1  
opcache.max_accelerated_files: 10000  
opcache.max_file_size: 0  
opcache.max_wasted_percentage: 5  
opcache.memory_consumption: 128  
opcache.opt_debug_level: 0  
opcache.optimization_level: 0x7FFEBFFF  
opcache.preferred_memory_model: no value  
opcache.preload: no value  
opcache.preload_user: no value  
opcache.protect_memory: Off  
opcache.restrict_api: no value  
opcache.revalidate_freq: 2  
opcache.revalidate_path: Off  
opcache.save_comments: On  
opcache.use_cwd: On  
opcache.validate_permission: Off  
opcache.validate_root: Off  
opcache.validate_timestamps: On
Run Code Online (Sandbox Code Playgroud)

安装

Opcode Caching: Up and Running  
Optimization: Enabled  
SHM Cache: Enabled  
File Cache: Disabled  
Startup: OK  
Shared memory model: mmap  
Cache hits: 9544  
Cache misses: 694  
Used memory: 23044360  
Free memory: 44064504  
Wasted memory: 0  
Interned Strings Used memory: 2361632  
Interned Strings Free memory: 1832672  
Cached scripts: 686  
Cached keys: 1356  
Max keys: 3907  
OOM restarts: 0  
Hash keys restarts: 0  
Manual restarts: 0
Run Code Online (Sandbox Code Playgroud)

设置:创建空白页面

设置

Configuration presets > Debug settings: Live  
Feature Toggles > Felogin extbase: Off
Run Code Online (Sandbox Code Playgroud)

设置

1.更新根TypoScript模板的设置

page = PAGE
page.100 = CONTENT
page.100 {
    table = tt_content
    select {
        orderBy = sorting
        where = {#colPos}=0
    }
}
Run Code Online (Sandbox Code Playgroud)

2.为fe_users创建文件夹

3. 创建网站用户组

  • 组名:测试

4.创建网站用户

  • 用户名: 测试
  • 密码:[密码]
  • 组别:测试

5.主页添加登录表单

测量响应时间

使用 Postman 向 TYPO3 发送请求。

登录

POST http://typo3-104-standard.localhost/
正文 (x-www-form-urlencoded)

  • 用户: 测试
  • 通过:[密码]
  • pid: [feUserPid]
  • 登录类型: 登录

登出

POST http://typo3-104-standard.localhost/
正文 (x-www-form-urlencoded)

  • 登录类型: 注销

打字错误3 11.1.1

软件版本

Ubuntu 18.04 / Apache 2.4.29 / MariaDB 10.3.22 / PHP 7.4.15

核心 PHP 设置

max_execution_time: 240  
max_input_time: 60  
max_input_vars: 1500  
memory_limit: 1024M  
xdebug: Off
Run Code Online (Sandbox Code Playgroud)

Zend OPcache PHP 设置

Opcode Caching: Up and Running  
Optimization: Enabled  
SHM Cache: Enabled  
File Cache: Disabled  
Startup: OK  
Shared memory model: mmap  
Cache hits: 71894  
Cache misses: 1146  
Used memory: 34302304  
Free memory: 99899120  
Wasted memory: 16304
Interned Strings Used memory: 3942240  
Interned Strings Free memory: 2348768  
Cached scripts: 1120  
Cached keys: 2146  
Max keys: 16229  
OOM restarts: 0  
Hash keys restarts: 0  
Manual restarts: 0
Run Code Online (Sandbox Code Playgroud)

Zend OPcache 指令

opcache.blacklist_filename: no value  
opcache.consistency_checks: 0  
opcache.dups_fix: Off  
opcache.enable: On  
opcache.enable_cli: Off  
opcache.enable_file_override: Off  
opcache.error_log: no value  
opcache.file_cache: no value  
opcache.file_cache_consistency_checks: On  
opcache.file_cache_only: Off  
opcache.file_update_protection: 2  
opcache.force_restart_timeout: 180  
opcache.huge_code_pages: Off  
opcache.interned_strings_buffer: 8  
opcache.lockfile_path: /tmp  
opcache.log_verbosity_level: 1  
opcache.max_accelerated_files: 10000  
opcache.max_file_size: 0  
opcache.max_wasted_percentage: 5  
opcache.memory_consumption: 128  
opcache.opt_debug_level: 0  
opcache.optimization_level: 0x7FFEBFFF  
opcache.preferred_memory_model: no value  
opcache.preload: no value  
opcache.preload_user: no value  
opcache.protect_memory: Off  
opcache.restrict_api: no value  
opcache.revalidate_freq: 2  
opcache.revalidate_path: Off  
opcache.save_comments: On  
opcache.use_cwd: On  
opcache.validate_permission: Off  
opcache.validate_root: Off  
opcache.validate_timestamps: On
Run Code Online (Sandbox Code Playgroud)

安装

opcache.blacklist_filename: no value  
opcache.consistency_checks: 0  
opcache.dups_fix: Off  
opcache.enable: On  
opcache.enable_cli: Off  
opcache.enable_file_override: Off  
opcache.error_log: no value  
opcache.fast_shutdown: 0  
opcache.file_cache: no value  
opcache.file_cache_consistency_checks: 1  
opcache.file_cache_only: 0  
opcache.file_update_protection: 2  
opcache.force_restart_timeout: 180  
opcache.huge_code_pages: Off  
opcache.inherited_hack: On  
opcache.interned_strings_buffer: 4  
opcache.lockfile_path: /tmp  
opcache.log_verbosity_level: 1  
opcache.max_accelerated_files: 2000  
opcache.max_file_size: 0  
opcache.max_wasted_percentage: 5  
opcache.memory_consumption: 64  
opcache.optimization_level: 0x7FFFBFFF  
opcache.preferred_memory_model: no value  
opcache.protect_memory: 0  
opcache.restrict_api: no value  
opcache.revalidate_freq: 2  
opcache.revalidate_path: Off  
opcache.save_comments: 1  
opcache.use_cwd: On  
opcache.validate_permission: Off  
opcache.validate_root: Off  
opcache.validate_timestamps: On
Run Code Online (Sandbox Code Playgroud)

设置:创建空白页面

设置

Configuration presets > Debug settings: Live
Run Code Online (Sandbox Code Playgroud)

设置

1.更新根TypoScript模板的设置

page = PAGE
page.100 = CONTENT
page.100 {
    table = tt_content
    select {
        orderBy = sorting
        where = {#colPos}=0
    }
}
Run Code Online (Sandbox Code Playgroud)

2.为fe_users创建文件夹

3. 创建网站用户组

  • 组名:测试

4.创建网站用户

  • 用户名: 测试
  • 密码:[密码]
  • 组别:测试

5.主页添加登录表单

测量响应时间

使用 Postman 向 TYPO3 发送请求。

登录

POST http://typo3-111-standard.localhost/
正文 (x-www-form-urlencoded)

  • 用户: 测试
  • 通过:[密码]
  • pid: [feUserPid]
  • 登录类型: 登录

登出

POST http://typo3-111-standard.localhost/
正文 (x-www-form-urlencoded)

  • 登录类型: 注销

knb*_*knb 1

这些天我也在felogin为 10.4 的扩展而苦苦挣扎。

3 个提示,全部纯属猜测,在您发布此内容一年后:

  1. 弃用日志记录
  2. PSR-14 事件
  3. 管理面板

也许是“弃用日志记录”减慢了速度。
我注意到在你的设置中你已经设置了

Felogin extbase: Off

这表明您希望激活旧的行为并使用旧的代码库。然而,10.4 代码中有多个(约 10 个)位置,如下所示:

class FrontendLoginController extends AbstractPlugin {  

    public function main($content, $conf){

        trigger_error(
            'The pibase felogin plugin is deprecated since TYPO3 10.4 and will be removed in version 11.0',
            E_USER_DEPRECATED
        );
...}
}

// found in:
// public/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php:

Run Code Online (Sandbox Code Playgroud)
  1. 还有一个新的 PSR-14 基于事件的 Hook 和 SLot 替代品。felogin调度几个事件。felogin 会根据操作发出相当多的事件。 https://docs.typo3.org/c/typo3/cms-felogin/11.5/en-us/Events/Index.html 我不知道这是否处于活动状态(因为您明确决定使用旧的代码库,并且PSR-14事件代码是新代码)

  2. 您可以通过管理面板找出耗时的步骤。Typoscript 选项卡,设置齿轮图标,“显示所有时间”。