2
votes

I have a Meteor app deployed with Passenger + Nginx (as follow) on AWS EC2 instance under Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-62-generic x86_64)

The problem is that it takes around 100% CPU usage permanently.

enter image description here

I've tried to switch to more powerful instance and even deployed a blank app instead of mine - still the same.

Any ideas where to dig? Thanks.

P.S.

var/log/nginx/error.log:

2017/02/08 08:04:20 [info] 18232#18232: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:71
[ 2017-02-08 08:04:20.4123 18239/7fe378ac0780 age/Wat/WatchdogMain.cpp:1281 ]: Starting Passenger watchdog...
[ 2017-02-08 08:04:20.4281 18242/7f7adea7b780 age/Cor/CoreMain.cpp:1070 ]: Starting Passenger core...
[ 2017-02-08 08:04:20.4282 18242/7f7adea7b780 age/Cor/CoreMain.cpp:245 ]: Passenger core running in multi-application mode.
[ 2017-02-08 08:04:20.4309 18242/7f7adea7b780 age/Cor/CoreMain.cpp:820 ]: Passenger core online, PID 18242
[ 2017-02-08 08:04:20.4511 18248/7fdc44af6780 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
[ 2017-02-08 08:04:20.4517 18248/7fdc44af6780 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 18248
[ 2017-02-08 08:04:22.7236 18242/7f7ade98c700 age/Cor/SecurityUpdateChecker.h:464 ]: Security update check: no update found (next check in 24 hours)

npm install output:

> [email protected] install /var/www/play/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-48` exists; testing
Binary is fine; exiting

> [email protected] install /var/www/play/bundle/programs/server
> node npm-rebuild.js

{
  "meteor-dev-bundle": "0.0.0",
  "npm": "3.10.10",
  "ares": "1.10.1-DEV",
  "http_parser": "2.7.0",
  "icu": "56.1",
  "modules": "48",
  "node": "6.9.5",
  "openssl": "1.0.2k",
  "uv": "1.9.1",
  "v8": "5.1.281.89",
  "zlib": "1.2.8"
}
[email protected] /var/www/play/bundle/programs/server
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├─┬ [email protected]
│ │   │ └── [email protected]
│ │   └─┬ [email protected]
│ │     ├── [email protected]
│ │     └─┬ [email protected]
│ │       └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   └── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
4
You can start by ssh'ing into the box, and running the top command to see which process is taking all the cpuMikkel
It's "Passenger NodeA". (screenshot added)Viktor
Any entries in the log files to give you a clue? Did the npm install work properly?Mikkel
nginx error log and npm install output added. By the way, in dev mode (without passenger+nginx) everything works fine.Viktor

4 Answers

1
votes

According to the Meteor deployment guide, you have to use specifically Node 4.6.2.

Depending on the version of Meteor you are using, you should install the proper version of node using the appropriate installation process for your platform.

  • Node 4.6.2 for Meteor 1.4.x
  • Node 0.10.43 for Meteor 1.3.x and earlier

If you use a mismatched version of Node when deploying your application, you will encounter errors!

Passenger docs also suggest a 4.x version of node.

It worked for me with node js v4.8.4. Now CPU rarely goes above 10%.

0
votes

Fixed it by reinstalling everything from the scratch. Still don't know what happend.

0
votes

It's happening again, approximately once per day: enter image description here

Wonder if there is some alternative for Passenger + Nginx?

0
votes

Node version as mentioned in above answers strictly matters. You can try installing nginx+ pm2. It works like charm. To know more about pm2 , I already answered here.

How to run built of Meteor's sample app via Node