-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Performance slow? #4658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
When you do 4 includes, there are 4 additional queries done in the database hopefully run in parallel. Those values are still in an acceptable range for me. You could run an APM and identify the bottlenecks. Probably the DB call latency and JSON serialization / deserialization will be the most consuming element of your calls. |
Also, consider when doing you 'Parse.Query' you're issuing and HTTP reuqest to parse server, and not a direct call to the internals of parse-server so that overhead has to be considered. Can you please report the time you see with |
Ah, ok. I just didn't know what to expect. Enabling (Also, I really mean no offense, parse-server is a truly fantastic product, I just have no comparison values here, trying to find a baseline). |
Updates and reads are completely a different game :) Parse adds some overhead, schema validation, ACL, authentication etc.. all of that add a certain amount of overhead. As for the stability of the feature, it should be fine. But may not fit every workload as everything stays in memory on the same serverz |
That makes a lot of sense, thanks for the explanation! So basically the worst that can happen is that the server just consumes a lot more memory. I will watch the memory consumption then. |
Just remember to pass masterKey / sessionToken, also IIRC there are some edge cases with loggingIn cloud code (which should not be supported). |
Thank you, good to know. I made my client intentionally very dumb and rights limited, the only data manipulation is happening via cloud code calls that all need to run with masterKey internally since the database is completely locked down so I should be safe then. :) Since we are on the topic of performance optimizations, how big is the gain in using |
It would depend on your workload there may be a cost because of the failed cache lookups, that are slower than in memory. Redis is useful to cache your user’s session data and roles. Each authenticated call (with a session token) yield a lookup for the session, the user as well as the roles. As you see with our metrics, we use redis to cache it all, so it speeds up our calls. Redis is the last thing you want to put in as after it, there isn’t much more optimisations you can add to parse-server without custom code. Note that we also cache those in memory, so it’s only useful if you deploy multiple instances and don’t use session affinity at load balancer. Scaling parse-server follows the same best practices as scaling any nodejs / express apps. If you have multiple cores on your server, leverage them through node’s cluster first or the cli with the —cluster option etc... |
Thanks for the thorough answer! |
@flovilmart Thanks for the explanation. I wonder what happens when you deploy multiple parse servers behind a load balancer with Will the backend instance verify Or will it only lookup in the memory on the given backend instance? Can I still expect everything to work as expected? Meaning every sessionId passed in via either backend parse server instance still correctly validates against mongo every time a call is made? thanks, |
Yes, sessions will always be validated. In our case, we decided not to go with the direct access but to let internal cloud code calls reach another server, as it was the most optimal solution for our workload |
We are using AWS lambda functions and MongoDB Atlas with parse server. |
Hi!
I recently looked into my database performance and was wondering if my results are somewhat slow.
A single query.get(user.id) resolves in 20ms, which seems to be rather high,
regarding that the whole system and database is basically idling (indexes on _id are set).
There are only 8 users entries. It doesn't make a difference if I run it with a local
database/server or on AWS/MongoDBAtlas.
The performance for a query.get with 4 includes is about 40-50ms.
Is this the normal performance range to expect?
Steps to reproduce
Expected Results
< 1ms
Actual Outcome
around 20ms
Environment Setup
Server
Database
The text was updated successfully, but these errors were encountered: