--threaded makes Thin very very slow under Ruby1.9
Reported by Iñaki Baz Castillo | December 19th, 2009 @ 07:54 PM | in Future
Note this simple config.ru:
run lambda { |env|
puts "Request URI: #{env["REQUEST_URI"]}"
[201, {'Content-Type'=>'text/plain'}, ["Bye World"]]
}
I've done tests with:
- apache 'ab' command sending 1000 requests with concurrency 20.
- Ruby 1.8.7 and 1.9.1p376 (thin1.8 and thin1.9).
- thin in pure event model and using threads ("--threaded").
Tests:
1) ~# thin1.8 -R config.ru start => 0.997 seconds
2) ~# thin1.8 -R config.ru --threaded start => 1.544 seconds
3) ~# thin1.9 -R config.ru start => 1.061 seconds
4) ~# thin1.9 -R config.ru --threaded start => 14.709 seconds !!!
An important point is that running the above commands in foreground, the "puts" command displays "Request URI: /index.xml" line by line, except in case 4 (thin1.9 --threaded) in which it's wrongly displayed (lines mixed):
Request URI: /index.xml
Request URI: /index.xml
Request URI: /index.xmlRequest URI: /index.xmlRequest URI: /index.xmlRequest URI: /index.xmlRequest URI: /index.xmlRequest URI::/index.xmlRequest URI: /index.xmlRequest URI: /index.xmlRequest URI: /index.xml
Request URI: /index.xml
Request URI: /index.xml
Request URI: /index.xml
Comments and changes to this ticket
-
macournoyer December 20th, 2009 @ 01:28 PM
- State changed from new to open
That is some weird behaviour. Specially that --threaded should be way faster on 1.9 than 1.8.
What OS are you on?
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »