| New HTTP Parser |
[Nov. 21st, 2009|04:45 pm] |
I've implemented a new HTTP/1.1 request and response parser by hand. (My previous parser was written with the help of Ragel.) It requires 124 bytes per HTTP connection, makes zero allocations, has no dependencies, is nearly optimal in its use of CPU instructions, interruptible on any character, has extensive tests, and is MIT licensed.
README
http_parser.h
http_parser.c
(Only one user at the moment: I've just merged it into Node.) |
|
|
| UC tuition |
[Nov. 19th, 2009|10:03 pm] |
http://www.nytimes.com/2009/11/20/education/20tuition.htmlThe University of California Board of Regents was expected to approve a plan on Thursday to raise undergraduate fees — the equivalent of tuition — 32 percent by next fall, to help make up for steep cuts in state funding.
[...]
Since the school year began, thousands of students have protested both the budget cuts and the proposal for higher fees, which would bring in-state tuition to more than $10,000 a year. On Wednesday 14 protesters, including 12 students, were arrested at U.C.L.A., for disrupting the meeting of the Regents Finance Committee, which was eventually closed to visitors. |
|
|
| Smart Vanpool |
[Oct. 25th, 2009|08:45 pm] |
Vans are energy efficent when filled with 6 people, more so than any form of rail or bus transportation. (link via easwaran.) It seems creating an intellgent network of vans could be a good means of public transport. There are many factors involved, but it is imaginable that such a vanpool could be made profitable for the operators (not require city subsidies) and affordable for average people (vastly cheaper than a private taxi). I imagine vans with drivers, routed by a UMTS-capable navigation system to drop and pick-up passengers. The passengers request pick-ups via a telephone operator or website. They give a destination, and are given various choices of pick-up location—the ones more convenient for the vans in rotation will cost less, off-route locations cost more, short wait-times are more expensive, longer wait-times are cheaper. Passengers can be made to make transfers to other vans going in their direction. Perhaps instructions are sent to the passenger via SMS ("Get out at the next stop, wait 5 minutes for van 45"). The implementation of this is difficult, but tractable. It's certainly not on the same order of cost as installing light-rail infrastructure. Probably, a smart-vanshare program could be implemented with several millions of dollars—which is nothing when compared to digging tunnels for subway systems. Furthermore, the software development is a one-time cost, the system can be extended to other cities by simply adding vans, drivers, and telephone operators. |
|
|
| nginx_http_push_module |
[Oct. 16th, 2009|01:52 pm] |
http://github.com/slact/nginx_http_push_module
Nginx HTTP push module - Turn nginx into a long-polling message queuing HTTP push server.
If you want a long-polling server but don't want to wait on idle connections
via upstream proxies or make your applications totally asynchronous, use
this module to have nginx accept and hold long-polling client connections.
Send responses to those clients by sending an HTTP request to a different
location. (I wish I had thought of this!) |
|
|
| Pro-Köln |
[Oct. 8th, 2009|09:56 pm] |
I forgot to post about our own local nazis. These posters were seen depressingly often in Cologne during the recent election:

"The Mayor AGAINST the Mosque!" "He's for you!"
 |
|
|
| yabm |
[Sep. 11th, 2009|04:58 pm] |
I made a little benchmark this morning with Facebook's new Tornado web server. (I am the only person who enjoys looking at response time histograms? I never see them elsewhere.)
 |
|
|
| Combined benchmark |
[Sep. 6th, 2009|06:03 pm] |
node v0.1.9 thin v1.2.1, ruby 1.8.7, em 0.12.8 v8cgi v0.6.0, apache 2.2.8 (Ubuntu) narwhal/Rhino d147c160f11fdfb7f3c0763acf352b2b0e2713f7
The setup is similar to the last two benchmarks.
The point I want to make with these benchmarks is that Node is on the same order of magnitude in speed as production systems like EventMachine/Thin. Furthermore that at least two of the other proposed javascript systems are not on that order.
I think more can be done to clean up these numbers for Node. I haven't tried to optimize anything much yet. ( Read more... ) |
|
|
| node vs v8cgi benchmark |
[Sep. 6th, 2009|04:08 pm] |
A simple benchmark between node.js v0.1.9 and v8cgi v0.6.0 (via the apache module, apache version 2.2.8 (Ubuntu)). I used ab -t 30 -g data.csv -c X for X=1 and X=2. ( Read more... ) |
|
|
| Devendra Banhart -- Dragonflys |
[Aug. 19th, 2009|03:20 pm] |
I don't owe me any money You don't owe me a thing When we drink beer Dragonflies appear Dragonflies appear |
|
|
| connect(2) |
[Aug. 12th, 2009|03:09 pm] |
Connecting a non-blocking socket is tricky . Here is the essential trick from connect(2):
EINPROGRESS
The socket is non-blocking and the connection cannot be completed immediately. It is possible
to select(2) or poll(2) for completion by selecting the socket for writing. After select(2)
indicates writability, use getsockopt(2) to read the SO_ERROR option at level SOL_SOCKET to
determine whether connect() completed successfully (SO_ERROR is zero) or unsuccessfully
(SO_ERROR is one of the usual error codes listed here, explaining the reason for the failure). |
|
|
| node v0.1.3 |
[Aug. 6th, 2009|02:23 pm] |
node.js development is coming along nicely!
I've just made the 10th release, v0.1.3. Fixing bugs, adding features. The project is still very rough—I think the average time-to-encountering-a-bug-after-first-compile is about 20 minutes. We've got a little IRC channel with 6 or 7 regulars and an usually active mailing list (which doubles as a bug tracking system). |
|
|
| non-blocking stdio hack |
[Aug. 3rd, 2009|11:43 am] |
http://s3.amazonaws.com/four.livejournal/20090803/nonblocking_stdio.tar.gz
The problem with stdout, stderr, and stdin is that they are necessarily
blocking when associated with a file. Like file descriptors for normal
files, they cannot be used with select() or poll().
If one does
my_program > /mnt/nfs_filesystem/output
even printf() system calls might block the entire process's execution.
This is bad for high performance servers which juggle many sockets and
must never block execution.
This function can help with that. Now STDOUT_FILENO, STDERR_FILENO, and
STDIN_FILENO can be used with select(). All are set non-blocking and will
act like pipe end-points (they are actually).
This is done by internally using a ring buffer, pipe, and child process
to pump data to the blocking file descriptor.
Compile with -pthreads. Call nonblocking_stdio() as quickly as possible
after your program starts. Expect strange behavior with using printf()
and friends--those are buffered and expect blocking file descriptors. |
|
|
| navigation |
| [ |
viewing |
| |
most recent entries |
] |
| [ |
go |
| |
earlier |
] |
| |
|
|