Skip to content

Strapi REST API responses are very slow if populate=* is used #13288

@komape

Description

@komape

Bug report

Required System information

  • Node.js version: v16.13.0
  • NPM version: 8.8.0
  • Strapi version: v4.1.9
  • Database: SQLite
  • Operating system: macOS v12.3.1

Describe the bug

Requesting the first page with a page size of 10 and an overall count of around 3500 elements takes nearly 20 seconds if I add populate=* to the query params. Without it takes 20 to 30ms (Strapi runs locally). The elements contain images and some component elements. Is it normal that it takes so much more time? No filters or similar are used...

Steps to reproduce the behavior

  1. Request http(s)://$HOST/api/$COLLECTION?populate=*&pagination[pageSize]=10&pagination[page]=2
  2. Request http(s)://$HOST/api/$COLLECTION?pagination[pageSize]=10&pagination[page]=2

Expected behavior

Using populate=* should not take nearly 20 seconds if it takes 20ms without.

Screenshots

n/a

Code snippets

n/a

Additional context

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions