Why is my app so slow? I only have 6 users

I have a production meteor app for which there are only six users. For some reason, the app is super-slow. When I click on a certain link, it should subscribe to the data for that view, receive it, and render the view. This takes something like 10 seconds. I get that the data has to come all the way from a mongo DB that is hosted on compose.io, but sheesh, 10 seconds is forever. Why can’t I get my data in 50 ms like other apps?

Also, I development mode I cannot use the browser console effectively. I used to be able to query my minimongo collections in my browser console, but now nothing happens – the browser console just takes whatever I type into it and does nothing.

Pretty hard to tell just from your description. Do you have a link to the site? Or a dev version? Kadira is good for finding bottlenecks, but it sounds like you might be able to diagnose it even before getting into that…

1 Like

I was just typing pretty much exactly the same advice. Without (a lot) more info we can’t really give more than suggesting kadira.

You can do a few thing to narrow it down:

  • Create a simple server-side method that returns something, invoke it client-side and see how long it takes for the call to return.
  • Are you publishing a simple cursor, or is it anything more? (aggregation, multiple cursors, raw data)
  • How large is the dataset that gets published? Simple console.log() with the count() of the cursor should give you an idea if the amount of records.
  • etc.

I have the same problem too, but I am not sour to resolve.

I am using Kadira. What do I need to look at to diagnose my problem?

It’s a production app, so you could share the link to it here, so that we can at least see how complex it is.

Because for now, you don’t really help us to help you. We need some data on which we can build our guess on what’s at fault. We can’t do it just with “I have an app and it’s slow”.

From the look of it, you removed the insecure package.

Sorry, it’s a production app, but not for public visibility.

Yes, I have removed the insecure package. However, I am subscribing to the collections I am interested in querying.

Also, I switched to Firefox and the issues with the console not working correctly seem to have resolved. I guess Chrome’s dev tools is buggy for me.

Ok, I just dropped $50 and now I have the Kadira “startup plan” in addition to the free tier that I had before. Hopefully the dashboard will now start to show me some useful information so I can figure out why my app is so slow.

Don’t worry, Chrome’s dev tools are buggy for everyone by default.

Hi jononomo,

First you need to check some Pub/Sub traces to see why it’s slow.

  • Go to Kadira Dashboard -> Your App -> Dashboard -> Pub/Sub
  • Check the Response Time chart and click somewhere where the response time is high

It will show a histogram and a few links to show traces (light blue buttons below the histogram).

  • Click on one of those buttons and it will display a trace.
  • Check the trace to see where it’s spending too much time

Also read this article: Meteor Performance 101 - Response Time Bottlenecks

1 Like

I’ve also replied on Kadira Support with some answers with specific details. I suggest you to take the basics section of BulletProof Meteor, which covers many of the things you need.