Skip to content

High resource usage and possible crashing when bulk uploading media assets #24745

@derrickmehaffy

Description

@derrickmehaffy

Node Version

v22

NPM/Yarn/PNPM Version

Yarn v1

Strapi Version

5.x.x+

Operating System

Strapi Cloud

Database

Strapi Cloud

Javascript or Typescript

Typescript

Reproduction URL

N/A

Bug Description

When bulk uploading assets, it's possible to exhaust the application's resources (especially on Strapi Cloud with lower tier plans), this appears to be primarily caused by the following:

  • Bulk assets are uploaded all at once, for example if you upload 10 assets, all 10 of these upload requests are fired in parallel rather than batching or uploading one by one
  • Image optimization (breakpoint conversion via Sharp) also happens on all of these assets at the same time, with extremely large or high-res images this can quickly spike CPU usage to maximum and possibly causing some assets to fail uploading or even crash the application

Steps to Reproduce

  1. Create a small Strapi instance on Strapi Cloud (essential tier for example)
  2. Try to upload various amounts of assets at the same time (start with 5, 10, 15, 25, 50, ect)
  3. Vary the size (increase size as you go)
  4. Work with the Strapi Support team to monitor application resource usage during the test (if you don't have access to the backoffice to view it yourself)

Expected Behavior

Assets should have a configuration option to determine how they should be uploaded depending the application need (if we decide to batch bulk uploads). Else assets should be uploaded one at a time until the array of assets has finished.

Logs

Code Snippets

No response

Media

Example usage from one cloud user's application related to this (these rapid spikes are in relation to bulk file upload, confirmed by the user):

Image

Additional information

Related to TID: 4570

Possible duplicate issues related to this (thus converting it to a tracking issue):

Confirmation Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: EEIssues correlates to internal EE ticketflag: tracking issueSpecial issues used to combine multiple issues into oneissue: bugIssue reporting a bugseverity: highIf it breaks the basic use of the productsource: core:uploadSource is core/upload packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersversion: 5Issue is present in Strapi 5

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions