Picture of Marek Zapach
Adapt Builder crashing regularly
by Marek Zapach - Tuesday, 26 May 2015, 8:22 AM
 

Hi, we're running Adapt Builder v0.1 on AWS Linux machine and despite troublesome installation process we've managed to get it up and running and are using it for few months now. However almost on daily basis I have to start node server as Builder is regularly down/unavailable. I have even downgraded Node.js version from 0.10.38 to 0.10.33 as recommended but no improvement. 

There seems to be no obvious reason/action for crashing. We thought first it was related to incomplete courses (empty component or block) and preview/publish action but it often goes down overnight when we don't use it at all.

I tried to collect node.js logs by launching it like "node server > adaptlog.log" but no relevant info as once node crashes log dies too.

The tool works very well and we are happy learning it however it's very frustrating when we have to restart it almost daily. Any guidance/advise is much appreciated!

Picture of Dennis Heaney
Re: Adapt Builder crashing regularly
by Dennis Heaney - Tuesday, 26 May 2015, 4:42 PM
 

Hi Marek,

Is there any other relevant information you can provide that might help us track this down for you? Useful information might include:

  • What Linux distribution and version are you using?
  • How many users are interacting with the tool simultaneously?
  • Is there any activity that seems to cause the tool to crash most often?
  • Is there a disk space limitation on the amazon node?
  • What are the technical specifications for the Amazon node (number of vCPUs and size of Memory)?

At Learning Pool, we use a nifty little package called pm2 that helps keep our server alive through crashes, and keeps a good log of activity and errors. I recommend using it for a shared server. You can read more about setting it up here: https://www.digitalocean.com/community/tutorials/how-to-use-pm2-to-setup-a-node-js-production-environment-on-an-ubuntu-vps

 

Picture of Marek Zapach
Re: Adapt Builder crashing regularly
by Marek Zapach - Wednesday, 27 May 2015, 9:03 AM
 

Hi Dennis,

it runs on AWS's t1.micro instance on turnkey-lamp-13.0-wheezy-amd64.ebs AMI. It's currently only being used by 2 or 3 people. We first suspected preview/publish operations causing app to crash and it did previously but it was triggering javascript alert error message and not app crash. At some instances those issues were due to empty block or component added but not configured etc etc ... However the crashing is making app unavailable resulting in node process being dead.

Looking at t1.micro it says 0.613 GiB of RAM and 1 vCPU.

I will look at pm2 soon thanks. Does it mean you also were experiencing similar issue and installed pm2 then?

 

 

 

Picture of Dennis Heaney
Re: Adapt Builder crashing regularly
by Dennis Heaney - Wednesday, 27 May 2015, 10:33 AM
 

Hi Marek,

~600MiB of RAM might be a little low, I'll see if we can set up some tests. 

With regard to pm2 - we didn't experience similar issues before using it, but we researched best practices around deploying NodeJS applications in a production environment, and pm2 was consistently highlighted as the best process manager.

When running a NodeJS application, an uncaught exception has the potential to cause the application to crash. Since a NodeJS app is an "always running", single threaded process, once it crashes, you need to restart the process again. This is distinct from an error in a PHP web application, for example, where an exception in PHP may cause a shutdown, but will not usually cause the underlying server (e.g. Apache) to crash. This is why using something like pm2 or forever is recommended when running a node application in a Production environment.

Thanks,

Den

Picture of Marek Zapach
Re: Adapt Builder crashing regularly
by Marek Zapach - Thursday, 28 May 2015, 8:06 AM
 

Hi Den,

thanks for the useful information. I'll get pm2 installed and also look at testing Builder on better-spec machine. 

Thanks,
Marek