Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

--threaded makes Thin very very slow under Ruby1.9

#118

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

Reported by IƱaki Baz Castillo · December 19th, 2009 @ 07:54 PM

State: open
Milestone: Future
Assigned to: macournoyer macournoyer

Activity

  1. macournoyer
    macournoyer
    • 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?

    December 20th, 2009 @ 01:28 PM

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.