slow ruby execution on FreeBSD

Discussion in 'Ruby' started by Guy Speier, Apr 21, 2007.

  1. Guy Speier

    Guy Speier Guest

    Howdy,

    Total green-horn here. A few weeks ago, a test website we were bulding (on
    freebsd with mysql) slowed waaaay down.

    I **believe** I have the problem narrowed down to this line of code in
    /vendor/rails/railties/lib/initializer.rb:
    configuration.frameworks.each { |framework| require(framework.to_s) }

    I Say I think I've got it narrowed doen to this line of code, because I have
    it flanked by puts "AAA" and puts "BBB", and whenever I execute:
    config/environment.rb
    there is a ~6 second pause between AAA and BBB to STDOUT.

    Like I've said (and I'm sure you would have realized by now), I am a total
    greenhorn here, but:
    1) Is this pause to be expected, or have I stumbled upon the issue?
    2) What does this line (configuration.frameworks.each { |framework|
    require(framework.to_s) }) mean? Can someone point me to the next file/line
    to look?
    3) Any ideas?

    I really appreciate it!
    Guy
     
    Guy Speier, Apr 21, 2007
    #1
    1. Advertising

  2. Guy Speier wrote:
    > Howdy,
    > Total green-horn here. A few weeks ago, a test website we were
    > bulding (on freebsd with mysql) slowed waaaay down.
    > I **believe** I have the problem narrowed down to this line of code in
    > /vendor/rails/railties/lib/initializer.rb:
    > configuration.frameworks.each { |framework| require(framework.to_s) }

    You're probably going to get better advice on the Rails list:
    http://www.rubyonrails.org/community

    Good luck!
     
    Timothy Hunter, Apr 21, 2007
    #2
    1. Advertising

  3. On Sat, Apr 21, 2007 at 03:56:38PM +0900, Guy Speier wrote:
    > I **believe** I have the problem narrowed down to this line of code in
    > /vendor/rails/railties/lib/initializer.rb:
    > configuration.frameworks.each { |framework| require(framework.to_s) }
    >
    > I Say I think I've got it narrowed doen to this line of code, because I
    > have it flanked by puts "AAA" and puts "BBB", and whenever I execute:
    > config/environment.rb
    > there is a ~6 second pause between AAA and BBB to STDOUT.


    Rails does indeed have a long startup time. But normally it doesn't matter,
    because the same instance should remain around to handle subsequent
    requests.

    So it sounds like you've broken something else, such that either Rails can't
    start at all, or it starts, handles one (or a few) requests, and then
    terminates.

    Debugging this would depend on exactly how you're running rails, e.g. under
    fastcgi, or under mongrel, or webrick. I suggest you go to the Rails google
    group for advice, since this is the Ruby Language list, not the Rails group.

    Regards,

    Brian.

    P.S. Don't run rails as a normal CGI. This will *guarantee* a 6-second
    startup overhead for every page request.
     
    Brian Candler, Apr 21, 2007
    #3
  4. Guy Speier

    Guy Speier Guest

    Thanks Brian,

    I will check out the rails side.

    Can you tell me (or point me to a faq) what the difference between rails &
    ruby is? Also, I think this is running fastcgi, but how would I know for
    sure?

    thanks,
    Guy

    Brian Candler writes:

    > On Sat, Apr 21, 2007 at 03:56:38PM +0900, Guy Speier wrote:
    >> I **believe** I have the problem narrowed down to this line of code in
    >> /vendor/rails/railties/lib/initializer.rb:
    >> configuration.frameworks.each { |framework| require(framework.to_s) }
    >>
    >> I Say I think I've got it narrowed doen to this line of code, because I
    >> have it flanked by puts "AAA" and puts "BBB", and whenever I execute:
    >> config/environment.rb
    >> there is a ~6 second pause between AAA and BBB to STDOUT.

    >
    > Rails does indeed have a long startup time. But normally it doesn't matter,
    > because the same instance should remain around to handle subsequent
    > requests.
    >
    > So it sounds like you've broken something else, such that either Rails can't
    > start at all, or it starts, handles one (or a few) requests, and then
    > terminates.
    >
    > Debugging this would depend on exactly how you're running rails, e.g. under
    > fastcgi, or under mongrel, or webrick. I suggest you go to the Rails google
    > group for advice, since this is the Ruby Language list, not the Rails group.
    >
    > Regards,
    >
    > Brian.
    >
    > P.S. Don't run rails as a normal CGI. This will *guarantee* a 6-second
    > startup overhead for every page request.
    >
     
    Guy Speier, Apr 21, 2007
    #4
  5. Guy Speier wrote:
    > Thanks Brian,
    > I will check out the rails side.
    > Can you tell me (or point me to a faq) what the difference between rails
    > & ruby is?


    Rails is a framework for website creation, written in the Ruby scripting
    language.

    > Also, I think this is running fastcgi, but how would I know
    > for sure?


    Shot into the dark: Check your webserver configuration?

    --
    Phillip "CynicalRyan" Gawlowski
    http://cynicalryan.110mb.com/
    http://clothred.rubyforge.org

    Rule of Open-Source Programming #15:

    If you like it, let the author know. If you hate it, let the author
    know why.
     
    Phillip Gawlowski, Apr 21, 2007
    #5
    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. Dai Hao
    Replies:
    3
    Views:
    3,995
    sallemann
    Nov 16, 2011
  2. KJ
    Replies:
    0
    Views:
    462
  3. MARTIN Herve \(EXT\)
    Replies:
    1
    Views:
    1,513
    Anthony Borla
    Nov 27, 2003
  4. John Beschler

    slow global.asa execution

    John Beschler, Aug 4, 2003, in forum: ASP General
    Replies:
    2
    Views:
    172
    John Beschler
    Aug 4, 2003
  5. George
    Replies:
    3
    Views:
    313
    Robert Klemme
    May 17, 2012
Loading...

Share This Page