Live data from Hacker News

Why HN was slow and how Rtm fixed it

ycombinator.com

111–120 of 202 posts

Re: Why HN was slow and how Rtm fixed it

#111
post #77

Earlier quoted context omitted.

Feel free to fork MzScheme and replace the garbage collector with a new one that runs continuously.

Do you ever question the choice of MzScheme?

It had to be some dialect of Lisp with continuations, which meant Scheme, and MzScheme seemed the best. Our first version ran on Scheme48, but that was such a pain that we switched.

Re: Why HN was slow and how Rtm fixed it

#112
post #92
post #21

Earlier quoted context omitted.

That's not the bottleneck. Essentially there's an in-memory database (known as hash tables). Stuff is lazily loaded off disk into memory, but most of the frequently needed stuff is loaded once at startup. The bottleneck is the amount of garbage created by generating pages. IIRC there is some horrible inefficiency involving UTF-8 characters.

Are you using any sort of in-memory fragment caching? That seems like it might reduce some render overhead.

A great deal, and it does.

Re: Why HN was slow and how Rtm fixed it

#114

"In 7 seconds, a hundred or more connections accumulate. So the server ends up with hundreds of threads, most of them probably waiting for input (waiting for the HTTP request). MzScheme can be inefficient when there are 100s of threads waiting for input -- when it wants to find a thread to run, it asks the O/S kernel about each socket in turn to see if any input is ready, and that's a lot of asking per thread switch…

Exactly this.

Re: Why HN was slow and how Rtm fixed it

#115

"In 7 seconds, a hundred or more connections accumulate. So the server ends up with hundreds of threads, most of them probably waiting for input (waiting for the HTTP request). MzScheme can be inefficient when there are 100s of threads waiting for input -- when it wants to find a thread to run, it asks the O/S kernel about each socket in turn to see if any input is ready, and that's a lot of asking per thread switch…

Or I don't know, use continuations in a place that's actually appropriate? John Fremlin showed that even with horrible CPS rewriting and epoll you can get way better throughput in SBCL (TPD2) than nginx. MzScheme comes with native continuations. It's not hard to call out to epoll.

Instead everyone in the Lisp community (pg included) is still enamored with using continuations to produce ugly URLs and unmaintainable web applications.

Re: Why HN was slow and how Rtm fixed it

#116
post #108
post #93

Earlier quoted context omitted.

Surely there's a way to target the JVM? I'd trust my life on the JVM, it's pretty battle tested, and the GC is simply awesome.

> I'd trust my life on the JVM You sure you want to do that? :-) > Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons system…

Yeah I'd trust my life on it. I've had java processes running for several months without issue. The hardware fails before the jvm does.

I wouldn't trust anything from microsoft though.

Re: Why HN was slow and how Rtm fixed it

#117
post #100

I find it disturbing to see people asking "Who is Rtm?" "Who is filo?" I understand if you are in tech you might not know figures in history or literature... but these guys? Every time you login to a UNIX/Linux system you use the passwd file and related setup - authored at least in part by Rtm's father. http://www.manpages.info/freebsd/passwd.1.html Rtm has done lots in his own right as the wikipdia pages show. But s…

It's really nothing to get excited about. There are so many important programmers in the world that noone will remember them all. Not everyone works in the area where those people will mean anything more than a credit line in some tool they use... and that's fine.

I work with VoIP daily and could name lots of people who you "really should" know - you're using a phone all the time after all. Or people who create amazing stuff right now. But no... actually I don't expect that. Everyone has their own area of interest. I appreciate that someone wrote `cat` or one hundreds of other nice utilities, but I'm not going to read their history unless I've got a lot of free time and want to do that.

Re: Why HN was slow and how Rtm fixed it

#118
post #6

I worked at a startup once that made a network card that did this type of buffering (wait for whole HTTP requests, then forward as a lump to the host, across a local fast bus). Pretty whizzy, definitely helped server scaling. We started shipping in 2001; the dot-com bust more or less canceled any interest in the product, and canceled the company, too . . .

related but a little different (just FYI): some Intel nics can handle interrupt modulation. Decreased latency but wouldn't fix the open handle/scaling issues here.

Re: Why HN was slow and how Rtm fixed it

#119
post #74

Or you can put a reverse proxy in front. http://joshua.schachter.org/2008/01/proxy.html (Like I suggested in 2009...)

BTW, you suggest pound for the slow client problem, but according to this email it doesn't help for that.

http://www.apsis.ch/pound/pound_list/archive/2010/2010-11/12...

Re: Why HN was slow and how Rtm fixed it

#120
post #119
post #74

Or you can put a reverse proxy in front. http://joshua.schachter.org/2008/01/proxy.html (Like I suggested in 2009...)

BTW, you suggest pound for the slow client problem, but according to this email it doesn't help for that. http://www.apsis.ch/pound/pound_list/archive/2010/2010-11/12...

Pound helped this problem for delicious in 2005, and by the time I wrote this article it was starting to not be the right answer. In 2011, it's definitely wrong :)
Post reply on HN