News for hackers. Stuff that matters.
Re:Really Slow Site for Testing HTTP Caches. by chaosmachine on Saturday October 23, 2010 @06:39PM (#1824557)
http://reallyslowsite.com/-1

Apparently time travel is out of the question.

Re:Really Slow Site for Testing HTTP Caches. by StavrosK on Saturday October 23, 2010 @06:59PM (#1824588)
http://cache.historious.net/cached/662705/

Your site just revealed a bug in historious, thank you!

Re:Really Slow Site for Testing HTTP Caches. by edanm on Saturday October 23, 2010 @06:37PM (#1824552)
Nice.

The "copyright" line is really tiny. Your twitter usernames are there, and I assume you want people to see them, so I'd make it larger.

Re:Really Slow Site for Testing HTTP Caches. by carbocation on Saturday October 23, 2010 @07:05PM (#1824601)
I rarely notice copyright lines. The fact that you did makes me suspect that they succeeded.
Re:Really Slow Site for Testing HTTP Caches. by StavrosK on Saturday October 23, 2010 @08:17PM (#1824751)
In his defense, the page is three lines long, one of which is the copyright line.
Re:Really Slow Site for Testing HTTP Caches. by carbocation on Saturday October 23, 2010 @08:43PM (#1824800)
If it's important to them, perhaps they could... A/B test this? :-)
Re:Really Slow Site for Testing HTTP Caches. by StavrosK on Saturday October 23, 2010 @10:12PM (#1824970)
Perhaps after reading two relevant articles :P I just posted a third, http://news.ycombinator.com/item?id=1824959, but not on the same series.
Re:Really Slow Site for Testing HTTP Caches. by mnutt on Saturday October 23, 2010 @10:19PM (#1824983)
This is one of the things that node.js is really good at, and it's interesting that the sample code on the front page of nodejs.org was pretty similar to this app. Here's the rough equivalent in node:

  require('http').createServer(function (request, response) {
    response.writeHead(200, {'Content-Type': 'text/plain'});
    var time = Math.max(0, Math.min(60000, parseInt(request.url.slice(1)) || 0));
    setTimeout(function() { 
      response.end('This page load took ' + time + 'ms\n'); 
    }, time);
  }).listen(8124);
(They have since changed it, and I suspect that it was because new users were confused as to why their supposedly "fast" server always took 2 seconds to respond to requests)

(edit: code formatting)

Re:Really Slow Site for Testing HTTP Caches. by vog on Sunday October 24, 2010 @04:35AM (#1825653)
> This is one of the things that node.js is really good at

Why does every simple task motivate people to show some kind of "hello world" code in their favorite language and framework?

This web service is just a tiny exercise that is easily realized with a few lines in any language (even C or Bash) using any web server. In particular, I don't see in how far this code demonstrates the strengths of node.js.

Re:Really Slow Site for Testing HTTP Caches. by mnutt on Sunday October 24, 2010 @03:01PM (#1826898)
Perhaps because, though Sinatra is actually one of my favorite frameworks, it doesn't work very well for this. The author comments that it's limited to 10 seconds because each connection is handled by a blocking Thin. Eventmachine could also solve this problem, in a similar amount of code.

And I was just pointing out that this happened to be the official hello world for node.js.

Re:Really Slow Site for Testing HTTP Caches. by 0x44 on Monday October 25, 2010 @05:53AM (#1829172)
shmeedog wrote a server in eventlet that solves the blocking thin problem.
Re:Really Slow Site for Testing HTTP Caches. by 0x44 on Sunday October 24, 2010 @05:11AM (#1825702)
Amusingly, my involvement came from showing shmeedog how nice his service would look in Sinatra versus WSGI.
Re:Really Slow Site for Testing HTTP Caches. by 0x44 on Saturday October 23, 2010 @05:30PM (#1824409)
Whoops, the original implementation used microseconds it now uses seconds (with a max of ten).
Re:Really Slow Site for Testing HTTP Caches. by sathyabhat on Saturday October 23, 2010 @07:51PM (#1824687)
Maximum's 10 seconds?
Re:Really Slow Site for Testing HTTP Caches. by 0x44 on Saturday October 23, 2010 @07:56PM (#1824696)
Yes, there are a limited number of thin processes running on the server and they block (making them non-blocking is work for another day). The code's on github, if you need a longer delay feel free to fork: http://github.com/rconradharris/reallyslowsite.com
Re:Really Slow Site for Testing HTTP Caches. by atuladhar on Saturday October 23, 2010 @08:51PM (#1824824)
http://github.com/rconradharris/reallyslowsite.com/blob/mast...

One of the "slower than" expressions has an unnecessary "than."

Re:Really Slow Site for Testing HTTP Caches. by shmeedogg on Saturday October 23, 2010 @09:25PM (#1824890)
Fixed, thanks!
Re:Really Slow Site for Testing HTTP Caches. by jrockway on Saturday October 23, 2010 @08:56PM (#1824830)
This site is slow :)

I don't know Ruby, but how does this work:

    get '/', :agent => /curl/ do
      (slow_thing, time) = slow_down(DEFAULT_SLEEP)
      "SLOWER THAN #{slow_ting}. Putting the brakes on for #{time} seconds.\n"
    end
It binds slow_thing and then references it as slow_ting (without the h) in the interpolation? What?

It appears twice so it must be intentional?

Re:Really Slow Site for Testing HTTP Caches. by shmeedogg on Saturday October 23, 2010 @09:05PM (#1824851)
Oops, that's a typo in code that hasn't been deployed yet. Our regression suite missed it ;-)
Re:Really Slow Site for Testing HTTP Caches. by jrockway on Saturday October 23, 2010 @09:42PM (#1824922)
Ah, makes sense, you just get the empty string instead of "turtles marching through peanut butter".

I am used to Perl where your code won't compile if you reference an undefined variable in a string interpolation.

Re:Really Slow Site for Testing HTTP Caches. by bjonathan on Saturday October 23, 2010 @07:47PM (#1824681)
Hello, I have no doubt that this tool is really usefull. But as a non techie I dont understand the purpose. Can somebody explain me or refer me to an article that can explain why test HTTP caches and what is it?
Re:Really Slow Site for Testing HTTP Caches. by shmeedogg on Saturday October 23, 2010 @08:32PM (#1824778)
reallyslowsite.com is designed to be a tool that developers can use to simulate how their application responds to expensive HTTP requests.

You could use this, for example, to test that your mobile application is properly caching HTTP requests (it would be noticeably slower, even with a fast connection, because the request is guaranteed to take at least 2 seconds).

The specific use case I had in mind when I created it was testing the HTTP caching that will be used internally by the OpenStack "glance" project.