Wednesday, January 19, 2011

node.js production environment #63

I pulled out the "production/" scripts from the WIN and rebuilt it as simplenode. Basically, simplenode is a very simple init.d script and a forever loop that enables
  • per restart logging (can fill up server)
  • crash throttling (5 seconds)
  • restart on reboot
All of this takes place /var/nodejs

Now, I'm thinking about making a patch for node.js makefile such that it will install everything it needs into /var/nodejs so I can chroot it. Has anyone else done this?

Places to improve:

As of now, I'm logging everything so if I dump too much diagnostic information, then I'm going to get screwed later on. This is fine for now, but eventually, I'll need either to delete logs, truncate logs, or export logs to S3... This gives me an interesting idea for a service, ;)

The five seconds is arbitrary, but I need a way to detect if the script is in a "bad place" and the state is corrupt. I've had this problem with using the file-system since a crash botched up the state, and I didn't respond in time and the forever loop was making the entire system crawl.

No comments:

Post a Comment