Meteor up with 97% CPU usage on production. I'm in panic mode


#1

Hi everybody,

I’m in panic mode, my application all suddenly became very slow and the process of meteorup is running very close to 100%…

I’ve already tried to restart the application through mup restart but still the CPU levels are very high.

What do you suggest me to do? Any temporary fix that could enable me to make the application start to work and give me time to debug the issue?

I’m running under ubuntu machine on AWS if this can help…

Thanks a lot!

Edit: some more infos


#2

Start a new ec2 server so you can see whether the issue is app or configuration based.
Install Kadira.
If you have something like Google analytics check your statistics. Do you have many users? Are you aware of that?


#3

Thanks for the reply, according to Google analytics seems like there are no users connected, but still the cpu is 99%.

I don’t know if I could just stop the meteor up process on the server and then restart it again, but I’m afraid to mess up something since is production enviroment :confused:


#4

If there are no users connected, just restart the server and see what happens.


#5

That scares me. I didn’t set up the server and I’m afraid that if I do so, at the restart something might not work again.
Is there something that you suggest me to do before restarting the server?

I’m currently running Meteor, Elasticsearch, Mongo, Kibana and Nginx. Should this services start automatically at the reboot?

:disappointed_relieved:


#6

Then, try to find your sysadmin…[quote=“xunga, post:5, topic:29230”]
I’m currently running Meteor, Elasticsearch, Mongo and Kibana. Should this services start automatically at the reboot?
[/quote]
It depends on your set up, so it’s difficult to say.


#7

Are you using oplog? Already had this problem (but with 0.9 at the time).


#8

I’ve tried to disable it, but as soon as meteorup process starts the cpu jumps back to 100% so I guess that’s not the problem… Thanks by the way :slight_smile:


#9

I was having the same kind of problem and solved it by revising my observables. Are you using any?


#10

Kadira has a nice CPU profiler which you can use to help debug things like this
https://kadira.io/academy/meteor-performance-101/content/meteor-cpu-profiling


#11

Try deleting Meteor and reinstalling it. We’ve seen this issue happen occasionally and this has solved it.


#12

Everything went back to normal :slight_smile:
Well not really sure what was wrong, I’m investigating deeper on what could have been wrong.


#13

Some things to check:

  • check your publications, do you use a lot of publish-composite or similar? Do they often invalidate?
  • do you publish huge amounts of data that are not indexed? --> add good indexes to your collections
  • do you have hooks on your collection or use collection.observe on the server that invoke “expensive” computations? (aggregation or so)
  • what is the state of the memory? is it full? --> maybe a leak. Full memory can also lead to high-cpu usage
  • maybe also list the packages that you are using

#14

Don’t know if this will help you, but I had something similar at Digital Ocean. My website crashed every 2.5 days with a CPU going over 100%. No errors, no apparent reason. In the end I tried a more expensive package, with more RAM. So far, so good, the problem did not occur for more than 4 days now.


#15

@cskaandorp’s comment reminded me of this:

May be worth investigating.


#16

Exact the same issue here!

I have 8gb of RAM :confused: , but are you sure that’s the solution? I’m afraid that It might bite you back in the future :confused:


#17

Thanks! I will have a look into it :slight_smile: I will keep this post updated…


#18

I’ve profiled the CPU with Kadira and I think my problem probably could be related to aldeed:simple-schema

Stay tuned :'D


#19

I don’t know for sure. So far so good. I kind of regret my decision to do it in Meteor anyway and I am tired of finding solutions for all kinds of problems. The 1(!)Gb package that I have right now can be cancelled at any time, so as soon as I get the same problem, I ditch it. I feel your pain! Good luck man.


#20

Yikes, if aldeed:simple-schema is causing those problems, I’m screwed. I use that for my application.