Skip to content

Performance issue on version 4.x #7404

Open
@saulogt

Description

@saulogt

New Issue Checklist

Issue Description

Parse server 4.5.0 is up to four times slower than version 3.10.0. That prevents me from upgrading parse-server in a production app. Other than the performance issues, there are random errors logged in the console that does not happen with the version 3.x

Steps to reproduce

I created a repo to prove my point: https://github.com/saulogt/test-parse-server4

  • Clone this repo (https://github.com/saulogt/test-parse-server4)
  • $ npm i
  • Run node ./tester.js create once to create the collections
  • Run the test with version 3.10.0
  • $ node ./tester.js
  • Save metrics
  • npm i parse-server@4.5.0
    -Run the test again with version 4.5
  • $ node ./tester.js
  • Compare results

Actual Outcome

  • parse-server@3.10.0
Created 300 accounts in parallel through cloud function (Installation + User + Account)
accounts: 6.773s
Created 400 myObjects in parallel
objectsP: 658.257ms
Created 400 myObjects in sequence
objectsS: 1.320s
  • parse-server@4.5.0
Created 300 accounts in parallel through cloud function (Installation + User + Account)
accounts: 19.303s
Created 400 myObjects in parallel
objectsP: 7.482s
Created 400 myObjects in sequence
objectsS: 4.174s

The second run (4.5.0) also logs these errors in the console:

error: Uncaught internal server error. {"stack":"Error"}
error: Uncaught internal server error. {"stack":"Error"}
error: Uncaught internal server error. {"stack":"Error"}
error: Uncaught internal server error. {"stack":"Error"}
[Error]
[Error]
[Error]
[Error]
[Error]
[Error]

These errors disappear if I reduce the number of parallel accounts creation from 300 to 10 https://github.com/saulogt/test-parse-server4/blob/master/tester.js#L74

Expected Outcome

Similar performance when compared with version 3.x and no errors

Failing Test Case / Pull Request

  • 🤩 I submitted a PR with a fix and a test case.
  • 🧐 I submitted a PR with a failing test case.

Environment

Server

  • Parse Server version: 4.5.0
  • Operating system: MacOS 11.3.1
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local also happens on Heroku

Database

  • System (MongoDB or Postgres): mongodb
  • Database version: 4.4.6
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local and MongoDB Atlas

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Javascript
  • SDK version: 2.19.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions