Home
ryah [entries|archive|friends|userinfo]
ryah

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

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.)
Link11 comments|Leave a comment

UC tuition [Nov. 19th, 2009|10:03 pm]
http://www.nytimes.com/2009/11/20/education/20tuition.html
The 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.
Link1 comment|Leave a comment

working on presentation [Nov. 1st, 2009|09:19 am]
[Tags|]



i hate beamer, but what else is there?
Link2 comments|Leave a comment

anvil shooting [Oct. 25th, 2009|11:10 pm]
Link4 comments|Leave a comment

Smart Vanpool [Oct. 25th, 2009|08:45 pm]
[Tags|]

Vans are energy efficent when filled with 6 people, more so than any form of rail or bus transportation. (link via [info]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.
Link4 comments|Leave a comment

nginx_http_push_module [Oct. 16th, 2009|01:52 pm]
[Tags|]

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!)
Link4 comments|Leave a comment

Pro-Köln [Oct. 8th, 2009|09:56 pm]
[Tags|]

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!"

Link1 comment|Leave a comment

Stop / Yes to Minaret Ban [Oct. 8th, 2009|09:50 pm]
[Tags|, ]




http://www.tagesschau.de/ausland/minarett102.html
http://www.minarette.ch/


previously
Link2 comments|Leave a comment

(no subject) [Sep. 19th, 2009|11:59 pm]
Nice benchmarks. Must copy. (Had no idea the TCP backlog had any effect.)
LinkLeave a comment

raphaeljs [Sep. 19th, 2009|03:15 pm]
[Tags|]

http://raphaeljs.com/
very impressive demos

i would love to write a nginx stats module which used this...
Link5 comments|Leave a comment

yabm [Sep. 11th, 2009|04:58 pm]
[Tags|]

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.)

Link8 comments|Leave a comment

Combined benchmark [Sep. 6th, 2009|06:03 pm]
[Tags|, ]

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... )
Link3 comments|Leave a comment

node vs v8cgi benchmark [Sep. 6th, 2009|04:08 pm]
[Tags|, ]

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... )
LinkLeave a comment

(no subject) [Sep. 5th, 2009|11:08 pm]
LinkLeave a comment

node vs narwhal benchmark [Sep. 5th, 2009|03:08 pm]
[Tags|, ]

A simple benchmark against two popular "Server-Side Javascript" programs: node.js v0.1.9 and Narwhal version d147c160f11fdfb7f3c0763acf352b2b0e2713f7 using the Rhino backend.
Read more... )
LinkLeave a comment

music / future [Aug. 31st, 2009|02:11 pm]
LinkLeave a comment

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
LinkLeave a comment

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).
LinkLeave a comment

node v0.1.3 [Aug. 6th, 2009|02:23 pm]
[Tags|, ]
[Current Mood | happy]

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).
LinkLeave a comment

non-blocking stdio hack [Aug. 3rd, 2009|11:43 am]
[Tags|]

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.
LinkLeave a comment

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

Advertisement