Meteor server is going down randomly

No, node version is correct.

That error looks like am issue on mongo side, you might have a very large collection and you are trying to create a very ineficient query.

You can try to add indexes to that collection, limit the results number, query it correctly, maybe you are not even doing a query just getting all docs.

@pmogollon I have added the indexes and I am limiting the records from subscription (server-side) too.
I am sorting my users on cDate.timeStamp: -1.
So I created an index:

db.users.createIndex( { 'cDate.timeStamp': 1 } );

I also have a filter which sort profileCompletionProgress by ascending and descending, so I added index:

db.users.createIndex( { 'profile.profileCompletionProgress': 1 } );

Is that the right way?

I’m not sure but why not update the node version to 8.x? His version 0.10.25 was released almost 5 years ago.

He told us here that he is running the app with meteor --port NNNN and that uses the meteor node version. If he is actually running with node 0.10.x he should update right now as you suggest.

@hassansardarlecodeur also it would be easier to help if you share some of the queries that might be triggering that issue.

Also clarify how are you running meteor, what is the actual node version your meteor app is running with, we would be able to help you a little more with extra info.

1 Like

@pmogollon Thanks for all the help.
My main node version is 0.10.25 which is installed on system.
Meteor app is using 8.11.4.
I am running my meteor application like this :
ROOT_URL=https://app.mysite.com meteor --settings settings.json --port 3000.

I am currently unable to deploy my application as a production because after migrating to Meteor 1.8, the mongodump command is not working anymore. I need to update the main system mongodb version to v4.0, but I am getting issues since I am using Ubuntu 15.10 and there is no installation guide on main mongodb website. I posted that issue on stackoverflow:

https://stackoverflow.com/questions/53889589/mongodb-4-failed-to-start-mongod-service-unit-mongod-service-not-found

Also I need to add that I have a proper idea of deploying Meteor app using custom deploying method.

Ok so updating node wont hurt, but I dont think thats the issue. Can you share the code where the queries might be having issues?

best post all publication function, it looks like there could be the issue

Ok i will provide all the subscription and code, but I can’t provide that publicly. Can i have your emails or some other source ?

  • I am thinking of updating some of the heavier code, currently on admin side,
  • I am showing all users list, 20 users per page, this data is coming from a subscription,
  • I want to shift that on Meteor.call install of subscription,
  • So on all users page, I will load the data from Meteor.call and I will take the subscription of those fields which need to be real-time or reactive.

How is that approach?

Having 32GB mem on the server does not necessarily mean node can use it.
Look for --max_old_space_size parameter.

@baris Yesterday I ran that command on my server main root:

export TOOL_NODE_FLAGS="–max_old_space_size=4096"

My issue still persists.

Is there any way to check what is the current value for TOOL_NODE_FLAGS ? Just to verify

I think it is NODE_OPTIONS instead of TOOL_NODE_FLAGS if you are running development mode.
Check how much memory node is using.
You can see all environment variables in process.env on the server.

A side note; if you have upgraded meteor from 32 bit version to 64 bit version without re-installing it still runs 32 bit and can use max 2GB memory.

Why are you running development mode on your server?

I am running my app in development mode currently. I am unable to run in a production mode because after migrating to Meteor 1.8, the mongodump command is not working anymore. I need to update the main system mongodb version to v4.0, but I am getting issues since I am using Ubuntu 15.10 and there is no installation guide on main mongodb website.

We were running into similar issues on a few servers recently, updating to Meteor 1.8.0.1 has fixed the issue. From the changelog:

The meteor-promise package has been updated to version 0.8.7, which includes a commit that should prevent memory leaks when excess fibers are discarded from the Fiber pool.

@thsowers My application is already on updated version i.e METEOR@1.8.0.1. Also how can I check what version of meteor-promise is used in my application?

you can find meteor packages versions here: .meteor/versions

@minhna & @thsowers Here is the version of promise from .meteor/versions file: promise@0.11.2

Did you check if it is running node 32 bit or 64 bit ?

@baris Can you guide me how to check that for a Meteor Development app?

I think it is process.arch