Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Re: [RFC] Outline of the fast HTTP talk



Curt Sampson <cjs@example.com> writes:
> On 2008-11-03 11:16 +0000 (Mon), John Fremlin wrote:
[...]
>> The objective of the test is to show how fast a very simple dynamic page
>> can be, without worrying about databases.
>
> That sounds like an excellent simple benchmark for that sort of thing.
>
> Can I just send you a tar file of a qam project that you can unpack?

Sure

[...]
> As well: we gave up on ab quite a while ago, and use httperf[1] for
> benchmarking. 

Why?

[...]
> Httperf does have one unfortunate, and fairly major, issue: it uses
> select(). Given that it's oriented around the idea of maintaining a
> certain number of requests per second, regardless of how long it takes
> to receive a response, this usually results in it running out of file
> descriptors long before it's generated the kind of load a modern machine
> is capable of generating.

Which is why it is useless for this. . .

The only HTTP client (apart from apachebench) that I have ever seen
achieve a decent request throughput was one I made.

I get about 2k requests per second on one core of my laptop with the
following mongrel script (any mongrels users please comment on stuff I
could do better).

Are you in that ballpark? 



require 'mongrel'
require 'cgi'

class SimpleHandler < Mongrel::HttpHandler
  def process(request, response)
    response.start(200) do |head,out|
      head["Content-Type"] = "text/html"
      name = CGI::escapeHTML
        (CGI::parse(request.params['QUERY_STRING'])
         ['name'].to_s)
      out.write("<h1>Hello #{name}</h1>")
    end
  end
end

h = Mongrel::HttpServer.new("0.0.0.0", "3000")
h.register("/", SimpleHandler.new)
h.run.join


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links