You are viewing [info]four's journal

ryah [entries|archive|friends|userinfo]
ryah

[ website | tiny clouds ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

space-diving [Feb. 11th, 2012|12:57 am]


Welcome to the extreme sport of space-diving.
LinkLeave a comment

great stories [Jan. 3rd, 2011|08:53 pm]
ftp://download.intel.com/technology/itj/q12001/pdf/art_1.pdf
Link1 comment|Leave a comment

jürgen paape - so weit wie noch nie [Nov. 29th, 2010|05:29 pm]
[Tags|]

LinkLeave a comment

(no subject) [Nov. 17th, 2010|10:00 pm]
Probably you guys don't read my twitter, so I have to post these here. (I cry inside thinking about how livejournal is dieing.)

In version v0.3 of node there is a function stream.pipe which pipes one stream into another. So for example you can pipe a TCP socket to process.stdout.

Here are two examples:
  1. A telnet program

    #!/usr/bin/env node
    // telnet.js 80 google.com
    net = require('net');
    a = process.argv.slice(2);
    if (!a.length) {
      console.error("telnet.js port [ host=localhost ]");
      process.exit(1);
    }
    s = require('net').Stream();
    s.connect.apply(s, a);
    s.pipe(process.stdout);
    stdin = process.openStdin()
    stdin.pipe(s);
    s.on('end', function () {
      stdin.destroy();
    });

  2. An echo server (compacted for tweet-ability)

    require('net').Server(function (s) { s.pipe(s); }).listen(8000);
Link2 comments|Leave a comment

configure hack [Oct. 25th, 2010|06:38 pm]
I'm sure some reader will appreciate this:

http://github.com/ry/node/blob/43022eabf79f3fa736684ccb1273804cbb31db95/configure


(I'm sure I'm not the first to do this - know any other projects that do something similar?)
Link4 comments|Leave a comment

st louis [Oct. 16th, 2010|12:59 am]
Link2 comments|Leave a comment

When to GC [Oct. 9th, 2010|07:33 pm]
GC is a huge concern for Node. V8 "halts the world" while it walks the object graph and then compacts its heap; for a busy server this is bad - a full heap compaction can run for 30ms or more. V8's GC can run at anytime, but the API also allows you to notify it when you're idle -- suggesting better times to GC. Currently Node employs some contrived heuristics to decide when it's idle -- every five seconds a timeout fires which checks how often Node had gone around the event loop in the past second. If it's not so much, then it notifies V8 that it idle. This generally keeps the GC out of the way for 'hello world' web server benchmarks. However, for active long running programs this is potentially too coarse.

As with most servers, Node is greedily reading data and accepting connections from sockets. It tries to drain the kernel buffers every time it comes out of kqueue (or epoll, or poll, or select, ...). Likely, assuming we've drained buffers and no timeouts are immediately pending, the next time we hit kqueue we will be blocked for a while. It might be a win to block on kqueue and, in parallel, notify V8 that we're idle (in a different thread).



Also of note is a possible new V8 feature which uses multiple threads to mark the objects during GC. It might be helpful on large multicore servers.
LinkLeave a comment

popular projects on github [Sep. 27th, 2010|04:34 pm]
Link3 comments|Leave a comment

student loans pt 2 [Sep. 15th, 2010|10:15 pm]




from reddit
Link8 comments|Leave a comment

student loans [Sep. 10th, 2010|12:12 am]
Link6 comments|Leave a comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]