1

We are using Kadira to try to determine why our Meteor application is running slow at times. You can see in the picture that the find operation is fast while fetch took almost 7s. I know it's an open question but does any have an idea of what could be causing this?

enter image description here

Whiskey
  • 83
  • 1
  • 1
  • 5
  • i would start with the number of records and how the indeces are set up (if they are). – zim Mar 13 '17 at 16:14
  • can you post the code? – mutdmour Mar 13 '17 at 20:08
  • 1
    I am getting the exact same problem! Did you ever find a solution to track the slowdown with the fetches? – Rob Wilkinson Apr 17 '17 at 22:56
  • Also having this problem on completely normal methods being called. We're on Meteor Mongo package version 1.1.17 -- any luck @RobWilkinson ? – Eric T May 03 '17 at 20:33
  • Yes! @EricT I'm not sure if this was your error but check to ensure that you are not using `replicaset` in your mongo URI. Check this issue for more help: https://github.com/meteor/meteor/issues/8598 – Rob Wilkinson May 04 '17 at 17:54
  • also, are you using compose? – Rob Wilkinson May 04 '17 at 17:54
  • @RobWilkinson we're not using `replicaset` in our url :( -- and yes we're using compose. Any idea? – Eric T May 06 '17 at 18:28
  • I have the same issue. With just a few users all my queries and fetches run fast. As soon as I get 30+ users all my fetches slow way down. It seems like things shouldn't slow done this much with just 30 users. – evolross Jul 12 '17 at 05:18

1 Answers1

1

The find command will return a cursor, which is a pointer to objects in database while the fetch will return an array with all the objects directly to your browser.

It seems you are retrieving a lot of objects since 6 seconds is a lot of time. I will suggest you to check if you really need to fetch too many objects, since maybe the user will not see all the data in just one screen.

Maybe you have already the data in your local MongoDB, and you can query them by chunks. (Using the limit constraint in MongoDB).

Ruben
  • 816
  • 1
  • 8
  • 21
  • It's searching by _id and not finding any results, I think docsFetched: 0 means it didnt fearch anything. If I run the same query in mongoshell it's pretty fast – Whiskey Mar 15 '17 at 15:07