Rails with webrick slow as snails

Discussion in 'Ruby' started by Sarah Tanembaum, Dec 1, 2004.

  1. I've followed the sample installation
    http://www.leetsoft.com/rails/lesson1.html step by step and it works, I
    think. I got the same message as the example

    BUT

    1. when starting the webrick from the command line, IT'S SLOW AS SNAIL
    2. when pointing to the http://localhost:3000/hello/index, IT SLOW AS
    SNAIL AS WELL. It takes at least 4 minutes to get the result.

    What am I doing wrong?


    Below are the error on the console:

    #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    127.0.0.1 - - [01/Dec/2004:13:20:29 Eastern Standard Time] "GET
    /hello/index HTTP/1.1" 200 306
    - -> /hello/index
    #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    [2004-12-01 13:25:19] ERROR `/favicon.ico' not found.
    127.0.0.1 - - [01/Dec/2004:13:25:19 Eastern Standard Time] "GET
    /favicon.ico HTTP/1.1" 404 281
    - -> /favicon.ico
    #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    Sarah Tanembaum, Dec 1, 2004
    #1
    1. Advertising

  2. > BUT
    >
    > 1. when starting the webrick from the command line, IT'S SLOW AS SNAIL
    > 2. when pointing to the http://localhost:3000/hello/index, IT SLOW AS
    > SNAIL AS WELL. It takes at least 4 minutes to get the result.
    >
    > What am I doing wrong?


    What kind of hardware are you running on? 4 minutes sound insane in any
    case, though.

    The reloading WEBrick dispatcher is indeed dog slow in 0.8.5 (around ~1
    second per reload on my G4 1.5ghz). This is being greatly remedied in
    the forthcoming 0.9.0 that's already available as beta gems right now.

    The new approach uses a two-tiered approach to requiring classes where
    your app is reloaded on every request, but the framework remains cached
    and the interpreter is reused. This is much, much more efficient and
    hence much faster.

    One guy reported going from 10s per page load to much less than a
    second on his G3 400mhz Mac.

    So if you don't find out what's screwing up your current installation,
    you might want to try out the beta gems. They can be fetched with:

    gem update -s http://gems.rubyonrails.org

    For convenience, there's even an executable start_server command in the
    root of new apps created with 0.9. Click that and the WEBrick server
    starts.
    --
    David Heinemeier Hansson,
    http://www.basecamphq.com/ -- Web-based Project Management
    http://www.rubyonrails.org/ -- Web-application framework for Ruby
    http://macromates.com/ -- TextMate: Code and markup editor (OS X)
    http://www.loudthinking.com/ -- Broadcasting Brain
    David Heinemeier Hansson, Dec 1, 2004
    #2
    1. Advertising

  3. David Heinemeier Hansson wrote:
    >> BUT
    >>
    >> 1. when starting the webrick from the command line, IT'S SLOW AS SNAIL
    >> 2. when pointing to the http://localhost:3000/hello/index, IT SLOW AS
    >> SNAIL AS WELL. It takes at least 4 minutes to get the result.
    >>
    >> What am I doing wrong?

    >
    >
    > What kind of hardware are you running on? 4 minutes sound insane in any
    > case, though.
    >
    > The reloading WEBrick dispatcher is indeed dog slow in 0.8.5 (around ~1
    > second per reload on my G4 1.5ghz). This is being greatly remedied in
    > the forthcoming 0.9.0 that's already available as beta gems right now.
    >
    > The new approach uses a two-tiered approach to requiring classes where
    > your app is reloaded on every request, but the framework remains cached
    > and the interpreter is reused. This is much, much more efficient and
    > hence much faster.
    >
    > One guy reported going from 10s per page load to much less than a second
    > on his G3 400mhz Mac.
    >
    > So if you don't find out what's screwing up your current installation,
    > you might want to try out the beta gems. They can be fetched with:
    >
    > gem update -s http://gems.rubyonrails.org
    >
    > For convenience, there's even an executable start_server command in the
    > root of new apps created with 0.9. Click that and the WEBrick server
    > starts.
    > --
    > David Heinemeier Hansson,
    > http://www.basecamphq.com/ -- Web-based Project Management
    > http://www.rubyonrails.org/ -- Web-application framework for Ruby
    > http://macromates.com/ -- TextMate: Code and markup editor (OS X)
    > http://www.loudthinking.com/ -- Broadcasting Brain
    >
    >
    >


    Hi David, I'm running PIII/800MHz laptop. Perhaps I did exagerate a bit,
    but not much. It takes at least 3 minutes for the sample page to come up
    and it will take just as long to reload/refresh the same page. Plus,
    starting up the "ruby dispatch.servlet -a" takes at least 1 minutes.

    I will try what you suggested by updating it to the latest beta.

    Thanks
    Sarah Tanembaum, Dec 1, 2004
    #3
  4. > Hi David, I'm running PIII/800MHz laptop. Perhaps I did exagerate a
    > bit, but not much. It takes at least 3 minutes for the sample page to
    > come up and it will take just as long to reload/refresh the same page.
    > Plus, starting up the "ruby dispatch.servlet -a" takes at least 1
    > minutes.
    >
    > I will try what you suggested by updating it to the latest beta.


    Something is obviously broken in your setup. Your machine should be
    fully capable of reloading that screen in MAX 5 seconds, I'd say. And
    I'd think it should be more like 2-3. I wonder if something is trying
    to resolve something and waiting for a timeout. Could sound like it.

    If that's the case, maybe it won't even help to upgrade to the beta
    rails. You should probably try do to a simple test with webrick and see
    if you can get that to perform if possible.
    --
    David Heinemeier Hansson,
    http://www.basecamphq.com/ -- Web-based Project Management
    http://www.rubyonrails.org/ -- Web-application framework for Ruby
    http://macromates.com/ -- TextMate: Code and markup editor (OS X)
    http://www.loudthinking.com/ -- Broadcasting Brain
    David Heinemeier Hansson, Dec 1, 2004
    #4
  5. Hello Sarah,

    ST> Hi David, I'm running PIII/800MHz laptop. Perhaps I did exagerate a bit,
    ST> but not much. It takes at least 3 minutes for the sample page to come up
    ST> and it will take just as long to reload/refresh the same page. Plus,
    ST> starting up the "ruby dispatch.servlet -a" takes at least 1 minutes.

    ST> I will try what you suggested by updating it to the latest beta.

    Do you have the Windows SP2 firewall enabled ? I also got a 20 sec
    delay for the first connect on my 2,8Ghz PIV machine (VMWare sandbox)
    before i turned the firewall off.

    3 minutes is a clear sign that the problem is your envrionment and not
    inside ruby/rails.

    --
    Best regards, emailto: scholz at scriptolutions dot com
    Lothar Scholz http://www.ruby-ide.com
    CTO Scriptolutions Ruby, PHP, Python IDE 's
    Lothar Scholz, Dec 1, 2004
    #5
  6. Lothar Scholz wrote:
    > Hello Sarah,
    >
    > ST> Hi David, I'm running PIII/800MHz laptop. Perhaps I did exagerate a bit,
    > ST> but not much. It takes at least 3 minutes for the sample page to come up
    > ST> and it will take just as long to reload/refresh the same page. Plus,
    > ST> starting up the "ruby dispatch.servlet -a" takes at least 1 minutes.
    >
    > ST> I will try what you suggested by updating it to the latest beta.
    >
    > Do you have the Windows SP2 firewall enabled ? I also got a 20 sec
    > delay for the first connect on my 2,8Ghz PIV machine (VMWare sandbox)
    > before i turned the firewall off.
    >
    > 3 minutes is a clear sign that the problem is your envrionment and not
    > inside ruby/rails.
    >


    Dear David & Lothar, I did try using the Webrick's Hello servlet sample
    script and the response is much faster, both the startup and http
    access. Any idea?

    Thanks
    Sarah Tanembaum, Dec 1, 2004
    #6
  7. Lothar Scholz wrote:
    > Hello Sarah,
    >
    > ST> Hi David, I'm running PIII/800MHz laptop. Perhaps I did exagerate a bit,
    > ST> but not much. It takes at least 3 minutes for the sample page to come up
    > ST> and it will take just as long to reload/refresh the same page. Plus,
    > ST> starting up the "ruby dispatch.servlet -a" takes at least 1 minutes.
    >
    > ST> I will try what you suggested by updating it to the latest beta.
    >
    > Do you have the Windows SP2 firewall enabled ? I also got a 20 sec
    > delay for the first connect on my 2,8Ghz PIV machine (VMWare sandbox)
    > before i turned the firewall off.
    >
    > 3 minutes is a clear sign that the problem is your envrionment and not
    > inside ruby/rails.
    >


    Below are the log from the console of '%> ruby dispatch.servlet -a'

    C:\rails\public>ruby dispatch.servlet -a
    dispatch: invalid option: -a
    [2004-12-01 17:18:46] INFO WEBrick 1.3.1
    [2004-12-01 17:18:46] INFO ruby 1.8.2 (2004-11-06) [i386-mswin32]
    [2004-12-01 17:18:46] INFO WEBrick::HTTPServer#start: pid=2620 port=3000
    #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    [2004-12-01 17:21:18] ERROR `/favicon.ico' not found.
    127.0.0.1 - - [01/Dec/2004:17:21:18 Eastern Standard Time] "GET
    /favicon.ico HTTP/1.1" 404 281
    - -> /favicon.ico
    #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    X:/websites/rails/public/../config/environments/shared.rb:1: warning:
    already initialized constant ADDITIONAL_LOAD_PATHS
    #<NameError: undefined method `database_configurations' for class
    `Builder::BlankSlate'>
    ["x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blankslate.rb:20:in
    `un
    ef_method'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blankslate.
    b:20:in `hide'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blanksl
    te.rb:48:in `method_added'",
    "X:/websites/rails/public/../config/environments/shared.rb:15",
    "x:/apps/ruby/ruby-1.8/lib/ruby/site_r
    by/1.8/rubygems/loadpath_manager.rb:5:in `require__'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5
    in `require'",
    "X:/websites/rails/public/../config/environments/production.rb:1",
    "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rub
    gems/loadpath_manager.rb:5:in `require__'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in
    `requir
    '", "X:/websites/rails/public/dispatch.rb:3",
    "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_se
    ver.rb:122:in `load'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:122:in
    `handle_
    ispatch'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:101:in
    `handle_mapped'", "x
    /apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:53:in
    `do_GET'", "x:/apps/ruby/ruby-1.8/l
    b/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/httpservlet/abstract.rb:3
    :in `service'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/httpserver.rb:97:in
    `service'", "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/web
    ick/httpserver.rb:58:in `run'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:153:in
    `start_thread'", "x:/apps/ruby/ruby-1.
    /lib/ruby/1.8/webrick/server.rb:147:in `start'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:147:in
    `start_thread'", "x:/
    pps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:97:in `start'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:89:in `each'
    , "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:89:in `start'",
    "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:79:in
    `start'", "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:79:in
    `start'", "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails
    0.8.5.200412010045/lib/webrick_server.rb:37:in `dispatch'",
    "dispatch.servlet:45"]
    [2004-12-01 17:21:40] ERROR `/hello/index' not found.
    127.0.0.1 - - [01/Dec/2004:17:21:30 Eastern Standard Time] "GET
    /hello/index HTTP/1.1" 404 281
    - -> /hello/index
    #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    [2004-12-01 17:21:41] ERROR `/favicon.ico' not found.
    127.0.0.1 - - [01/Dec/2004:17:21:40 Eastern Standard Time] "GET
    /favicon.ico HTTP/1.1" 404 281
    - -> /favicon.ico
    #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    127.0.0.1 - - [01/Dec/2004:17:22:42 Eastern Standard Time] "GET
    /hello/index HTTP/1.1" 200 306
    - -> /hello/index
    #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    [2004-12-01 17:22:48] ERROR `/favicon.ico' not found.
    127.0.0.1 - - [01/Dec/2004:17:22:48 Eastern Standard Time] "GET
    /favicon.ico HTTP/1.1" 404 281
    - -> /favicon.ico
    #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    127.0.0.1 - - [01/Dec/2004:17:23:05 Eastern Standard Time] "GET
    /hello/index HTTP/1.1" 200 306
    - -> /hello/index
    #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    [2004-12-01 17:23:07] ERROR `/favicon.ico' not found.
    127.0.0.1 - - [01/Dec/2004:17:23:07 Eastern Standard Time] "GET
    /favicon.ico HTTP/1.1" 404 281
    - -> /favicon.ico
    #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    127.0.0.1 - - [01/Dec/2004:17:23:25 Eastern Standard Time] "GET
    /hello/index HTTP/1.1" 200 306
    - -> /hello/index
    #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    [2004-12-01 17:23:31] ERROR `/favicon.ico' not found.
    127.0.0.1 - - [01/Dec/2004:17:23:31 Eastern Standard Time] "GET
    /favicon.ico HTTP/1.1" 404 281
    - -> /favicon.ico
    Sarah Tanembaum, Dec 1, 2004
    #7
  8. under windows it seems to be very important to use rubyw.exe and not
    ruby.exe for performance. Maybe thats it ?


    On Thu, 2 Dec 2004 07:32:45 +0900, Sarah Tanembaum
    <> wrote:
    > Lothar Scholz wrote:
    >
    >
    > > Hello Sarah,
    > >
    > > ST> Hi David, I'm running PIII/800MHz laptop. Perhaps I did exagerate a bit,
    > > ST> but not much. It takes at least 3 minutes for the sample page to come up
    > > ST> and it will take just as long to reload/refresh the same page. Plus,
    > > ST> starting up the "ruby dispatch.servlet -a" takes at least 1 minutes.
    > >
    > > ST> I will try what you suggested by updating it to the latest beta.
    > >
    > > Do you have the Windows SP2 firewall enabled ? I also got a 20 sec
    > > delay for the first connect on my 2,8Ghz PIV machine (VMWare sandbox)
    > > before i turned the firewall off.
    > >
    > > 3 minutes is a clear sign that the problem is your envrionment and not
    > > inside ruby/rails.
    > >

    >
    > Below are the log from the console of '%> ruby dispatch.servlet -a'
    >
    > C:\rails\public>ruby dispatch.servlet -a
    > dispatch: invalid option: -a
    > [2004-12-01 17:18:46] INFO WEBrick 1.3.1
    > [2004-12-01 17:18:46] INFO ruby 1.8.2 (2004-11-06) [i386-mswin32]
    > [2004-12-01 17:18:46] INFO WEBrick::HTTPServer#start: pid=2620 port=3000
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:21:18] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:21:18 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > X:/websites/rails/public/../config/environments/shared.rb:1: warning:
    > already initialized constant ADDITIONAL_LOAD_PATHS
    > #<NameError: undefined method `database_configurations' for class
    > `Builder::BlankSlate'>
    > ["x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blankslate.rb:20:in
    > `un
    > ef_method'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blankslate.
    > b:20:in `hide'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blanksl
    > te.rb:48:in `method_added'",
    > "X:/websites/rails/public/../config/environments/shared.rb:15",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_r
    > by/1.8/rubygems/loadpath_manager.rb:5:in `require__'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5
    > in `require'",
    > "X:/websites/rails/public/../config/environments/production.rb:1",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rub
    > gems/loadpath_manager.rb:5:in `require__'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in
    > `requir
    > '", "X:/websites/rails/public/dispatch.rb:3",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_se
    > ver.rb:122:in `load'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:122:in
    > `handle_
    > ispatch'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:101:in
    > `handle_mapped'", "x
    > /apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:53:in
    > `do_GET'", "x:/apps/ruby/ruby-1.8/l
    > b/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/httpservlet/abstract.rb:3
    > :in `service'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/httpserver.rb:97:in
    > `service'", "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/web
    > ick/httpserver.rb:58:in `run'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:153:in
    > `start_thread'", "x:/apps/ruby/ruby-1.
    > /lib/ruby/1.8/webrick/server.rb:147:in `start'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:147:in
    > `start_thread'", "x:/
    > pps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:97:in `start'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:89:in `each'
    > , "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:89:in `start'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:79:in
    > `start'", "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:79:in
    > `start'", "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails
    > 0.8.5.200412010045/lib/webrick_server.rb:37:in `dispatch'",
    > "dispatch.servlet:45"]
    > [2004-12-01 17:21:40] ERROR `/hello/index' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:21:30 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 404 281
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:21:41] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:21:40 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > 127.0.0.1 - - [01/Dec/2004:17:22:42 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 200 306
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:22:48] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:22:48 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > 127.0.0.1 - - [01/Dec/2004:17:23:05 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 200 306
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:23:07] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:23:07 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > 127.0.0.1 - - [01/Dec/2004:17:23:25 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 200 306
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:23:31] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:23:31 Eastern Standard Time] "GET
    >
    >
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    >
    >



    --
    Tobi
    http://blog.leetsoft.com
    Tobias Luetke, Dec 1, 2004
    #8
  9. Tobias Luetke wrote:

    >under windows it seems to be very important to use rubyw.exe and not
    >ruby.exe for performance. Maybe thats it ?
    >

    Question: I've seen this mentioned a few times now. If this is the
    case, does the ruby installer for Windows associate .rb files with
    ruby.exe or rubyw.exe? It would seem silly to be saying it should be
    one way and then have all the default behaviors do it the other way. If
    there is no good use for ruby.exe, then we should simply rename
    rubyw.exe to ruby.exe.
    Carl Youngblood, Dec 1, 2004
    #9
  10. Hello Carl,

    CY> Tobias Luetke wrote:

    >>under windows it seems to be very important to use rubyw.exe and not
    >>ruby.exe for performance. Maybe thats it ?
    >>

    CY> Question: I've seen this mentioned a few times now. If this is the
    CY> case, does the ruby installer for Windows associate .rb files with
    CY> ruby.exe or rubyw.exe? It would seem silly to be saying it should be
    CY> one way and then have all the default behaviors do it the other way. If
    CY> there is no good use for ruby.exe, then we should simply rename
    CY> rubyw.exe to ruby.exe.

    rubyw.exe is faster if you don't need standart output, because everything
    is going to /dev/null.

    I believe that most programs are still command line programs that
    write something useful to standart output. So ther current
    associations are correct.


    --
    Best regards, emailto: scholz at scriptolutions dot com
    Lothar Scholz http://www.ruby-ide.com
    CTO Scriptolutions Ruby, PHP, Python IDE 's
    Lothar Scholz, Dec 1, 2004
    #10
  11. Lothar Scholz wrote:

    > Hello Carl,
    >
    > CY> Tobias Luetke wrote:
    >
    >
    >>>under windows it seems to be very important to use rubyw.exe and not
    >>>ruby.exe for performance. Maybe thats it ?
    >>>

    >
    > CY> Question: I've seen this mentioned a few times now. If this is the
    > CY> case, does the ruby installer for Windows associate .rb files with
    > CY> ruby.exe or rubyw.exe? It would seem silly to be saying it should be
    > CY> one way and then have all the default behaviors do it the other way. If
    > CY> there is no good use for ruby.exe, then we should simply rename
    > CY> rubyw.exe to ruby.exe.
    >
    > rubyw.exe is faster if you don't need standart output, because everything
    > is going to /dev/null.
    >
    > I believe that most programs are still command line programs that
    > write something useful to standart output. So ther current
    > associations are correct.
    >
    >


    I agree with Lothar.

    method_scope is just a simple test script that prints stuff to stdout.
    first with original ruby

    H:\ruby\Spielwiese>method_scope.rb
    bar
    A.moo
    instance moo

    now I renamed rubyw to ruby
    H:\ruby\Spielwiese>method_scope.rb


    H:\ruby\Spielwiese>


    I'd like to see the output. :)

    regards,
    Henrik
    Henrik Horneber, Dec 1, 2004
    #11
  12. Lothar Scholz wrote:

    >rubyw.exe is faster if you don't need standart output, because everything
    >is going to /dev/null.
    >
    >I believe that most programs are still command line programs that
    >write something useful to standart output. So ther current
    >associations are correct.
    >

    Okay. I didn't realize there was this difference. Thanks
    Carl Youngblood, Dec 1, 2004
    #12
  13. Sarah Tanembaum

    Curt Hibbs Guest

    Carl Youngblood wrote:
    >
    > Tobias Luetke wrote:
    >
    > >under windows it seems to be very important to use rubyw.exe and not
    > >ruby.exe for performance. Maybe thats it ?


    I'm running webrick with ruby.exe without any slowdown problem.

    > Question: I've seen this mentioned a few times now. If this is the
    > case, does the ruby installer for Windows associate .rb files with
    > ruby.exe or rubyw.exe? It would seem silly to be saying it should be
    > one way and then have all the default behaviors do it the other way. If
    > there is no good use for ruby.exe, then we should simply rename
    > rubyw.exe to ruby.exe.


    The one-click installer associates *.rb files with ruby.exe and *.rbw files
    with rubyw.exe.

    Curt
    Curt Hibbs, Dec 1, 2004
    #13
  14. I see a X: drive in your log. Are you running the ruby and rails files
    off of a network drive?

    Regards,
    Nick

    Sarah Tanembaum wrote:

    > Lothar Scholz wrote:
    >
    >> Hello Sarah,
    >>
    >> ST> Hi David, I'm running PIII/800MHz laptop. Perhaps I did exagerate
    >> a bit,
    >> ST> but not much. It takes at least 3 minutes for the sample page to
    >> come up
    >> ST> and it will take just as long to reload/refresh the same page. Plus,
    >> ST> starting up the "ruby dispatch.servlet -a" takes at least 1 minutes.
    >>
    >> ST> I will try what you suggested by updating it to the latest beta.
    >>
    >> Do you have the Windows SP2 firewall enabled ? I also got a 20 sec
    >> delay for the first connect on my 2,8Ghz PIV machine (VMWare sandbox)
    >> before i turned the firewall off.
    >>
    >> 3 minutes is a clear sign that the problem is your envrionment and not
    >> inside ruby/rails.
    >>

    >
    > Below are the log from the console of '%> ruby dispatch.servlet -a'
    >
    > C:\rails\public>ruby dispatch.servlet -a
    > dispatch: invalid option: -a
    > [2004-12-01 17:18:46] INFO WEBrick 1.3.1
    > [2004-12-01 17:18:46] INFO ruby 1.8.2 (2004-11-06) [i386-mswin32]
    > [2004-12-01 17:18:46] INFO WEBrick::HTTPServer#start: pid=2620 port=3000
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:21:18] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:21:18 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > X:/websites/rails/public/../config/environments/shared.rb:1: warning:
    > already initialized constant ADDITIONAL_LOAD_PATHS
    > #<NameError: undefined method `database_configurations' for class
    > `Builder::BlankSlate'>
    > ["x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blankslate.rb:20:in
    > `un
    > ef_method'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blankslate.
    >
    > b:20:in `hide'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/actionpack-0.9.5.200412010045/lib/action_view/vendor/builder/blanksl
    >
    > te.rb:48:in `method_added'",
    > "X:/websites/rails/public/../config/environments/shared.rb:15",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_r
    > by/1.8/rubygems/loadpath_manager.rb:5:in `require__'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5
    >
    > in `require'",
    > "X:/websites/rails/public/../config/environments/production.rb:1",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rub
    > gems/loadpath_manager.rb:5:in `require__'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in
    > `requir
    > '", "X:/websites/rails/public/dispatch.rb:3",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_se
    >
    > ver.rb:122:in `load'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:122:in
    > `handle_
    > ispatch'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:101:in
    > `handle_mapped'", "x
    > /apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails-0.8.5.200412010045/lib/webrick_server.rb:53:in
    > `do_GET'", "x:/apps/ruby/ruby-1.8/l
    > b/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/httpservlet/abstract.rb:3
    > :in `service'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/httpserver.rb:97:in
    > `service'", "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/web
    > ick/httpserver.rb:58:in `run'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:153:in
    > `start_thread'", "x:/apps/ruby/ruby-1.
    > /lib/ruby/1.8/webrick/server.rb:147:in `start'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:147:in
    > `start_thread'", "x:/
    > pps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:97:in `start'",
    > "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:89:in `each'
    > , "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:89:in
    > `start'", "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:79:in
    > `start'", "x:/apps/ruby/ruby-1.8/lib/ruby/1.8/webrick/server.rb:79:in
    > `start'", "x:/apps/ruby/ruby-1.8/lib/ruby/gems/1.8/gems/rails
    > 0.8.5.200412010045/lib/webrick_server.rb:37:in `dispatch'",
    > "dispatch.servlet:45"]
    > [2004-12-01 17:21:40] ERROR `/hello/index' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:21:30 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 404 281
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:21:41] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:21:40 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > 127.0.0.1 - - [01/Dec/2004:17:22:42 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 200 306
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:22:48] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:22:48 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > 127.0.0.1 - - [01/Dec/2004:17:23:05 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 200 306
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:23:07] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:23:07 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    > #<WEBrick::HTTPStatus::NotFound: `/hello/index' not found.>
    > 127.0.0.1 - - [01/Dec/2004:17:23:25 Eastern Standard Time] "GET
    > /hello/index HTTP/1.1" 200 306
    > - -> /hello/index
    > #<WEBrick::HTTPStatus::NotFound: `/favicon.ico' not found.>
    > [2004-12-01 17:23:31] ERROR `/favicon.ico' not found.
    > 127.0.0.1 - - [01/Dec/2004:17:23:31 Eastern Standard Time] "GET
    > /favicon.ico HTTP/1.1" 404 281
    > - -> /favicon.ico
    >
    Nicholas Van Weerdenburg, Dec 2, 2004
    #14
  15. Nicholas Van Weerdenburg wrote:
    > I see a X: drive in your log. Are you running the ruby and rails files
    > off of a network drive?
    >
    > Regards,
    > Nick
    >

    Nope! I have a disks and a few partitions. All in one machine.

    Regards,
    Sarah
    Sarah Tanembaum, Dec 2, 2004
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Weirich
    Replies:
    5
    Views:
    216
    Ruby Tuesday
    Feb 24, 2004
  2. George  Moschovitis

    Why is webrick sooo slow?

    George Moschovitis, Jan 24, 2005, in forum: Ruby
    Replies:
    8
    Views:
    232
    Alexander Kellett
    Jan 31, 2005
  3. Lloyd Zusman
    Replies:
    2
    Views:
    382
  4. Aaron Smith

    WEBrick::Daemon and WEBrick

    Aaron Smith, Mar 9, 2007, in forum: Ruby
    Replies:
    2
    Views:
    301
    Aaron Smith
    Mar 18, 2007
  5. Nick Green
    Replies:
    4
    Views:
    182
    Nick Green
    Nov 18, 2009
Loading...

Share This Page