Rails app suddenly stops working. RailsRunner errors?

Discussion in 'Ruby/Rails' started by malffred, Feb 2, 2007.

  1. malffred

    malffred New Member

    Strange, on one of my LS servers my Rails application just doesn't want to seem to work. I don't think I change anything either. When I restart the server and I tail the stderr.log I get this:

    /home/bugs/www//config/boot.rb:20:in `readlines': failed to allocate memory (NoMemoryError)
    from /home/bugs/www//config/boot.rb:20
    from /home/bugs/www//config/environment.rb:11
    from /opt/lsws/fcgi-bin/RailsRunner.rb:3


    There is plenty of memory. I've also upgrade all my gems. When I run the app via mongrel with ./script/server it runs fine so this only happens under Litespeed. Its the only Rails VHost I have on this particular server, any ideas? I've checked the settings and things seem fine, but anytime I go to the url it doesn't go anywhere.

    I also just updated to the latest ruby-lsapi gem, 1.13 I think?
  2. mistwang

    mistwang LiteSpeed Staff

    You may need to up the memory soft/hard limit for the ruby process under ruby tab, or the server wide CGI config under security tab.
  3. malffred

    malffred New Member

    mistwang, thanks for the tip. I did this and the previous error went away, but a similar error came up in its place:

    /usr/local/lib/site_ruby/1.8/x86_64-linux/svn/ext/core.so: libexpat.so.1: failed to map segment from shared object: Cannot allocate memory - /usr/local/lib/site_ruby/1.8/x86_64-linux/svn/ext/core.so (LoadError)
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:343:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in `require'
    from /usr/local/lib/site_ruby/1.8/svn/error.rb:1
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:343:in `new_constants_in'
    ... 13 levels...
    from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:443:in `require_dependency'
    from /home/bugs/www/config/../lib/collaboa/lib/setup.rb:15:in `run'
    from /home/bugs/www//config/environment.rb:65
    from /opt/lsws/fcgi-bin/RailsRunner.rb:3

    Hrm, do I just not have enough memory? Even doing "free -m" shows atleast 50MB free most of the time. I have a 256MB VPS. I have 3 lsphp vhosts and this is the only rails vhost. From the above error, do you think there is something else I could adjust or is this a problem with the app itself? (though it worked fine a few days ago).

    *UPDATE* I just did another test and stuck a generic rails app in there and RailsRunner ran it just fine. So I assume its a memory allocation issue or issue with the other app itself (which is just the collaboa bug tracking / source viewing rails app). If the above error gives you any clues let me know. Currently I have the rails softmem limit at 80M and the hardlimit at 120M set in the httpd_config.xml.
  4. malffred

    malffred New Member

    Fixed

    After playing around with the values a bit more I seemed to have fixed it. I just needed to allocate more memory to the rails part of it (I thought 80M would be more than enough, but I guess this app prefetched all the SVN versioning info?). Thanks! :D
  5. fantasydreaming

    fantasydreaming New Member

    What do you mean by "prefetched SVN versioning info"?

    I have a fairly large rails project, but I've been struggling with memory usage in the last while - each process shows nearly 200 megs of VSIZ, and 110 megs of RSS. They start around 94/44, but grow from there. Some requests load a thousand small objects, but it shouldn't be growing that much. I just wondered if your mention might be the clue to my problems too!

Share This Page