Performance issue when managing big number of content entities

Created on 25 January 2023, over 1 year ago
Updated 11 August 2023, 11 months ago

Problem/Motivation

Timeout message when using a big number of Content entities blocks: "Fatal error: Maximum execution time of 30 seconds exceeded in /core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php on line 306".
Adding information: 5564 Content entities and 259 blocks where found by the module controller BlockUsageReportController.php.

Steps to reproduce

I'm not sure we could create so many content entities for a test as I'm using an existing website and it is a performance issue.

Proposed resolution

Please use a query or SQL instead of using \Drupal\Core\Entity\ContentEntityInterface loadMultiple() method as we only need
a few fields:

  • id
  • uuid
  • label
  • bundle

Maybe you should execute the same for blockStorage as some cases could generate the same timeout issue ? Im my case, 259 blocks is OK. Maybe some other websites would contain more blocks ?

πŸ› Bug report
Status

Fixed

Version

1.0

Component

User interface

Created by

πŸ‡«πŸ‡·France frondeau Nantes, FRANCE

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024