| No Comments | No TrackBacks
Jeff Waugh talking about node.js. node.js is not a javascript file. Node is a javascript environment. You can get a command line when you just run ig, much like python. The mission for javascript is meant to be interesting.

According to the creator, 'To provide a purely evented non blocking infrastructure to script highly concurrent programs.'.

Jeff said asyncronous is important, by showing an example of bunnies and hamsters. He moved on to talk about how nginx and apache compare with memory usage against concurrent connections. Apache uses more threads for more connections, so uses more memory. The graph comparing requests per second with concurrent connections show's apache goes down compared to nginx as well.

Jeffs first experience with nginx was putting it in front of apache when working for Apparently javascript was originally designed to be a hosted scripting language, or embedded language, orways designed to be single threaded and based on an event loop. The event loop is just part of the language. Javascript makes event programming natural, it's just how you do it.

People are raving about node.js because it's built on top of some cool stuff like libev, libeio, c-ares (async dns library), http_parser (really fast http parser) and OpenSSL. Then the v8 javascript engine is bounded onto that via some slim C bindings. Ryan Dahl is the maintainer of node.js. Jeff said he is very quiet and humble.

In node.js the entire stack is evented. There is no tricky lurking exceptions. There are a couple of blocking calls that you don't have to use if you don't want to. CommonJS modules in the last few years has been part of what has made this easier. Also the browser performance war lead to v8, and hence a fast javascript engine.

node.js only really runs on x86, x86_64 and arm CPUs. v8 hasn't succesfully been ported to other places. The 0.2.x has crappy SSL/TLS support. There is an attempt at a windows port, but no one is really working too hard on it yet. v8 has a heap limit, at the moment 1.9Gb. But if you're using node.js for a glue service thing then you probably won't run into this.

There are alternatives for other languages. Like Twisted for Python, or EventMachine for Ruby, AnyEvent for Perl and NIO2 for Java.

No TrackBacks

TrackBack URL:

Leave a comment

About this Entry

This page contains a single entry by Geoff Crompton published on January 26, 2011 2:27 PM.

scaling programs was the previous entry in this blog.

systemd is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.



Powered by Movable Type 4.23-en