After trying to update parse server to 4.x in production I notice a very slow response time. So I created this simple test to reproduce the problem found.
$ npm install -g mongodb-runner
$ mongodb-runner start
- Clone this repo
- $ 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 [email protected]
- Run the test again with version 4.5
- $ node ./tester.js
- Compare results
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
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
Why these errors only appear in Parse server 4.5? They disappear if I reduce the number of parallel accounts creation
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]
Why creating objects in parallel now takes longer?