Disconnect server when multi users login and generate report at the same time!

I tried to deploy my project to localhost server (Ubuntu, Nginx, Mongo).
But I have problem when multi users login and generate the report at the same time Sever Disconnect.
Please help me.

It sounds like your app server is crashing under the load. You might have to set up another server as a microservice to generate reports if that’s a heavy task. From the sounds, it could also be good to use a task queue so that the tasks aren’t run concurrently. Of course, this will mean users have to wait awhile to get their reports …

https://atmospherejs.com/?q=queue
I haven’t used it myself, but I’ve heard good things about vsivsi:job-collection.

Also see:
https://bulletproofmeteor.com/architecture/microservices-with-meteor-and-ddp
http://justmeteor.com/blog/microservices-with-meteor/

Thanks for your reply, I will try…

Excuse me, It have problem with Meteor App or Mongodb.

It’s hard to know without seeing the code that generates the reports but, from the symptoms you’re describing, I’d guess the app is using all the server CPU and then crashing.

Don’t use all the server CPU.
I use Dell 990 (i5, Ram 8 G).
In Order Collection ~ 250 000 records.

Ah … that’s a lot of records. Are they large documents? I’d imagine there are several good ways to crash a server by mishandling those records in server code - e.g. doing a query that pulls all (or many) of those records (in their entirety), then iterating over them with a .map function or something that does something mildly cpu or memory intensive.

Are you using Kadira? That might give you some insights into what’s going wrong.

My project is Point Of Sale System, so it is large document.
Before I used to use Laravel PHP Framework & MySQL, but don’t have problem for the same data store.
I am a newbie with Meteor & Mongo.
I tried to use Kadira, but don’t have problem with CPU, Memory, Pub/Sub.

Well … I’m all out of ideas.

You’ll probably need to post the relevant bit of code to get any real help with this.

Thanks for your helping, I will check my code again.
Could you help to check me, so I will push it to github?

If you put a link to a public repo, someone with a kind heart and some spare time might do a review and make suggestions.

1 Like