Yet another chapter in the FCGI saga 9 comments

posted Wednesday, November 16, 2005 by topfunky

It got worse earlier this week when I couldn’t ssh to my Dreamhost account at all.

Staff informed me that I had 35 zombie Ruby processes running (from my Typo installation).

Just doing a normal kill wasn’t enough to kill some of them, but kill -5 xxxxx seems to do the job.

I also deleted my frozen copy of Rails in ./vendor and am using the newly upgraded version on the Dreamhost server.

The good news is that I’m back to FCGI and hopefully the fixes in the current Rails candidate will help.

9 comments

Leave a response

  • Gravatar icon Cody

    It won’t help, I’ve been running the latest version of Rails on a Dreamhost hosted website and the zombie processes just keep slowly accumulating.

  • So does it throw you out if you have too many procs running? Might explain why I could only ssh in for a few minutes at a time these last few days. I wonder if running each application as a different user will get around the restriction.

  • I hadnt noticed the Zombie Processes until I found your blog and did ps aux.

    I too run the latest stable typo on Dreamhost (using their standard built-in rails and ruby install) USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND hiddenl 10242 0.0 0.1 26268 2768 ? SN Nov13 0:02 ruby dispatch.fcgi hiddenl 4182 0.0 0.1 26732 2932 ? SN Nov13 0:02 ruby dispatch.fcgi hiddenl 22157 0.0 0.1 26692 2988 ? SN Nov13 0:02 ruby dispatch.fcgi hiddenl 13649 0.1 1.2 30476 25384 ? SN Nov15 2:58 ruby dispatch.fcgi hiddenl 2529 0.0 1.1 29496 24432 ? SN Nov15 0:05 ruby dispatch.fcgi hiddenl 19365 0.0 0.0 0 0 ? ZN Nov15 0:00 [ruby] hiddenl 16286 0.0 1.1 26304 22856 ? SN Nov15 0:04 ruby dispatch.fcgi hiddenl 12877 0.0 1.1 26300 22852 ? SN Nov15 0:04 ruby dispatch.fcgi hiddenl 25910 0.0 1.2 30476 25384 ? SN Nov15 0:01 ruby dispatch.fcgi hiddenl 8727 0.0 1.2 30476 25384 ? SN Nov15 2:11 ruby dispatch.fcgi hiddenl 6832 0.0 1.1 27060 23812 ? SN Nov16 0:02 ruby dispatch.fcgi hiddenl 31300 0.0 1.1 26256 22792 ? SN Nov16 0:02 ruby dispatch.fcgi hiddenl 30607 0.0 0.9 23392 20632 ? SN Nov16 0:02 ruby dispatch.fcgi hiddenl 8134 0.1 1.2 31012 25876 ? SN 00:58 0:21 ruby dispatch.fcgi hiddenl 31559 0.0 1.1 26292 22844 ? SN 01:19 0:04 ruby dispatch.fcgi hiddenl 12939 0.0 1.2 31012 25876 ? SN 01:34 0:00 ruby dispatch.fcgi hiddenl 27157 0.0 1.2 31012 25876 ? SN 01:34 0:10 ruby dispatch.fcgi hiddenl 10437 0.0 0.0 6496 1900 ? S 05:24 0:00 sshd: hiddenloop@pts/2 hiddenl 25411 0.0 0.0 4768 1660 pts/2 Ss 05:24 0:00 -bash hiddenl 22774 0.0 0.0 2492 868 pts/2 R+ 05:25 0:00 ps aux ruby -v ruby 1.8.2 (2005-04-11) [i386-linux] rails -v Rails 0.14.3

    ps aux

    What can I do to fix this ? does setting up a cronjob to kill -9 these work ?

  • Gravatar icon atmos

    You guys are right(atleast in my experience). If you have a bunch of old stale ruby/fcgi processes around you won’t be able to keep a shell open very long. I had a script I wrote that’d clean them all up for me, it usually increased the responsiveness of my applications.

    I ended up leaving dreamhost because I was really disappointed in how the shared rails hosting actually works.

  • Gravatar icon Anonymous

    You can vote for the option to allow the use of lighttpd instead of apache on their suggestions page.

    I don’t know if this would help at all, but I seem to remember DHH saying that dreamhost’s apache setup was handling fastcgi processes in a stupid way.

    But really, you should spend some credits on the lighttpd vote even if it won’t help. Just to appease Anonymous.

  • I ended up writing a script to kill any ruby processes.

    
    [sunset]$ cat ~/local/bin/killdefunct
    #!/bin/bash
    
    export procs="`ps x -o ppid,comm | grep "<defunct>" | sed -e "s/^[ \t]*\([0-9]*\
    ) ruby.*/\1/"`" 
    for i in $procs; do
      #echo killing $i
      kill -9 $i
    done

    I have a cron job set to run this once per hour. It really helped with that whole getting kicked out of ssh problem.

  • Just fyi, I’m also having problems with zombie processes on TextDrive using Apache+FastCGI, so this is not limited to Dreamhost.

    See http://forum.textdrive.com/viewtopic.php?id=7001

  • I’ve noticed the “getting kicked out of ssh” problem as well. Strangely enough though, I only get kicked out when I log in by ssh’ing to my domain. If I ssh to the domain provided to me by dreamhost at the beginning (larchmont.dreamhost.com for me), then I don’t get kicked out. That doesn’t really solve the process problem though….

  • I crashed a server at rimuhosting the same way, I think that a web crawler went through my site and launched a bunch of zombie processes.

    I found this afterwards: http://bliki.rimuhosting.com/space/knowledgebase/linux/webserver/apache/installing+and+using+mod_fastcgi

    Ah well, I stopped using FCGI for the time being.

Your Comment

Nuby on Rails

Geoffrey Grosenbach / Ruby / Code / Graphics / Design / Rails / Merb / Javascript / CSS

Manufactured with

Subscribe

Subscribe (RSS)