0

I just deployed my Meteor app onto a production server on Digital Ocean. I noticed that for about 7500 documents, it takes about 3-5 seconds to fully fetch the objects (selectively taking only 3 fields) and populate the autocomplete data. I believe it should rather be instantenous for such number of data, so I am curious how I can debug performance issues from here and optimize more. How should I go about debugging performance issues for a Meteor app? I tried seeing the network tab but nothing seems to take more than a second. I am not sure why it takes 3-5 seconds for the search bar with an autocomplete feature to get ready. After a close inspection, populating autocomplete fields is instantaneous, and the time until subscribe function's callback is called is about 3 to 5 seconds.

I've already looked into Kadira, but it reported that everything was complete within milliseconds, so I am confused.

possibly related: Meteor's subscription and sync are slow

After all, is 3-5 seconds for 7800 documents with 2 fields reasonable?

Community
  • 1
  • 1
Maximus S
  • 10,759
  • 19
  • 75
  • 154
  • I looked into kadira but it also reported that everything was complete within milliseconds, so I am confused. – Maximus S Apr 06 '15 at 05:55
  • 1
    I've added this comment into the question. It's good practice to put everything you've tried in the question. – dayuloli Apr 06 '15 at 05:58

1 Answers1

1

Let me tell you what's really happening here.

Kadira shows the time taken to fetch the data from the server and queue it to the network. So, 500 - 700 ms is reasonable for that.

So, this 3-5 ms latency is the network latency. That means the time taken to send data to the client via the network. It's quite okay for 7500+ documents even with three fields over DDP.

So, my suggestion is to do the search on the server and use something like Search Source for that.

With that, you'll get the only data required to the client. Which reduce the latency and saves the CPU of your app.

Arunoda Susiripala
  • 2,516
  • 1
  • 25
  • 30