Are there options to improve the login speed and the general performance in TYPO3 10?

Viewed 217

Introduction

We run a lot of TYPO3 7.6 and TYPO3 10.4 installations only as a Backend for frontend applications. We programmed several middlewares and extbase plugins to manage our data.

Problem

After migration from TYPO3 7.6 to TYPO3 10.4 the general execution performance is significantly slower. For example to login a frontend user. TYPO3 7.6 runs with PHP 7.0 and TYPO3 10.4 with PHP 7.4.

PHP performance tests

First I tested the general performance of PHP with a small benchmark script. The result is, that PHP 7.4 is around 30% faster than PHP 7.0. I made this tests locally with docker containers on the same hardware. Opcode Caching is up and running.

So TYPO3 should execute 30% faster with PHP 7.4. But it is not the case. It is slower.

TYPO3 performance tests

So I make several performance tests with TYPO3 7.6 LTS, TYPO3 10.4 LTS and also TYPO3 11.1. The general execution speed is very different. I installed a standard TYPO3 for this 3 versions, added only a login form and measure the response times.

TYPO3 version Action Response time in ms Times slower compared to TYPO3 7.6
7.6 Frontend user login 185
10.4 Frontend user login 759 4.1
11.1 Frontend user login 802 4.3
7.6 Frontend user logout 26
10.4 Frontend user logout 185 7.2
11.1 Frontend user logout 187 7.3

All actions were run 5 times in a row and the average was calculated.

Questions

  • How I can understand this behaviour? From PHP side I have 30% more speed but TYPO3 gets everything and need even more resources for the same operation.
  • What are my options to speedup TYPO3 10.4 or 11.1?
  • Are there configuration options in TYPO3 and/or PHP settings to get better performance?

Thank you very much for every tip or hint.

UPDATE

This is the setup and the description of the exact measurement.

TYPO3 7.6.32

Software versions

Ubuntu 18.04 / Apache 2.4.29 / MariaDB 10.1.44 / PHP 7.0.33

Core PHP settings

max_execution_time: 240  
max_input_time: 60  
max_input_vars: 1500  
memory_limit: 512M  
xdebug: Off

Zend OPcache PHP settings

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

Zend OPcache Directive

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

Installation

composer create-project "typo3/cms-base-distribution:^7.6" my-new-project

Setup: Create empty page

Activate extensions
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 / scheduler / setup / sv / sys_note / t3editor / t3skin / tstemplate / typo3_console / viewpage

Settings

Configuration presets > Debug settings: Live  
All configurations: [FE][loginSecurityLevel] = normal

Setup

1. Update Setup of root TypoScript template

page = PAGE
page.100 < styles.content.get

2. Create Folder for fe_users

3. Create a Website usergroup

  • Group title: test

4. Create a website user

  • Username: test
  • Password: [password]
  • Groups: test

5. Add login form to home page

Measure response times

Use Postman to send requests to TYPO3.

Login

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

  • user: test
  • pass: [password]
  • pid: [feUserPid]
  • logintype: login

Logout

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

  • logintype: logout

TYPO3 10.4.15

Software versions

Ubuntu 18.04 / Apache 2.4.29 / MariaDB 10.3.22 / PHP 7.4.16

Core PHP settings

max_execution_time: 240  
max_input_time: 60  
max_input_vars: 1500  
memory_limit: 1024M  
xdebug: Off

Zend OPcache PHP settings

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

Zend OPcache Directive

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

Installation

composer create-project "typo3/cms-base-distribution:^10.4" my-new-project

Setup: Create empty page

Settings

Configuration presets > Debug settings: Live  
Feature Toggles > Felogin extbase: Off

Setup

1. Update Setup of root TypoScript template

page = PAGE
page.100 = CONTENT
page.100 {
    table = tt_content
    select {
        orderBy = sorting
        where = {#colPos}=0
    }
}

2. Create Folder for fe_users

3. Create a Website usergroup

  • Group title: test

4. Create a website user

  • Username: test
  • Password: [password]
  • Groups: test

5. Add login form to home page

Measure response times

Use Postman to send requests to TYPO3.

Login

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

  • user: test
  • pass: [password]
  • pid: [feUserPid]
  • logintype: login

Logout

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

  • logintype: logout

TYPO3 11.1.1

Software versions

Ubuntu 18.04 / Apache 2.4.29 / MariaDB 10.3.22 / PHP 7.4.15

Core PHP settings

max_execution_time: 240  
max_input_time: 60  
max_input_vars: 1500  
memory_limit: 1024M  
xdebug: Off

Zend OPcache PHP settings

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

Zend OPcache Directive

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

Installation

composer create-project "typo3/cms-base-distribution:^11" my-new-project

Setup: Create empty page

Settings

Configuration presets > Debug settings: Live

Setup

1. Update Setup of root TypoScript template

page = PAGE
page.100 = CONTENT
page.100 {
    table = tt_content
    select {
        orderBy = sorting
        where = {#colPos}=0
    }
}

2. Create Folder for fe_users

3. Create a Website usergroup

  • Group title: test

4. Create a website user

  • Username: test
  • Password: [password]
  • Groups: test

5. Add login form to home page

Measure response times

Use Postman to send requests to TYPO3.

Login

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

  • user: test
  • pass: [password]
  • pid: [feUserPid]
  • logintype: login

Logout

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

  • logintype: logout
1 Answers

These days I am struggling with the felogin extension for 10.4 as well.

3 Tips, all pure speculation, 1 year after you posted this:

  1. Deprecation logging
  2. PSR-14 events
  3. Admin-panel

Perhaps it is "Deprecation logging" that slows things down.
I notice that in your setup you have set

Felogin extbase: Off

And this indicates that you want the old behavior activated, and the older codebase used. However there are various (~10) locations in the 10.4 code that look like this:

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:

  1. There is also a new PSR-14 event-based replacement for Hooks and SLots. felogin dispatches several events. felogin emits quite a few events, depending on the action. https://docs.typo3.org/c/typo3/cms-felogin/11.5/en-us/Events/Index.html I don't know if this is active (because you explicitly decided to use the older codebase, and PSR-14 events code is new code)

  2. You can find out the time-consuming steps with the Admin Panel. Typoscript Tab, Settings Gear-Icon, "Display all times".

Related