From lists at ruby-forum.com Tue Dec 2 10:15:17 2008 From: lists at ruby-forum.com (Matt Davies) Date: Tue, 2 Dec 2008 16:15:17 +0100 Subject: [Mongrel] mongrel_rails start and restart differences Message-ID: <7e68c833cde0b111f2b064605da96f25@ruby-forum.com> Hello everyone. I've got a rails application that is using 3 mongrels that sit behind nginx. I'm monitoring the mongrels, nginx and mysql with Munin and I'm restarting the processes when they hit certain levels with God. Can someone shed some light on this for me. I'm starting the mongrels off with this command, looping through 3 ports. mongrel_rails start -d -e production -a 127.0.0.1 -c /var/www/rails/daughter/current -p #{port} -P /var/www/conf/log/mongrel.#{port}.pid -l /var/www/conf/log/mongrel.#{port}.log. If my mongrels start chewing up too much memory I restart them like so mongrel_rails restart -P /var/www/conf/log/mongrel.#{port}.pid All works well. The problem is that munin does not record the mongrel after it's been restarting as the restarted mongrel runs underneath a ruby process as opposed to a mongrel_rail process. Here's what ps aux | grep mongrel_rails outputs after one mongrel has restarted. /USR/BIN/RUBY1.8 /USR/BIN/MONGREL_RAILS START -D -E PRODUCTION -A 127.0.0.1 -C /VAR/WWW/RAILS/DAUGHTER/CURRENT -P 5001 -P /VAR/WWW/CONF/LOG/MONGREL.5001.PID -L /VAR/WWW/CONF/LOG/MONGREL.5001.LOG RUBY /USR/LIB/RUBY/GEMS/1.8/GEMS/MONGREL-1.1.5/BIN/MONGREL_RAILS START -D -E PRODUCTION -A 127.0.0.1 -C /VAR/WWW/RAILS/DAUGHTER/CURRENT -P 5000 -P /VAR/WWW/CONF/LOG/MONGREL.5000.PID -L /VAR/WWW/CONF/LOG/MONGREL.5000.LOG I've capitalised them all so don't worry about the switches, any ideas why mongrel_rails start does this /USR/BIN/RUBY1.8 /USR/BIN/MONGREL_RAILS START but mongrel_rails restart does this RUBY /USR/LIB/RUBY/GEMS/1.8/GEMS/MONGREL-1.1.5/BIN/MONGREL_RAILS START Any help would be greatly appreciated. -- Posted via http://www.ruby-forum.com/. From ettinger at gmail.com Tue Dec 2 14:03:13 2008 From: ettinger at gmail.com (Anthony Ettinger) Date: Tue, 2 Dec 2008 11:03:13 -0800 Subject: [Mongrel] mongrel_rails start and restart differences In-Reply-To: <7e68c833cde0b111f2b064605da96f25@ruby-forum.com> References: <7e68c833cde0b111f2b064605da96f25@ruby-forum.com> Message-ID: <3fc6b2fb0812021103o6967e53br4affe86fb386cb92@mail.gmail.com> On Tue, Dec 2, 2008 at 7:15 AM, Matt Davies wrote: > Hello everyone. > > I've got a rails application that is using 3 mongrels that sit behind > nginx. I'm monitoring the mongrels, nginx and mysql with Munin and I'm > restarting the processes when they hit certain levels with God. > > Can someone shed some light on this for me. > > I'm starting the mongrels off with this command, looping through 3 > ports. > > mongrel_rails start -d -e production -a 127.0.0.1 -c > /var/www/rails/daughter/current -p #{port} -P > /var/www/conf/log/mongrel.#{port}.pid -l > /var/www/conf/log/mongrel.#{port}.log. > > If my mongrels start chewing up too much memory I restart them like so > > mongrel_rails restart -P /var/www/conf/log/mongrel.#{port}.pid > > All works well. The problem is that munin does not record the mongrel > after it's been restarting as the restarted mongrel runs underneath a > ruby process as opposed to a mongrel_rail process. > > Here's what ps aux | grep mongrel_rails outputs after one mongrel has > restarted. > > /USR/BIN/RUBY1.8 /USR/BIN/MONGREL_RAILS START -D -E PRODUCTION -A > 127.0.0.1 -C /VAR/WWW/RAILS/DAUGHTER/CURRENT -P 5001 -P > /VAR/WWW/CONF/LOG/MONGREL.5001.PID -L /VAR/WWW/CONF/LOG/MONGREL.5001.LOG > > RUBY /USR/LIB/RUBY/GEMS/1.8/GEMS/MONGREL-1.1.5/BIN/MONGREL_RAILS START > -D -E PRODUCTION -A 127.0.0.1 -C /VAR/WWW/RAILS/DAUGHTER/CURRENT -P 5000 > -P /VAR/WWW/CONF/LOG/MONGREL.5000.PID -L > /VAR/WWW/CONF/LOG/MONGREL.5000.LOG > > I've capitalised them all so don't worry about the switches, any ideas > why mongrel_rails start does this > > /USR/BIN/RUBY1.8 /USR/BIN/MONGREL_RAILS START > > but mongrel_rails restart does this > RUBY /USR/LIB/RUBY/GEMS/1.8/GEMS/MONGREL-1.1.5/BIN/MONGREL_RAILS START > I have you tried mongrel_cluster_restart ? You can define a config file which says how many servers to startup, and what port # to start at (ie: 9000). You can also do a --clean to remove old pid files. -- Anthony Ettinger 408-656-2473 http://anthony.ettinger.name From lists at ruby-forum.com Wed Dec 10 05:36:43 2008 From: lists at ruby-forum.com (=?utf-8?Q?C=c3=a9d_B=2e?=) Date: Wed, 10 Dec 2008 11:36:43 +0100 Subject: [Mongrel] mongrel_cluster : up to 500 MiB memory Message-ID: Hi everyone, I've got some trouble with my RoR application running with apache (2.2.9) and mongrel (1.1.5). The site i manage has about 20'000 visits a day, and we run 14 mongrel instances switched with mongrel_cluster (1.0.5). The fact is, sometime, half of my mongrel instances are raising something like 500MiB memory and don't seem to work anymore. The server itself has 8 CPU's and 8Go of RAM. I read different how-to's about mongrel and mongrel_rails but most of them are just talking about how to start with mongrel. I would like to know if there is a way to monitor mongrel instance and/or how to improve my configuration? If anyone has a suggestion, it'll be very helpfull. -- Posted via http://www.ruby-forum.com/. From cnk at caltech.edu Wed Dec 10 15:20:34 2008 From: cnk at caltech.edu (Cynthia Kiser) Date: Wed, 10 Dec 2008 12:20:34 -0800 Subject: [Mongrel] mongrel_cluster : up to 500 MiB memory In-Reply-To: References: Message-ID: <20081210202034.GV27341@clyde.caltech.edu> You didn't specify exactly what you want to monitor but a lot of people use Monit to monitor their mongrel clusters: http://mmonit.com/monit/ I have also heard people talk about using 'god' http://weblog.redlinesoftware.com/2008/4/4/using-god-to-monitor-mongrels Quoting C??d B. : > Hi everyone, > > I've got some trouble with my RoR application running with apache > (2.2.9) and mongrel (1.1.5). > > The site i manage has about 20'000 visits a day, and we run 14 mongrel > instances switched with mongrel_cluster (1.0.5). The fact is, sometime, > half of my mongrel instances are raising something like 500MiB memory > and don't seem to work anymore. > > The server itself has 8 CPU's and 8Go of RAM. > > I read different how-to's about mongrel and mongrel_rails but most of > them are just talking about how to start with mongrel. > > I would like to know if there is a way to monitor mongrel instance > and/or how to improve my configuration? > > If anyone has a suggestion, it'll be very helpfull. From toolbag at gmail.com Thu Dec 11 21:05:32 2008 From: toolbag at gmail.com (Cody Caughlan) Date: Thu, 11 Dec 2008 18:05:32 -0800 Subject: [Mongrel] Disabling static file lookups? Message-ID: <749ead610812111805y635c08c5yfd3ae1cb4d881ba3@mail.gmail.com> In looking at a running mongrel process in strace and at the code itself Mongrel will always look for a file under "public" (with and without a .html extension). When those filesystem lookups fail, it then passes the request to Rails. So my question is, would you get more performance by disabling this lookup and just handing it off to Rails from the get go? I understand that in development, the current behavior is desired as Mongrel is acting as the primary HTTP server. But in production, with a HTTP server like Apache or nginx in front and configured to serve static files, then it might make sense to not have Mongrel concern itself with looking for static files. Maybe the OS caches those filesystem calls (stat cache?) and this would be a crazy premature optimization. Thoughts? /Cody From ezmobius at gmail.com Fri Dec 12 11:54:50 2008 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Fri, 12 Dec 2008 08:54:50 -0800 Subject: [Mongrel] Disabling static file lookups? In-Reply-To: <749ead610812111805y635c08c5yfd3ae1cb4d881ba3@mail.gmail.com> References: <749ead610812111805y635c08c5yfd3ae1cb4d881ba3@mail.gmail.com> Message-ID: <30C6EC93-9801-4CB0-9D47-88D2BD889A36@gmail.com> On Dec 11, 2008, at 6:05 PM, Cody Caughlan wrote: > In looking at a running mongrel process in strace and at the code > itself Mongrel will always look for a file under "public" (with and > without a .html extension). When those filesystem lookups fail, it > then passes the request to Rails. > > So my question is, would you get more performance by disabling this > lookup and just handing it off to Rails from the get go? > > I understand that in development, the current behavior is desired as > Mongrel is acting as the primary HTTP server. But in production, with > a HTTP server like Apache or nginx in front and configured to serve > static files, then it might make sense to not have Mongrel concern > itself with looking for static files. > > Maybe the OS caches those filesystem calls (stat cache?) and this > would be a crazy premature optimization. > > Thoughts? > > /Cody > You should be able to alter the railshandler to not do these lookups when a config option is set. Merb uses rack middleware to do the static pages and that can be easily turned off in production. I believe latest rails does this as well and maybe you can disable these checks with rack in rails as well? Cheers- Ezra Zygmuntowicz ez at engineyard.com From toolbag at gmail.com Fri Dec 12 11:57:50 2008 From: toolbag at gmail.com (Cody Caughlan) Date: Fri, 12 Dec 2008 08:57:50 -0800 Subject: [Mongrel] Disabling static file lookups? In-Reply-To: <30C6EC93-9801-4CB0-9D47-88D2BD889A36@gmail.com> References: <749ead610812111805y635c08c5yfd3ae1cb4d881ba3@mail.gmail.com> <30C6EC93-9801-4CB0-9D47-88D2BD889A36@gmail.com> Message-ID: <749ead610812120857w356397f2g885d0680e60f3715@mail.gmail.com> Ezra- thanks for your feedback. My greater question is: is it worth it, in the long run? Or is it too negligible? /Cody On Fri, Dec 12, 2008 at 8:54 AM, Ezra Zygmuntowicz wrote: > > On Dec 11, 2008, at 6:05 PM, Cody Caughlan wrote: > >> In looking at a running mongrel process in strace and at the code >> itself Mongrel will always look for a file under "public" (with and >> without a .html extension). When those filesystem lookups fail, it >> then passes the request to Rails. >> >> So my question is, would you get more performance by disabling this >> lookup and just handing it off to Rails from the get go? >> >> I understand that in development, the current behavior is desired as >> Mongrel is acting as the primary HTTP server. But in production, with >> a HTTP server like Apache or nginx in front and configured to serve >> static files, then it might make sense to not have Mongrel concern >> itself with looking for static files. >> >> Maybe the OS caches those filesystem calls (stat cache?) and this >> would be a crazy premature optimization. >> >> Thoughts? >> >> /Cody >> > > > You should be able to alter the railshandler to not do these lookups > when a config option is set. Merb uses rack middleware to do the static > pages and that can be easily turned off in production. I believe latest > rails does this as well and maybe you can disable these checks with rack in > rails as well? > > Cheers- > > Ezra Zygmuntowicz > ez at engineyard.com > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From ezmobius at gmail.com Fri Dec 12 12:09:42 2008 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Fri, 12 Dec 2008 09:09:42 -0800 Subject: [Mongrel] Disabling static file lookups? In-Reply-To: <749ead610812120857w356397f2g885d0680e60f3715@mail.gmail.com> References: <749ead610812111805y635c08c5yfd3ae1cb4d881ba3@mail.gmail.com> <30C6EC93-9801-4CB0-9D47-88D2BD889A36@gmail.com> <749ead610812120857w356397f2g885d0680e60f3715@mail.gmail.com> Message-ID: On Dec 12, 2008, at 8:57 AM, Cody Caughlan wrote: > Ezra- thanks for your feedback. > > My greater question is: is it worth it, in the long run? Or is it too > negligible? > > /Cody Hmm i bet it is probably worth it but only if you are trying to squeeze every last drop of perf out of your setup. A fast local filesystem does stats fairly quick and I doubt you will be bale to tell the difference. But if you have overtaxed disks or are using NFS or a shared filesystem of sorts then every littel bit helps to keep from touching the filesystem. So its probably worth it eventually when you get big but probably is not worth it until you actually know it is a problem. Cheers- Ezra Zygmuntowicz ez at engineyard.com From mtweil at sandia.gov Fri Dec 12 16:43:59 2008 From: mtweil at sandia.gov (Weil, Mark Thomas) Date: Fri, 12 Dec 2008 14:43:59 -0700 Subject: [Mongrel] Mongrel_cluster Message-ID: <6B0B38F590C7D14EAEB3B3DFAF6F8B6421C10A8C6E@ES04SNLNT.srn.sandia.gov> Hello, I am having to restart my mongrel_cluster instances every morning because they are hung. Has anyone else had this problem. I am running Red-Hat 5.0 and Mongrel_cluster (1.0.5) and Apache (2.2.3). I have a strace of the mongrel_cluster when it is hung. --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0) = 1784 accept(3, {sa_family=AF_INET, sin_port=htons(35255), sin_addr=inet_addr("127.0.0.1")}, [16]) = 788 fcntl(788, F_GETFL) = 0x2 (flags O_RDWR) fstat(788, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b1082bd8000 lseek(788, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl(788, F_GETFL) = 0x2 (flags O_RDWR) fstat(788, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b1082bd9000 lseek(788, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) setsockopt(788, SOL_TCP, TCP_CORK, [1], 4) = 0 select(789, [788], [6], [], {0, 0}) = 1 (in [788], left {0, 0}) select(8, [3], [6], [], {0, 0}) = 0 (Timeout) read(788, "GET / HTTP/1.1\r\nHost: 127.0.0.1:"..., 16384) = 600 getpeername(788, {sa_family=AF_INET, sin_port=htons(35255), sin_addr=inet_addr("127.0.0.1")}, [9377430658336423952]) = 0 stat("/opt/web/cee/cee/public", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat("/opt/web/cee/cee/public", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat("/opt/web/cee/cee/public/index.html", 0x7fff34252b70) = -1 ENOENT (No such file or directory) stat("/opt/web/cee/cee/public/.html", 0x7fff34252820) = -1 ENOENT (No such file or directory) select(8, [3], [6], [], {0, 5860}) = 0 (Timeout) -- Thank You, ----------------- Mark T. Weil -------------- next part -------------- An HTML attachment was scrubbed... URL: From rochkind at jhu.edu Fri Dec 12 17:05:12 2008 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Fri, 12 Dec 2008 17:05:12 -0500 Subject: [Mongrel] Mongrel_cluster In-Reply-To: <6B0B38F590C7D14EAEB3B3DFAF6F8B6421C10A8C6E@ES04SNLNT.srn.sandia.gov> References: <6B0B38F590C7D14EAEB3B3DFAF6F8B6421C10A8C6E@ES04SNLNT.srn.sandia.gov> Message-ID: <4942E018.9030207@jhu.edu> I don't have mongrels hanging, but I _do_ have mongrels that cease to exist without leaving anything in the logs at all. Very odd. Jonathan Weil, Mark Thomas wrote: > Hello, > > I am having to restart my mongrel_cluster instances every morning because they are hung. > Has anyone else had this problem. > > I am running Red-Hat 5.0 and Mongrel_cluster (1.0.5) and Apache (2.2.3). > > I have a strace of the mongrel_cluster when it is hung. > > --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- > rt_sigreturn(0) = 1784 > accept(3, {sa_family=AF_INET, sin_port=htons(35255), sin_addr=inet_addr("127.0.0.1")}, [16]) = 788 > fcntl(788, F_GETFL) = 0x2 (flags O_RDWR) > fstat(788, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b1082bd8000 > lseek(788, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) > fcntl(788, F_GETFL) = 0x2 (flags O_RDWR) > fstat(788, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b1082bd9000 > lseek(788, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) > setsockopt(788, SOL_TCP, TCP_CORK, [1], 4) = 0 > select(789, [788], [6], [], {0, 0}) = 1 (in [788], left {0, 0}) > select(8, [3], [6], [], {0, 0}) = 0 (Timeout) > read(788, "GET / HTTP/1.1\r\nHost: 127.0.0.1:"..., 16384) = 600 getpeername(788, {sa_family=AF_INET, sin_port=htons(35255), sin_addr=inet_addr("127.0.0.1")}, [9377430658336423952]) = 0 stat("/opt/web/cee/cee/public", {st_mode=S_IFDIR|0755, st_size=4096, > ...}) = 0 > stat("/opt/web/cee/cee/public", {st_mode=S_IFDIR|0755, st_size=4096, > ...}) = 0 > stat("/opt/web/cee/cee/public/index.html", 0x7fff34252b70) = -1 ENOENT (No such file or directory) stat("/opt/web/cee/cee/public/.html", 0x7fff34252820) = -1 ENOENT (No such file or directory) > select(8, [3], [6], [], {0, 5860}) = 0 (Timeout) > > > > -- > Thank You, > ----------------- > Mark T. Weil > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -- Jonathan Rochkind Digital Services Software Engineer The Sheridan Libraries Johns Hopkins University 410.516.8886 rochkind (at) jhu.edu From lists at ruby-forum.com Fri Dec 12 22:27:51 2008 From: lists at ruby-forum.com (Steve Meyer) Date: Sat, 13 Dec 2008 04:27:51 +0100 Subject: [Mongrel] "service mongrel_cluster start" startup fails In-Reply-To: <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> References: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> Message-ID: <82a18437e66d13591a496769254211d2@ruby-forum.com> David Vrensk wrote: > On Mon, Sep 15, 2008 at 4:44 AM, Steve Meyer > wrote: > >> I've attempted to configure mongrel to start as a service in RHEL. >> I've copied mongrel_cluster to /etc/init.d and >> "#/etc/init.d/mongrel_cluster start" does work. However when I attempt >> to start mongrel_cluster using "service mongrel_cluster start" I get the >> following error: >> service mongrel_cluster start >> /usr/bin/env: ruby: No such file or directory > > > "service" gives a better picture of what will happen on boot since it > sets > up the environment as it would be for the init process that runs all the > little start scripts. In this case, it looks like ruby is not in the > default path. Read the man-page for 'service' for a little more > information > and try creating a simple script in /etc/init.d that just prints out the > environment variables, like this (untested): > > ---------------8<-------- > #! /bin/sh > env > -------------8<--------- > > Make it executable and run it with "service name_of_script start" to see > what it prints. It's not the solution to your problem, but it's a > start. > > /David I did get past this but now the "service mongrel_cluster" fails with the following; (i've added the env command to the script) service mongrel_cluster start TERM=xterm PATH=/sbin:/usr/sbin:/bin:/usr/bin PWD=/ LANG=en_US.UTF-8 SHLVL=1 _=/bin/env /usr/bin/mongrel_cluster_ctl:9:in `require': no such file to load -- rubygems (LoadError) from /usr/bin/mongrel_cluster_ctl:9 While /init.d/mongrel_cluster start works and the env info is; SHELL=/bin/bash TERM=xterm HISTSIZE=1000 USER=sfcapp LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin MAIL=/var/spool/mail/root PWD=/etc/init.d INPUTRC=/etc/inputrc LANG=en_US.UTF-8 SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass HOME=/root SHLVL=2 LOGNAME=root CVS_RSH=ssh SSH_CONNECTION=9.65.247.187 3708 9.54.168.71 22 LESSOPEN=|/usr/bin/lesspipe.sh %s G_BROKEN_FILENAMES=1 _=/bin/env I have tried adding /usr/local/bin to the path; didn't work -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Dec 12 22:30:01 2008 From: lists at ruby-forum.com (Steve Meyer) Date: Sat, 13 Dec 2008 04:30:01 +0100 Subject: [Mongrel] "service mongrel_cluster start" startup fails In-Reply-To: <82a18437e66d13591a496769254211d2@ruby-forum.com> References: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> <82a18437e66d13591a496769254211d2@ruby-forum.com> Message-ID: Steve Meyer wrote: If you have the mongrel_cluster working on a linux box; could you print out the result of the env command as you have it? -- Posted via http://www.ruby-forum.com/. From david at vrensk.com Sun Dec 14 18:41:47 2008 From: david at vrensk.com (David Vrensk) Date: Mon, 15 Dec 2008 00:41:47 +0100 Subject: [Mongrel] "service mongrel_cluster start" startup fails In-Reply-To: References: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> <82a18437e66d13591a496769254211d2@ruby-forum.com> Message-ID: <81b453920812141541i486d0c92v6d3134b18cc9488b@mail.gmail.com> On Sat, Dec 13, 2008 at 04:30, Steve Meyer wrote: > Steve Meyer wrote: > > > If you have the mongrel_cluster working on a linux box; could you print > out the result of the env command as you have it? > [root at blade init.d]# service envtest start TERM=xterm-color PATH=/sbin:/usr/sbin:/bin:/usr/bin PWD=/ LANG=en_US.UTF-8 SHLVL=1 _=/bin/env and, not unimportantly: [root at blade init.d]# which ruby /usr/bin/ruby /David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at vrensk.com Sun Dec 14 18:47:47 2008 From: david at vrensk.com (David Vrensk) Date: Mon, 15 Dec 2008 00:47:47 +0100 Subject: [Mongrel] "service mongrel_cluster start" startup fails In-Reply-To: <82a18437e66d13591a496769254211d2@ruby-forum.com> References: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> <82a18437e66d13591a496769254211d2@ruby-forum.com> Message-ID: <81b453920812141547i17ce9dbbl19a37528034929d@mail.gmail.com> On Sat, Dec 13, 2008 at 04:27, Steve Meyer wrote: > > I did get past this but now the "service mongrel_cluster" fails with the > following; (i've added the env command to the script) > service mongrel_cluster start > TERM=xterm > PATH=/sbin:/usr/sbin:/bin:/usr/bin > PWD=/ > LANG=en_US.UTF-8 > SHLVL=1 > _=/bin/env > /usr/bin/mongrel_cluster_ctl:9:in `require': no such file to load -- > rubygems (LoadError) > from /usr/bin/mongrel_cluster_ctl:9 > > While /init.d/mongrel_cluster start works and the env info is; > SHELL=/bin/bash > TERM=xterm > HISTSIZE=1000 > USER=sfcapp > > PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin > [...] I have tried adding /usr/local/bin to the path; didn't work > Let me be clear on this... did you add /usr/local/bin to the path in such a way that 'service mongrel_cluster start' showed PATH=/usr/local/bin:..., but the cluster did still not start? Or do you mean that you didn't succeed in adding /usr/local/bin to the path? Or something else? Seeing as three months have gone and we're now in a different era, you could have a go at setting up apache with mod_rails instead. The time might be better spent there; I understand that mod_rails (Fusion passenger) is a nice experience. Good luck! /David -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtweil at sandia.gov Tue Dec 16 13:33:39 2008 From: mtweil at sandia.gov (Weil, Mark Thomas) Date: Tue, 16 Dec 2008 11:33:39 -0700 Subject: [Mongrel] Mongrel_cluster hangs Message-ID: <6B0B38F590C7D14EAEB3B3DFAF6F8B6421C10A9023@ES04SNLNT.srn.sandia.gov> Hello, I am having to restart my mongrel_cluster instances every morning because they are hung. Has anyone else had this problem. I am running Red-Hat 5.0 and Mongrel_cluster (1.0.5) and Apache (2.2.3). I have a strace of the mongrel_cluster when it is hung. --- SIGVTALRM (Virtual timer expired) @ 0 (0) --- rt_sigreturn(0) = 1784 accept(3, {sa_family=AF_INET, sin_port=htons(35255), sin_addr=inet_addr("127.0.0.1")}, [16]) = 788 fcntl(788, F_GETFL) = 0x2 (flags O_RDWR) fstat(788, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b1082bd8000 lseek(788, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl(788, F_GETFL) = 0x2 (flags O_RDWR) fstat(788, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b1082bd9000 lseek(788, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) setsockopt(788, SOL_TCP, TCP_CORK, [1], 4) = 0 select(789, [788], [6], [], {0, 0}) = 1 (in [788], left {0, 0}) select(8, [3], [6], [], {0, 0}) = 0 (Timeout) read(788, "GET / HTTP/1.1\r\nHost: 127.0.0.1:"..., 16384) = 600 getpeername(788, {sa_family=AF_INET, sin_port=htons(35255), sin_addr=inet_addr("127.0.0.1")}, [9377430658336423952]) = 0 stat("/opt/web/cee/cee/public", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat("/opt/web/cee/cee/public", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat("/opt/web/cee/cee/public/index.html", 0x7fff34252b70) = -1 ENOENT (No such file or directory) stat("/opt/web/cee/cee/public/.html", 0x7fff34252820) = -1 ENOENT (No such file or directory) select(8, [3], [6], [], {0, 5860}) = 0 (Timeout) -- Thank You, ----------------- Mark T. Weil Sandia National Labs -------------- next part -------------- An HTML attachment was scrubbed... URL: From sokaos at gmail.com Tue Dec 16 15:30:58 2008 From: sokaos at gmail.com (Sylvain Petit) Date: Tue, 16 Dec 2008 21:30:58 +0100 Subject: [Mongrel] Problem launching mongrel Message-ID: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> Hello. I use capistrano with mongrel and apache. When I cap deploy:start, It launches nothing. So I : sd-17133:/var/rails/canardps3/current# mongrel_cluster_ctl start Starting all mongrel_clusters... /usr/local/bin/mongrel_cluster_ctl:7:in `chdir': No such file or directory - /etc/mongrel_cluster (Errno::ENOENT) from /usr/local/bin/mongrel_cluster_ctl:7:in `run' from /usr/local/bin/mongrel_cluster_ctl:55 guess it may be the problem. Any idea on what can I do to fix this ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From seatmanu at gmail.com Tue Dec 16 15:37:57 2008 From: seatmanu at gmail.com (Emmanuel Pinault) Date: Tue, 16 Dec 2008 12:37:57 -0800 Subject: [Mongrel] Problem launching mongrel In-Reply-To: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> References: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> Message-ID: <8F38A0EA-7397-4525-B8EC-545611F25434@gmail.com> clearly you are missing a configuration file on the server. /etc/ mongrel_cluster.. you need to create a configuration file to start your mongrel cluster. It first looks into your rails config directory and then in /etc/mongrel_clusters. Emmanuel On Dec 16, 2008, at 12:30 PM, Sylvain Petit wrote: > Hello. > > I use capistrano with mongrel and apache. > > When I cap deploy:start, It launches nothing. So I : > sd-17133:/var/rails/canardps3/current# mongrel_cluster_ctl start > Starting all mongrel_clusters... > /usr/local/bin/mongrel_cluster_ctl:7:in `chdir': No such file or > directory - /etc/mongrel_cluster (Errno::ENOENT) > from /usr/local/bin/mongrel_cluster_ctl:7:in `run' > from /usr/local/bin/mongrel_cluster_ctl:55 > guess it may be the problem. Any idea on what can I do to fix this ? > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From ettinger at gmail.com Tue Dec 16 15:39:14 2008 From: ettinger at gmail.com (Anthony Ettinger) Date: Tue, 16 Dec 2008 12:39:14 -0800 Subject: [Mongrel] Problem launching mongrel In-Reply-To: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> References: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> Message-ID: <3fc6b2fb0812161239q53eb6686i84f5136d6c6e8bdc@mail.gmail.com> Have you tried passing a configuration file in? I have my config file for prod, qa, etc. under ./config/{environment}_mongrel.conf The cluster can be started with -c ./path/to/config/file (which has startup directory, ports, etc)...or you can create a directory in /etc/mongrel_cluster that has symlinks to all your config files for each environment. On Tue, Dec 16, 2008 at 12:30 PM, Sylvain Petit wrote: > Hello. > > I use capistrano with mongrel and apache. > > When I cap deploy:start, It launches nothing. So I : > sd-17133:/var/rails/canardps3/current# mongrel_cluster_ctl start > Starting all mongrel_clusters... > /usr/local/bin/mongrel_cluster_ctl:7:in `chdir': No such file or > directory - /etc/mongrel_cluster (Errno::ENOENT) > from /usr/local/bin/mongrel_cluster_ctl:7:in `run' > from /usr/local/bin/mongrel_cluster_ctl:55 > guess it may be the problem. Any idea on what can I do to fix this ? > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Anthony Ettinger 408-656-2473 http://anthony.ettinger.name From counterveil at gmail.com Tue Dec 16 15:40:22 2008 From: counterveil at gmail.com (Christopher Opena) Date: Tue, 16 Dec 2008 12:40:22 -0800 Subject: [Mongrel] Problem launching mongrel In-Reply-To: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> References: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> Message-ID: <3a96987f0812161240m760ce195x843f6bc61c9f2dfe@mail.gmail.com> Sylvain, can you post your mongrel_cluster_ctl to the list? It looks like your start script is trying to find a file but it's not there. On Tue, Dec 16, 2008 at 12:30 PM, Sylvain Petit wrote: > Hello. > > I use capistrano with mongrel and apache. > > When I cap deploy:start, It launches nothing. So I : > sd-17133:/var/rails/canardps3/current# mongrel_cluster_ctl start > Starting all mongrel_clusters... > /usr/local/bin/mongrel_cluster_ctl:7:in `chdir': No such file or > directory - /etc/mongrel_cluster (Errno::ENOENT) > from /usr/local/bin/mongrel_cluster_ctl:7:in `run' > from /usr/local/bin/mongrel_cluster_ctl:55 > guess it may be the problem. Any idea on what can I do to fix this ? > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sokaos at gmail.com Tue Dec 16 15:47:29 2008 From: sokaos at gmail.com (Sylvain Petit) Date: Tue, 16 Dec 2008 21:47:29 +0100 Subject: [Mongrel] Problem launching mongrel In-Reply-To: <8F38A0EA-7397-4525-B8EC-545611F25434@gmail.com> References: <3fc28870812161230l1fe93edl9551a15ac225e46@mail.gmail.com> <8F38A0EA-7397-4525-B8EC-545611F25434@gmail.com> Message-ID: <3fc28870812161247i409c3c41q8a49a3ea576edd7f@mail.gmail.com> Ok, I get the config file, but in fact this don't make the cap deploy:start working. Some information : my script/spin : #!/bin/sh /var/rails/canardps3/current/script/process/spawner \ mongrel \ --environment=production \ --instances=1 \ --address=127.0.0.1 \ --port=8000 my spawner : #!/usr/bin/env ruby require File.dirname(*__FILE__*) + '/../../config/boot' require 'commands/process/spawner' I got no error except C:\railsapp\canardps3>cap deploy:start * executing `deploy:start' * executing "cd /var/rails/canardps3/current && sudo -p 'sudo password: ' -u s obert nohup script/spin" servers: ["canardpsn.sobert.net"] [canardpsn.sobert.net] executing command *** [err :: canardpsn.sobert.net] ** Ruby version is not up-to-date; loading cgi _multipart_eof_fix *** [err :: canardpsn.sobert.net] ** [out :: canardpsn.sobert.net] => Starting mongrel dispatchers ** [out :: canardpsn.sobert.net] Checking if something is already running on 12 7.0.0.1:8000...NO ** [out :: canardpsn.sobert.net] Starting dispatcher on port: 127.0.0.1:8000 *** [err :: canardpsn.sobert.net] ** Ruby version is not up-to-date; loading cgi _multipart_eof_fix *** [err :: canardpsn.sobert.net] command finished but a ps aux | grep mongrel isn't returning a thing. Were can I find some clue ? On Tue, Dec 16, 2008 at 9:37 PM, Emmanuel Pinault wrote: > clearly you are missing a configuration file on the server. > /etc/mongrel_cluster.. you need to create a configuration file to start your > mongrel cluster. It first looks into your rails config directory and then in > /etc/mongrel_clusters. > > Emmanuel > > On Dec 16, 2008, at 12:30 PM, Sylvain Petit wrote: > > Hello. >> >> I use capistrano with mongrel and apache. >> >> When I cap deploy:start, It launches nothing. So I : >> sd-17133:/var/rails/canardps3/current# mongrel_cluster_ctl start >> Starting all mongrel_clusters... >> /usr/local/bin/mongrel_cluster_ctl:7:in `chdir': No such file or >> directory - /etc/mongrel_cluster (Errno::ENOENT) >> from /usr/local/bin/mongrel_cluster_ctl:7:in `run' >> from /usr/local/bin/mongrel_cluster_ctl:55 >> guess it may be the problem. Any idea on what can I do to fix this ? >> >> >> >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >> > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Dec 17 01:20:25 2008 From: lists at ruby-forum.com (Steve Meyer) Date: Wed, 17 Dec 2008 07:20:25 +0100 Subject: [Mongrel] "service mongrel_cluster start" startup fails In-Reply-To: <81b453920812141547i17ce9dbbl19a37528034929d@mail.gmail.com> References: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> <82a18437e66d13591a496769254211d2@ruby-forum.com> <81b453920812141547i17ce9dbbl19a37528034929d@mail.gmail.com> Message-ID: <5a73a09f823d5704a0333c54f1f8809e@ruby-forum.com> I did add /usr/local/bin to the path in the mongrel_cluster file and I still had issues; these were other ruby issues. What I ended up doing was creating a custom file to do the start and stop. That worked and I did have to add /usr/local/bin to the path. I've pasted in the file I created; I am sure there are issues with it. But it works... Thanks for your help the path suggestion was key to my getting this to work. #!/bin/sh ########################################################################### # chkconfig: - 85 35 # description: Mongrel Rails appserver # processname: mongrel_rails # config: /home/sfcapp/sfc/current/config/mongrel_cluster.yml # export PATH=$PATH:/usr/local/bin export SFCAPPHOME="/home/sfcapp/sfc" export CURRENT_DIR="$SFCAPPHOME/current/config" export MONGREL_RAILS="/usr/local/bin/mongrel_rails" echo $SFCAPPHOME $CURRENT_DIR $MONGREL_RAILS case "$1" in start) /usr/local/bin/mongrel_rails cluster::start -C /home/sfcapp/sfc/current/config/ mongrel_cluster.yml ;; stop) /usr/local/bin/mongrel_rails cluster::stop -C /home/sfcapp/sfc/current/config/m ongrel_cluster.yml ;; restart) /usr/local/bin/mongrel_rails cluster::stop -C /home/sfcapp/sfc/current/config/mongrel_cluster.yml /usr/local/bin/mongrel_rails cluster::start -C /home/sfcapp/sfc/current/config/mongrel_cluster.yml ;; *) echo "usage start | stop | restart" ;; esac -- Posted via http://www.ruby-forum.com/. From singhi.surendra at gmail.com Thu Dec 18 04:14:50 2008 From: singhi.surendra at gmail.com (Surendra Singhi) Date: Thu, 18 Dec 2008 14:44:50 +0530 Subject: [Mongrel] rails 2.2 upload progress handler Message-ID: Hello, I am trying to change my rails 1.2.6 application to rails 2.2 I have made all the other changes and able to make everything work except upload progress. When I try to start the mongrel server using the command mongrel_rails start -S config/mongrel.conf it throws the error ** Rails loaded. ** Loading any Rails specific GemPlugins ** Loading config/mongrel.conf external config script /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:163:in `create': Plugin category /handlers does not exist (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:263:in `plugin' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:348:in `run_config' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:347:in `open_uri_original_open' from /usr/lib/ruby/1.8/open-uri.rb:32:in `open' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:347:in `run_config' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:121:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 the config/mongrel.conf contains uri "/", :handler => plugin("/handlers/upload", :path_info => '/upload/create', :memcached => UPLOAD_PROGRESS_CACHE), :in_front => true We are using memcache to store the upload progress info. This works smoothly in Rails 1.2.6. What has changed in the new rails version which is causing this error, how to get it working? Any help on this issue will be much appreciated. Thanks in advance. Regards, -- Surendra Singhi http://www.kreeti.com From lists at ruby-forum.com Fri Dec 19 06:04:44 2008 From: lists at ruby-forum.com (Roger Pack) Date: Fri, 19 Dec 2008 12:04:44 +0100 Subject: [Mongrel] feature request: output well in windows Message-ID: I realize not many people will benefit from this, but it would be nice if mongrel_rails, in development mode, output the tail of its log "with" color output on windows. Currently it outputs it with the Linux style coloration marking which is somewhat confusing. Thanks! -=R -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Sat Dec 20 13:17:21 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 20 Dec 2008 16:17:21 -0200 Subject: [Mongrel] feature request: output well in windows In-Reply-To: References: Message-ID: <71166b3b0812201017v2b7c007fpd9d2d486b770a9c@mail.gmail.com> On Fri, Dec 19, 2008 at 9:04 AM, Roger Pack wrote: > I realize not many people will benefit from this, but it would be nice > if mongrel_rails, in development mode, output the tail of its log "with" > color output on windows. > Currently it outputs it with the Linux style coloration marking which is > somewhat confusing. Is not possible. For that mongrel will require to depend on win32console to capture ANSI coloring and output colored strings. ANSI coloring differs from Windows coloring since Windows allow page locks and memory buffers to be updated. In that front, ANSI is dumb. If you want color highlight use tail from msys ;-) Anyway, now I realize it better, mongrel_rails doesn't output with colors, the one that outputs is Rails to log/development.log. Regards, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From lists at ruby-forum.com Sat Dec 20 14:20:29 2008 From: lists at ruby-forum.com (Roger Pack) Date: Sat, 20 Dec 2008 20:20:29 +0100 Subject: [Mongrel] feature request: output well in windows In-Reply-To: <71166b3b0812201017v2b7c007fpd9d2d486b770a9c@mail.gmail.com> References: <71166b3b0812201017v2b7c007fpd9d2d486b770a9c@mail.gmail.com> Message-ID: > Is not possible. > > For that mongrel will require to depend on win32console to capture > ANSI coloring and output colored strings. Interesting. Thanks for the info :) -=R -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Dec 22 03:42:07 2008 From: lists at ruby-forum.com (Roger Pack) Date: Mon, 22 Dec 2008 09:42:07 +0100 Subject: [Mongrel] garbage collection patch In-Reply-To: References: <20080207010232.539031f2.zedshaw@zedshaw.com> <760a9e3fd5b13395243343723f9e77bc@ruby-forum.com> Message-ID: Evan Weaver wrote: > Disabling GC around the requests would guarantee that the size of the > Mongrel process will balloon to the size of all objects combined in > the most heavyweight request. Remember that the Ruby heap never > returns space to the OS. As soon as you re-enable the GC, the entire > Ruby heap (now 4-5x bigger than it normally would be) will get paged > back in to physical RAM. > One thing that could be done is to force a GC every "x" requests--that way a GC is for sure run between requests [at least with single threaded rails] and that way the stack is most shallow and the GC will not pick up ghost references left on the stack. But hopefully we won't have to worry about that soon :) -=R -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Dec 31 09:32:33 2008 From: lists at ruby-forum.com (Roger Pack) Date: Wed, 31 Dec 2008 15:32:33 +0100 Subject: [Mongrel] mongrel_cluster : up to 500 MiB memory In-Reply-To: References: Message-ID: <2e0ad10b84c856d3b1a944a5ff835595@ruby-forum.com> C?d B. wrote: > Hi everyone, > > I've got some trouble with my RoR application running with apache > (2.2.9) and mongrel (1.1.5). > > The site i manage has about 20'000 visits a day, and we run 14 mongrel > instances switched with mongrel_cluster (1.0.5). The fact is, sometime, > half of my mongrel instances are raising something like 500MiB memory > and don't seem to work anymore. There are some patches on ruby-core that discuss a sweller GC maybe that would help. http://www.ruby-forum.com/topic/170608#new -- Posted via http://www.ruby-forum.com/.