The Coder's Way

  • Portfolio
  • Résumé
  • Random
  • Archive
  • RSS
banner

TJ Holowaychuk: Cluster Live 0.0.1

Cluster Live 0.0.1

cluster-live is a plugin for the Cluster server manager written for node. Cluster is similar to Ruby’s “Unicorn”, however is extremely extensible via a simple plugin system.

Cluster is built with the Express web framework, Jade for templates, Stylus for CSS, and Socket.IO for communication.

Below is a screenshot of cluster-live in action. Each worker process is represented by its own smoothie chart, showing the active connections, total connections, and requests issued to the worker. Connections appear as theblue line, and requests as gray, however in the screenshot below a single connection was issued per simulated request.

full view

Administration

Currently the only administration task that can be performed from cluster-live is the spawning and removal of workers by pressing the plus or minus buttons in the top-right corner.

add or remove workers

Example

Using cluster, and cluster-live is extremely simple, first install the modules:

 $ npm install cluster cluster-live

Then initialize cluster with cluster(server), and use() the stats() plugin which produces the events that cluster-live uses for reporting, and then of course finally live() itself.

var http = require('http')
  , cluster = require('cluster')
  , live = require('cluster-live');

var server = http.createServer(function(req, res){
  res.end('Hello World');
});

cluster(server)
  .set('workers', 4)
  .use(cluster.stats({ connections: true, lightRequests: true }))
  .use(live())
  .listen(3000);

By default the cluster-live port is 8888, so fire up 3000 and 8888 in your browser to see it in action. See the readme for information changing the port, host, or TLS options.

Future

This plugin is still very much a work-in-progress, but it’s somewhat usable for now although optimizations are still required in order to provide sufficient performance. With minimal profiling it seems that smoothie is currently one of the largest benchmarks but it is something I will have to dig into deeper. It would be great to add some more administration capabilities, as well as more reporting, as many statistics are still currently left out.

More Information

  • cluster-live github repo
  • cluster github repo
  • cluster documentation

    • #nodejs
    • #cluster-live
    • #cluster
  • 2 years ago > tjholowaychuk
  • 43
  • Comments
  • Permalink
  • Share

43 Notes/ Hide

  1. newsrankstar likes this
  2. demetriusj reblogged this from tjholowaychuk and added:
    Cluster Live 0.0.1
  3. jackbox55 likes this
  4. thedeveloper reblogged this from tjholowaychuk and added:
    sexy admin panel...underlying node processes.
  5. jyorr likes this
  6. nodenerd likes this
  7. blogatom likes this
  8. rocketlabsdev likes this
  9. morgancraft likes this
  10. oivoodoo likes this
  11. tjholowaychuk posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →
Avatar In the hope of furthering my knowledge, I want to share my ideas and my passion for writing code and learn from all of you in return. In this blog, I plan to cover technologies I am working on including server and client side javascript, open source, cloud computing, design, the social web and more.

Find Me At:

  • @demetriusjoh on Twitter
  • Facebook Profile
  • Linkedin Profile
  • demetriusj on github

Twitter

loading tweets…

Following

  • RSS
  • Random
  • Archive
  • Mobile

© 2011 Demetrius Johnson.