
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] Re: [RFC] Outline of the fast HTTP talk
Edward Middleton <emiddleton@example.com> writes:
> Curt Sampson wrote:
>> On 2008-11-03 18:56 +0000 (Mon), John Fremlin wrote:
>>
>>> I get about 2k requests per second on one core of my laptop with the
>>> following mongrel script....
>>>
>>> Are you in that ballpark?
>>>
>>
>> Well, I've not benchmarked recently, but last time I checked, we were
>> handling more than 500 requests per second on a 700 MHz Pentium II, so
>> I'd say, yes we certainly are. Probably, given that on a multi-core
>> machine we can distribute the load amongst multiple back-ends, we're
>> faster. (Or does mongrel have the capability to use multiple
>> processes?)
Mongrel is multithreaded
> My varnish server is Celeron 1.8GHz with 2G of ram. I would be
> interested in running any benchmarks you have against this server, for
> comparison.
Feel free.
Run apachebench against this ruby script.
The test is for performance on one core, so if you have more use
schedtool to set the CPU affinity (and run apachebench on another core).
schedtool -a 0 -e ruby mongrels.rb
schedtool -a 1 -e ab -n 10000 -c100 http://127.0.0.1:3000/?name=TLUG
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