[Solved] Meteor call very slow

I have a performance issue,

to reproduce the problem,

  1. I made a new react meteor app using meteor version 1.8
  2. create 9 collections( collection a,b,c,d,e…) with 4000~10000 documents each and create api files like " export default a = new Mongo.Collections(‘a’) " for each collections
  3. Do Meteor.call(‘test’,(err,res)=>{ }) from the client and see how long it takes to finish the call
  4. On the server side Meteor.methods({
    return true
  5. At first it would not take long until the client test call finishes but if you
  6. import a from ‘./api/a’;
  7. Do meteor call again, it now would take some time… why?
  8. import more collections b,c,d,e~
  9. now the call would take very long time like upto 3~5minutes
  10. I am not publishing any data + server function should only return true but why is this slowing down my app?

am I doing something wrong??

Could you upload a sample to github, or provide a file here containing your sample project?

When you’re talking about creating a new project and creating 4k-10k documents within each of your 9 collections, the first thing coming to my mind in terms of performance is that you didn’t mention disabling the autopublish package. Here’s a link to a react tutorial with Meteor working with the removal of this package: https://www.meteor.com/tutorials/react/publish-and-subscribe

1 Like

I forgot about that!
This fixed my problem