How to debug long response delay of a parse server

I see some extreme long response delay in my parse server (50% at 300ms while 99% at 3s, extremes are like 10s). I want to know what causes this and hopefully fixes it. Is profiling tools such s NewRelic able to help me?

I know the first thing should be checking mongodb indexes. I’m use Atlas for hosting and its UI always says there is No index suggestions for now. And the Profiler from Atlas UI shows the slowest operation is only 2s. It doesn’t explain the 10s response time of my parse server.

Thanks for any suggestions.

I believe you first need to identify what are the requests that take this time. Cloud code functions, queries, pushes, jobs? And then try to optimize, if possible.

@davimacedo thanks and yes. The problem is how to identify those requests (identify the queries). Is there any suggestions on tools for doing this?

It’s all queries. I don’t use cloud code. I only use the JS SDK to interact with the parse server. I also know it is hard to reproduce. For example, when I see a specific API call took very long, I would call it again. But this time, it is super fast ( 10s vs 0.5s).

How is your deployment scenario? I believe the appropriate tool depends on your deployment. Anyways, you should at least have a log of all your requests somewhere and you can start looking at those logs. Depending on how you are deploying Parse Server you may already have those logs.