You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parse Server, specifically the storage adapters, are using event loop blocking iterations which can become an performance bottleneck when dealing with many objects.
The transformation from JSON to Parse object is therefore often expensive, because the way it is synchronously implemented blocks the Node.js event loop until the whole array has been iterated over. We have seen in issues in the past (as a side-discovery) that the object transformation is resource intensive with a long transaction time; the synchronous processing is likely the reason.
Example
Add Parse Server option that unblocks the event loop after 10 JSON objects haven transformed to Parse Objects:
{
objectProcessingBatchSize: 10,
}
Feature / Enhancement Description
Add a new Parse Server option that allows to specify the batch size in which such iterations should happen. This allows the event loop to process other pending tasks after a batch has been processed. A developer can define how long Parse Server should claim the event loop and therefore can fine-tune complex request processing speeds vs. avg. request processing speed.
Alternatives / Workarounds
The developer needs to reduce the amount of Parse objects being handled by Parse Server per request, e.g. use pagination parameters like limit, skip. This is important in any case for many reasons, but there may be times in which a large number of objects needs to be fetched, and the developer would need to implement pagination themselves, instead of Parse Server doing this OOTB.
The text was updated successfully, but these errors were encountered:
New Feature / Enhancement Checklist
Current Limitation
Parse Server, specifically the storage adapters, are using event loop blocking iterations which can become an performance bottleneck when dealing with many objects.
For example:
parse-server/src/Adapters/Storage/Mongo/MongoStorageAdapter.js
Line 656 in c9b5971
The transformation from JSON to Parse object is therefore often expensive, because the way it is synchronously implemented blocks the Node.js event loop until the whole array has been iterated over. We have seen in issues in the past (as a side-discovery) that the object transformation is resource intensive with a long transaction time; the synchronous processing is likely the reason.
Example
Add Parse Server option that unblocks the event loop after 10 JSON objects haven transformed to Parse Objects:
Feature / Enhancement Description
Add a new Parse Server option that allows to specify the batch size in which such iterations should happen. This allows the event loop to process other pending tasks after a batch has been processed. A developer can define how long Parse Server should claim the event loop and therefore can fine-tune complex request processing speeds vs. avg. request processing speed.
Alternatives / Workarounds
The developer needs to reduce the amount of Parse objects being handled by Parse Server per request, e.g. use pagination parameters like
limit
,skip
. This is important in any case for many reasons, but there may be times in which a large number of objects needs to be fetched, and the developer would need to implement pagination themselves, instead of Parse Server doing this OOTB.The text was updated successfully, but these errors were encountered: