Hacker News new | past | comments | ask | show | jobs | submit login
A Gazillion-user Comet Server With libevent, Part 0 (aleccolocco.blogspot.com)
32 points by alecco on Oct 27, 2008 | hide | past | favorite | 8 comments



Ok, but part of what makes Erlang so interesting for this kind of stuff is that you can do long running tasks in the event handlers without locking up the system. Erlang will take care of scheduling it, so that other requests can keep coming in and getting handled, and processing power is divided up between the different Erlang 'processes'. Writing simple select/poll/event/whatever servers in C is obviously going to kick ass in terms of speed, but things become more problematic when you need to start doing some real processing.


We'll see... ;)


Obviously, anything is possible with C. Erlang is written in C, after all. You can break up processing into small steps that don't bog things down, and even formalize how you do so. But the difference is that in Erlang, that's taken care of for you.

(BTW, not that any of this takes away from your nice article - I voted it up because it's the kind of thing I'd like to see more of!)


libevent has wrappers to languages like perl, so this should be doable in a language that isn't brutally low-level. right?


Well, yes, but memory footprint will be higher and speed will decrease slightly. You will also want to leave all the protocol handling (HTTP etc) in C to prevent further slowing down.


Hey alecco, nice blog! I've been playing with a bit of libevent goodness myself, your code will be very helpful ;)


Thanks!


Great article, keep the series coming!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: