parse-community / parse-community/parse-server

Performance issue on version 4.x

Open
#7,404 20 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction repository's tester.js and run the documented commands against parse-server@3.10.0 and 4.5.0 using MongoDB. Compare the timing metrics and capture the errors produced during 300 parallel account creations. Done means identifying and fixing the regression so performance is comparable to 3.x and the errors no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, nodejs
Domain
backend, databases, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.