From elliott at hitfix.com Tue Feb 3 19:58:49 2009 From: elliott at hitfix.com (Elliott Blatt) Date: Tue, 3 Feb 2009 19:58:49 -0500 Subject: [Mongrel] How to hack a mongrel cluster to restart in an alternating manner? Message-ID: <3f7ec04a0902031658g15869f2dsd432bf98b8e1c229@mail.gmail.com> Hello, I've been trying (unsuccessfully) to hack my mongrel_cluster to re-ststart in an alternating manner. Specifically, this soluiton: http://blog.carlmercier.com/2007/09/07/a-better-approach-to-restarting-a-mongrel-cluster/#content Which means I an call to mongrel_rails cluster::restart to do this: mongrel_rails start 8001 mongrel_rails stop 8001 mongrel_rails start 8002 mongrel_rails stop 8002 mongrel_rails start 8003 mongrel_rails stop 8003 mongrel_rails start 8004 mongrel_rails stop 8004 Instead of: mongrel_rails stop 8001 mongrel_rails stop 8002 mongrel_rails stop 8003 mongrel_rails stop 8004 [.....503....application offline.....] mongrel_rails start 8001 mongrel_rails start 8002 mongrel_rails start 8003 mongrel_rails start 8004 (yuck!) It's has been very difficult for me to figure out where to install the hacked mongrel_cluster_ctl that Carl provides in his blog. The execution path is not clear. Would anyone be willing to give me some ideas? Thank you, Elliott -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuyeow at gmail.com Tue Feb 3 20:23:03 2009 From: chuyeow at gmail.com (Cheah Chu Yeow) Date: Wed, 4 Feb 2009 09:23:03 +0800 Subject: [Mongrel] How to hack a mongrel cluster to restart in an alternating manner? In-Reply-To: <3f7ec04a0902031658g15869f2dsd432bf98b8e1c229@mail.gmail.com> References: <3f7ec04a0902031658g15869f2dsd432bf98b8e1c229@mail.gmail.com> Message-ID: <74ce3950902031723u6a018936m1405908c58a8df17@mail.gmail.com> I've had success with Eden Li's patch here: http://rubyforge.org/tracker/index.php?func=detail&aid=15427&group_id=1306&atid=5147. Been using it in several production deploys for about 2 months. If you're interested (and too lazy to apply the patch yourself) you can take a look at my fork of mongrel that has mongrel_cluster doing rolling restarts here: http://github.com/chuyeow/mongrel/commits/stable_1-1 You need to clone the repos, go into the projects/mongrel_cluster directory, and run a rake task to package the gem. Cheers, Chu Yeow On Wed, Feb 4, 2009 at 8:58 AM, Elliott Blatt wrote: > Hello, > > I've been trying (unsuccessfully) to hack my mongrel_cluster to re-ststart > in an alternating manner. > > Specifically, this soluiton: > http://blog.carlmercier.com/2007/09/07/a-better-approach-to-restarting-a-mongrel-cluster/#content > > Which means I an call to mongrel_rails cluster::restart to do this: > > mongrel_rails start 8001 > mongrel_rails stop 8001 > > mongrel_rails start 8002 > mongrel_rails stop 8002 > > mongrel_rails start 8003 > mongrel_rails stop 8003 > > mongrel_rails start 8004 > mongrel_rails stop 8004 > > Instead of: > > mongrel_rails stop 8001 > mongrel_rails stop 8002 > mongrel_rails stop 8003 > mongrel_rails stop 8004 > > [.....503....application offline.....] > > mongrel_rails start 8001 > mongrel_rails start 8002 > mongrel_rails start 8003 > mongrel_rails start 8004 > > (yuck!) > > It's has been very difficult for me to figure out where to install the > hacked mongrel_cluster_ctl that Carl provides in his blog. > The execution path is not clear. > > Would anyone be willing to give me some ideas? > > Thank you, > Elliott > > > _______________________________________________ > 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 Feb 4 09:20:10 2009 From: lists at ruby-forum.com (John Nestoriak) Date: Wed, 4 Feb 2009 15:20:10 +0100 Subject: [Mongrel] Mongrel server file descriptor leak? Message-ID: Excuse my ignorance for I'm a RoR newby. We have a number of RoR applications running on a server with a cPanel installation. One of the clients sites went belly up with the error message: Errno::EMFILE Too many open files - socket(2) Digging a bit I found that the mongrel server had a large number of sockets open and appears to be leaking them fairly frequently. The lsof looks like this mongrel_r 11184 username 193u unix 0xda4fa480 637209350 socket mongrel_r 11184 username 194u unix 0xf685a680 637408911 socket mongrel_r 11184 username 195u unix 0xcc2ea3c0 637684747 socket The application doesn't do anything explicitly with sockets. As far as I know the RoR installation is standard - from what I understand the hosting company support installed it and RoR is only semi-supported by cPanel so they're somewhat reluctant/lack the knowledge to be of much assistance? I did google searches of every combination of ruby/rails/socket/leak/ cPanel/file descriptor/etc that I could think of and didn't find anything. I'm not exactly sure of what versions of ruby/rails/mongrel we have installed but didn't find anything about this being a known issue that had been fixed. I'd warrant a guess that we're not running the bleeding edge at any rate and are likely a few versions behind but again I'm not entirely sure how ruby is installed/managed under cPanel/ WHM. Any ideas on where to look further or what the issue could be? -- Posted via http://www.ruby-forum.com/. From bgrant01101 at gmail.com Wed Feb 4 13:10:35 2009 From: bgrant01101 at gmail.com (benjamin grant) Date: Wed, 4 Feb 2009 10:10:35 -0800 Subject: [Mongrel] Mongrel server file descriptor leak? In-Reply-To: References: Message-ID: <5adf07c80902041010l78da64dem61c8994d7b706670@mail.gmail.com> Can you post the content of your mongrel_cluster.yml (or equivalent command line options in use) & mongrel version...? Also the output of "ulimit -a" for the mongrel process owner. -- On Wed, Feb 4, 2009 at 6:20 AM, John Nestoriak wrote: > Excuse my ignorance for I'm a RoR newby. > > We have a number of RoR applications running on a server with a cPanel > installation. One of the clients sites went belly up with the error > message: > Errno::EMFILE > Too many open files - socket(2) > > Digging a bit I found that the mongrel server had a large number of > sockets open and appears to be leaking them fairly frequently. The > lsof looks like this > > mongrel_r 11184 username 193u unix 0xda4fa480 637209350 socket > mongrel_r 11184 username 194u unix 0xf685a680 637408911 socket > mongrel_r 11184 username 195u unix 0xcc2ea3c0 637684747 socket > > The application doesn't do anything explicitly with sockets. As far as > I know the RoR installation is standard - from what I understand the > hosting company support installed it and RoR is only semi-supported by > cPanel so they're somewhat reluctant/lack the knowledge to be of much > assistance? > > I did google searches of every combination of ruby/rails/socket/leak/ > cPanel/file descriptor/etc that I could think of and didn't find > anything. I'm not exactly sure of what versions of ruby/rails/mongrel > we have installed but didn't find anything about this being a known > issue that had been fixed. I'd warrant a guess that we're not running > the bleeding edge at any rate and are likely a few versions behind but > again I'm not entirely sure how ruby is installed/managed under cPanel/ > WHM. > > Any ideas on where to look further or what the issue could be? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > 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 Fri Feb 6 10:35:17 2009 From: lists at ruby-forum.com (Marc Chapman) Date: Fri, 6 Feb 2009 16:35:17 +0100 Subject: [Mongrel] Problems with Mongrel > 1.1 and OS X In-Reply-To: References: Message-ID: <9513e63227f5d7b78936dfc0fd32d46b@ruby-forum.com> Anthony Green wrote: > But from gem version 1.1.1 both processes stall immediately > > I can get it to continue by attempting to force quit with CTRL -C > > system info > > Mac OS X 10.5.5 > Ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-darwin9.5.0] > > And > > Mac OS X 10.5.5 > Ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.5.0] I'm noticing the exact same problem with Tiger (10.4) on a PPC. If you figured out the problem, I'd love to hear it. -- Posted via http://www.ruby-forum.com/. From greg.hauptmann.ruby at gmail.com Mon Feb 9 03:27:27 2009 From: greg.hauptmann.ruby at gmail.com (Greg Hauptmann) Date: Mon, 9 Feb 2009 18:27:27 +1000 Subject: [Mongrel] "reaper" is not picking up new changes to my application??? Message-ID: Hi, Can anyone shed any light on why "reaper" (whilst seemingly working re restarting my mongrel ruby process) does not pick up changes to my application? (e.g. changing a title in a view for example). It's like the "mongrel_rails start etc..." is just restarting the current process but ignoring the new details re where the new application directory is. That is with capistrano the new releases are put in different directories, and are referenced in the command line options to "mongrel_rails", however it seems these are being picked up. I basically have to do a "reaper -a kill" and then a "nohup script/spin" to get it to recognize the new application directory. Here's an example of the scenario when I run reaper, the ruby processes is restarted, but it doesn't pick up the new directory (i.e. application changes). -- CONSOLE OUTPUT --- [root at home ~]# cd /u/apps/equity/current/ [root at home current]# ./script/process/reaper Restarting 4453 [root at home current]# -- MONGREL LOG EXTRACT -- ** USR2 signal received. ** Restarting with arguments: ruby /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails start -d -a 0.0.0.0 -p 3001 -P /u/apps/equity/releases/20090209050120/tmp/pids/dispatch.3001.pid -e production -c /u/apps/equity/releases/20090209050120 -l /u/apps/equity/releases/20090209050120/log/mongrel.log ** Daemonized, any open files are closed. Look at /u/apps/equity/releases/20090209050120/tmp/pids/dispatch.3001.pid and /u/apps/equity/releases/20090209050120/log/mongrel.log for info. ** Starting Mongrel listening at 0.0.0.0:3001 ** Starting Rails with production environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel 1.1.5 available at 0.0.0.0:3001 ** Writing PID file to /u/apps/equity/releases/20090209050120/tmp/pids/dispatch.3001.pid Thanks -- Greg http://blog.gregnet.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Feb 10 08:07:54 2009 From: lists at ruby-forum.com (Leo Joe) Date: Tue, 10 Feb 2009 14:07:54 +0100 Subject: [Mongrel] fastthread error Message-ID: Is anybody testing mongrel on ruby 1.9.1 I just tried installing mongrel and got this error [root at mysql02 fastthread-1.0.1]# gem install mongrel Building native extensions. This could take a while... /usr/local/lib/ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /bin in PATH, mode 040777 ERROR: Error installing mongrel: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb install mongrel creating Makefile make gcc -I. -I/usr/local/include/ruby-1.9.1/i686-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -O2 -g -Wall -Wno-parentheses -o fastthread.o -c fastthread.c fastthread.c:13:20: error: intern.h: No such file or directory In file included from fastthread.c:14: /usr/local/include/ruby-1.9.1/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete fastthread.c:349: error: static declaration of ?rb_mutex_locked_p? follows non-static declaration /usr/local/include/ruby-1.9.1/ruby/intern.h:707: error: previous declaration of ?rb_mutex_locked_p? was here fastthread.c:366: error: static declaration of ?rb_mutex_try_lock? follows non-static declaration /usr/local/include/ruby-1.9.1/ruby/intern.h:708: error: previous declaration of ?rb_mutex_try_lock? was here fastthread.c: In function ?lock_mutex?: fastthread.c:392: error: ?rb_thread_critical? undeclared (first use in this function) fastthread.c:392: error: (Each undeclared identifier is reported only once fastthread.c:392: error: for each function it appears in.) fastthread.c: At top level: fastthread.c:406: error: static declaration of ?rb_mutex_lock? follows non-static declaration /usr/local/include/ruby-1.9.1/ruby/intern.h:709: error: previous declaration of ?rb_mutex_lock? was here fastthread.c: In function ?set_critical?: fastthread.c:438: error: ?rb_thread_critical? undeclared (first use in this function) fastthread.c: In function ?unlock_mutex?: fastthread.c:447: error: ?rb_thread_critical? undeclared (first use in this function) fastthread.c: At top level: fastthread.c:463: error: static declaration of ?rb_mutex_unlock? follows non-static declaration /usr/local/include/ruby-1.9.1/ruby/intern.h:710: error: previous declaration of ?rb_mutex_unlock? was here fastthread.c: In function ?rb_mutex_exclusive_unlock?: fastthread.c:499: error: ?rb_thread_critical? undeclared (first use in this function) fastthread.c: At top level: fastthread.c:524: error: conflicting types for ?rb_mutex_synchronize? /usr/local/include/ruby-1.9.1/ruby/intern.h:712: error: previous declaration of ?rb_mutex_synchronize? was here fastthread.c: In function ?wait_condvar?: fastthread.c:620: error: ?rb_thread_critical? undeclared (first use in this function) fastthread.c:626: warning: passing argument 1 of ?rb_ensure? from incompatible pointer type fastthread.c: In function ?rb_condvar_broadcast?: fastthread.c:684: error: ?rb_thread_critical? undeclared (first use in this function) fastthread.c: In function ?signal_condvar?: fastthread.c:703: error: ?rb_thread_critical? undeclared (first use in this function) fastthread.c: In function ?rb_queue_marshal_load?: fastthread.c:824: error: ?struct RArray? has no member named ?len? fastthread.c:828: error: ?struct RArray? has no member named ?ptr? fastthread.c:828: error: ?struct RArray? has no member named ?len? fastthread.c: In function ?Init_fastthread?: fastthread.c:1182: error: ?rb_thread_critical? undeclared (first use in this function) make: *** [fastthread.o] Error 1 Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/fastthread-1.0.1 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/fastthread-1.0.1/ext/fastthread/gem_make.out -- Posted via http://www.ruby-forum.com/. From ribeiro.luis at gmail.com Tue Feb 10 08:58:25 2009 From: ribeiro.luis at gmail.com (Luis Ribeiro) Date: Tue, 10 Feb 2009 13:58:25 +0000 Subject: [Mongrel] fastthread error In-Reply-To: References: Message-ID: <49918801.8040807@gmail.com> Currently fastthread needs to be patched by hand to make it work with ruby 1.9. You can read about how to patch it for instance here: http://blog.phusion.nl/2009/02/02/getting-ready-for-ruby-191/ There are still a lot of gems that are not 1.9 ready, you might find some useful resource here: Cheers, Luis Landeiro Ribeiro Leo Joe wrote: > Is anybody testing mongrel on ruby 1.9.1 > I just tried installing mongrel and got this error > > > [root at mysql02 fastthread-1.0.1]# gem install mongrel > Building native extensions. This could take a while... > /usr/local/lib/ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure > world writable dir /bin in PATH, mode 040777 > ERROR: Error installing mongrel: > ERROR: Failed to build gem native extension. > > /usr/local/bin/ruby extconf.rb install mongrel > creating Makefile > > make > gcc -I. -I/usr/local/include/ruby-1.9.1/i686-linux > -I/usr/local/include/ruby-1.9.1/ruby/backward > -I/usr/local/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -O2 > -g -Wall -Wno-parentheses -o fastthread.o -c fastthread.c > fastthread.c:13:20: error: intern.h: No such file or directory > In file included from fastthread.c:14: > /usr/local/include/ruby-1.9.1/ruby/backward/rubysig.h:14:2: warning: > #warning rubysig.h is obsolete > fastthread.c:349: error: static declaration of ?rb_mutex_locked_p? > follows non-static declaration > /usr/local/include/ruby-1.9.1/ruby/intern.h:707: error: previous > declaration of ?rb_mutex_locked_p? was here > fastthread.c:366: error: static declaration of ?rb_mutex_try_lock? > follows non-static declaration > /usr/local/include/ruby-1.9.1/ruby/intern.h:708: error: previous > declaration of ?rb_mutex_try_lock? was here > fastthread.c: In function ?lock_mutex?: > fastthread.c:392: error: ?rb_thread_critical? undeclared (first use in > this function) > fastthread.c:392: error: (Each undeclared identifier is reported only > once > fastthread.c:392: error: for each function it appears in.) > fastthread.c: At top level: > fastthread.c:406: error: static declaration of ?rb_mutex_lock? follows > non-static declaration > /usr/local/include/ruby-1.9.1/ruby/intern.h:709: error: previous > declaration of ?rb_mutex_lock? was here > fastthread.c: In function ?set_critical?: > fastthread.c:438: error: ?rb_thread_critical? undeclared (first use in > this function) > fastthread.c: In function ?unlock_mutex?: > fastthread.c:447: error: ?rb_thread_critical? undeclared (first use in > this function) > fastthread.c: At top level: > fastthread.c:463: error: static declaration of ?rb_mutex_unlock? follows > non-static declaration > /usr/local/include/ruby-1.9.1/ruby/intern.h:710: error: previous > declaration of ?rb_mutex_unlock? was here > fastthread.c: In function ?rb_mutex_exclusive_unlock?: > fastthread.c:499: error: ?rb_thread_critical? undeclared (first use in > this function) > fastthread.c: At top level: > fastthread.c:524: error: conflicting types for ?rb_mutex_synchronize? > /usr/local/include/ruby-1.9.1/ruby/intern.h:712: error: previous > declaration of ?rb_mutex_synchronize? was here > fastthread.c: In function ?wait_condvar?: > fastthread.c:620: error: ?rb_thread_critical? undeclared (first use in > this function) > fastthread.c:626: warning: passing argument 1 of ?rb_ensure? from > incompatible pointer type > fastthread.c: In function ?rb_condvar_broadcast?: > fastthread.c:684: error: ?rb_thread_critical? undeclared (first use in > this function) > fastthread.c: In function ?signal_condvar?: > fastthread.c:703: error: ?rb_thread_critical? undeclared (first use in > this function) > fastthread.c: In function ?rb_queue_marshal_load?: > fastthread.c:824: error: ?struct RArray? has no member named ?len? > fastthread.c:828: error: ?struct RArray? has no member named ?ptr? > fastthread.c:828: error: ?struct RArray? has no member named ?len? > fastthread.c: In function ?Init_fastthread?: > fastthread.c:1182: error: ?rb_thread_critical? undeclared (first use in > this function) > make: *** [fastthread.o] Error 1 > > > Gem files will remain installed in > /usr/local/lib/ruby/gems/1.9.1/gems/fastthread-1.0.1 for inspection. > Results logged to > /usr/local/lib/ruby/gems/1.9.1/gems/fastthread-1.0.1/ext/fastthread/gem_make.out > From lists at ruby-forum.com Tue Feb 10 15:06:28 2009 From: lists at ruby-forum.com (John Nestoriak) Date: Tue, 10 Feb 2009 21:06:28 +0100 Subject: [Mongrel] Mongrel server file descriptor leak? In-Reply-To: <5adf07c80902041010l78da64dem61c8994d7b706670@mail.gmail.com> References: <5adf07c80902041010l78da64dem61c8994d7b706670@mail.gmail.com> Message-ID: Benjamin Grant wrote: > Can you post the content of your mongrel_cluster.yml (or equivalent > command > line options in use) & mongrel version...? > > Also the output of "ulimit -a" for the mongrel process owner. > > -- The mongrels are started under CPanel and we're not using clusters. >From ps it looks like they're just started with: /usr/bin/ruby /usr/bin/mongrel_rails start -p 12005 -d -e production -P log/mongrel.pid It's running mongrel 1.1.5 ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux] I'm not sure exactly how many file descriptors causes it to die - though I've seen 400+ and it running fine and I'm guessing it dies at 512. Ulimit doesn't seem like it's changed at all. core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 1024 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 73728 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited -- Posted via http://www.ruby-forum.com/. From bgrant01101 at gmail.com Tue Feb 10 16:06:29 2009 From: bgrant01101 at gmail.com (benjamin grant) Date: Tue, 10 Feb 2009 13:06:29 -0800 Subject: [Mongrel] Mongrel server file descriptor leak? In-Reply-To: References: <5adf07c80902041010l78da64dem61c8994d7b706670@mail.gmail.com> Message-ID: <5adf07c80902101306h488365b1u114586d476e161e@mail.gmail.com> This is what Mongrel invokes when that limit is hit: def reap_dead_workers(reason='unknown') if @workers.list.length > 0 STDERR.puts "#{Time.now}: Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'" error_msg = "Mongrel timed out this thread: #{reason}" mark = Time.now @workers.list.each do |worker| worker[:started_on] = Time.now if not worker[:started_on] if mark - worker[:started_on] > @timeout + @throttle STDERR.puts "Thread #{worker.inspect} is too old, killing." worker.raise(TimeoutError.new(error_msg)) end end end So check your mongrel logs and see if mongrel is attempting (and possibly failing) to reap workers. You could also slap this into application.rb: def timeout Timeout.timeout(APPCONTROLLER_TIMEOUT) do yield end end Where APPCONTROLLER_TIMEOUT is the number of seconds you want any given controller action to run for. This will effecively force timeouts to occur independnt of host/os limits and mongrel's handling of exceptions thrown when reaching them. I've observed good results with that in some cases. --> But, see also: http://ph7spot.com/articles/system_timer for more on timeouts and how effective (or ineffective) they can be. Meanwhile, raising that open files limit might give you some time to bug-hunt with. Depends on how frequent the problem is being triggered. And have a look at HAProxy and/or NGINX if you're not already running them as a proxy tier / combo. in front of mongrel. -- On Tue, Feb 10, 2009 at 12:06 PM, John Nestoriak wrote: > Benjamin Grant wrote: > > Can you post the content of your mongrel_cluster.yml (or equivalent > > command > > line options in use) & mongrel version...? > > > > Also the output of "ulimit -a" for the mongrel process owner. > > > > -- > > The mongrels are started under CPanel and we're not using clusters. > > >From ps it looks like they're just started with: > /usr/bin/ruby /usr/bin/mongrel_rails start -p 12005 -d -e production -P > log/mongrel.pid > > It's running mongrel 1.1.5 > ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux] > > I'm not sure exactly how many file descriptors causes it to die - though > I've seen 400+ and it running fine and I'm guessing it dies at 512. > > Ulimit doesn't seem like it's changed at all. > > core file size (blocks, -c) 0 > data seg size (kbytes, -d) unlimited > file size (blocks, -f) unlimited > pending signals (-i) 1024 > max locked memory (kbytes, -l) 32 > max memory size (kbytes, -m) unlimited > open files (-n) 1024 > pipe size (512 bytes, -p) 8 > POSIX message queues (bytes, -q) 819200 > stack size (kbytes, -s) 10240 > cpu time (seconds, -t) unlimited > max user processes (-u) 73728 > virtual memory (kbytes, -v) unlimited > file locks (-x) unlimited > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > 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 jalmberg at identry.com Wed Feb 11 14:03:41 2009 From: jalmberg at identry.com (John Almberg) Date: Wed, 11 Feb 2009 14:03:41 -0500 Subject: [Mongrel] Sharing a mongrel cluster in a multi-url environment In-Reply-To: <49831CAF.9030504@jhu.edu> References: <329C8E03-26B5-4D9B-BE83-D32B3881C916@identry.com> <81b453920901281445y68c74c3as5eff5bf03fed74dc@mail.gmail.com> <6C6CFC06-E4D6-4745-9488-F2A195013CE3@identry.com> <002c01c98289$42bf8d30$c83ea790$@com> <4F142A0D-78CF-4078-BCAB-47B548CB67D5@identry.com> <49831CAF.9030504@jhu.edu> Message-ID: <0643AD06-0231-4255-81ED-745D70F5CEDA@identry.com> For anyone who was interested in this thread, I discovered that the session loss problem only occurred when: 1. two sites were using the same mongrel (as would happen in a mongrel_cluster), and 2. the app uses ActiveRecord storage for sessions 2. the database containing the sessions table was switched The key was to use a common database that contained the sessions table (and client table). This common database is used when rails first fires up. The application can then switch the other tables to the client database, as selected by the domain name. As long as you don't switch the session table database, it works fine, with no session loss. Having a single client table (that contains the client domain name, and database parameters) is also convenient. BTW, there is a good discussion of this topic here: http:// wiki.rubyonrails.org/rails/pages/HowtoUseMultipleDatabases That article pretty much gave me the solution. Thanks Dave Thomas! -- John ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Websites and Marketing for On-line Collectible Dealers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IDENTRY, LLC John Almberg - Managing Partner (631) 546-5079 jalmberg at identry.com www.identry.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From lists at ruby-forum.com Tue Feb 17 23:32:35 2009 From: lists at ruby-forum.com (Jay Kraly) Date: Wed, 18 Feb 2009 05:32:35 +0100 Subject: [Mongrel] Linux ps reports mongrel as [ruby18] Message-ID: <676dc3ab9970011215aa5efa3cb8f0b3@ruby-forum.com> I'm running two sets of mongrels using mongrel 1.1.4, one for production one for staging. When executing 'ps' from a linux shell, the production mongrels report as expected, however the staging processes are listed as [ruby 18]. The result seems to be that mongrel_rails cannot stop the staging processes because it doesn't recognize [ruby18] as a mongrel process. I've read that this was a problem in older versions of mongrel and fixable by editing the init.rb file. The same posts seem to indicate that it is a problem with the kernel on my linux box. I can't change the kernel on this box, so how can I get mongrel_rails to stop the [ruby18] processes? The same scripts/version of mongrel were running fine on a different box. The sites were just upgraded to new boxes, apparently with new kernels. Thanks for any help. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Feb 19 12:24:26 2009 From: lists at ruby-forum.com (Daniel Mantilla) Date: Thu, 19 Feb 2009 18:24:26 +0100 Subject: [Mongrel] Mongrel as a Windows Service (not running Rails) Message-ID: <30b56f731a43aea60472ab8da202c919@ruby-forum.com> Hi, I hope you can help me with this. I have implemented a simple web app on top of Mongrel and now I need to run it as a Windows Service. I explored the mongrel_service gem and it looks like I will need an executable (.exe) for this. Is there a way to use the existing mongrel_service.exe to run my own script? Thanks in advance, Daniel -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Thu Feb 19 14:03:50 2009 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 19 Feb 2009 17:03:50 -0200 Subject: [Mongrel] Mongrel as a Windows Service (not running Rails) In-Reply-To: <30b56f731a43aea60472ab8da202c919@ruby-forum.com> References: <30b56f731a43aea60472ab8da202c919@ruby-forum.com> Message-ID: <71166b3b0902191103t1d2cb101r3ffb1be719ac4b42@mail.gmail.com> On Thu, Feb 19, 2009 at 3:24 PM, Daniel Mantilla wrote: > Hi, I hope you can help me with this. I have implemented a simple web > app on top of Mongrel and now I need to run it as a Windows Service. I > explored the mongrel_service gem and it looks like I will need an > executable (.exe) for this. Is there a way to use the existing > mongrel_service.exe to run my own script? > mongrel_service gem was implemented to work with Rails. Inside the gem there is mongrel_service.exe (inside bin), but that only works with mongrel_rails script. While your user case is a valid one, was not considered when developed. You have a few options for your situation: 1) check mongrel_service FreeBASIC code (which is the actual service) and implement your own variation. (willl take you some time) 2) look into options like svrany or firedaemon, which let you run console applications as services. > Thanks in advance, > Hope this helps, -- 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 Thu Feb 19 18:49:03 2009 From: lists at ruby-forum.com (Christopher Zimmermann) Date: Fri, 20 Feb 2009 00:49:03 +0100 Subject: [Mongrel] "service mongrel_cluster start" startup fails In-Reply-To: <5a73a09f823d5704a0333c54f1f8809e@ruby-forum.com> References: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> <82a18437e66d13591a496769254211d2@ruby-forum.com> <81b453920812141547i17ce9dbbl19a37528034929d@mail.gmail.com> <5a73a09f823d5704a0333c54f1f8809e@ruby-forum.com> Message-ID: <2b5025f6737aaabecf4b7f5e95224e22@ruby-forum.com> Hi all, Im having the same problem as Steve Meyer was and still hope to find out what was wrong rather then writing a custom file as he ended up doing. I very much appreciate any insight you can provide! Same Problem: My rails application runs great, but it needs to be started manually. I need it to restart when the machine restarts. More explicitly, If I manually run > /etc/init.d/mongrel_cluster status Then everything runs great. But if i run > service mongrel_cluster status Then I get the error: /usr/bin/mongrel_cluster_ctl:9:in `require': no such file to load -- rubygems (LoadError) That line in mongrel_cluster_ctl is just: require 'rubygems' ***** What have I done to anger the gods?? Some details on my system - perhaps i installed something in wrong place? ruby: /usr/bin/ruby rubygems: /usr/local/rubygems ***** I am new to linux - can someone help me with that line "require 'rubygems'".. What does 'require' mean in a shell script - i found no man page. What should it actually find, a file? I have the directory "/usr/local/rubygems" is that what it is looking for? Or should it find an actual file called 'rubygems' somewhere? By the way, in the /etc/init.d/mongrel_cluster I did expand the path with: export PATH=/usr/local:/usr/local/bin:$PATH And that script then echos the path when run with service command as: /usr/local:/usr/local/bin:/sbin:/usr/sbin:/usr/bin ***** Thanks for reading! Topher -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Feb 20 06:53:37 2009 From: lists at ruby-forum.com (Robbie Allen) Date: Fri, 20 Feb 2009 12:53:37 +0100 Subject: [Mongrel] how can I disable the rails logging in development? Message-ID: <1850fcc6d974dcb5d21bdf4c32742a92@ruby-forum.com> I can't seem to disable rails logging when using Mongrel. Any fix for this? Also unanswered on the Rails forum: http://www.ruby-forum.com/topic/109422#784596 Re: how can I disable the SQL logging which occurs in develo Posted by Greg Hauptmann (Guest) on 29.05.2007 21:22 You're exactly correct Isak! Thanks. The logging functionality worked as it should in webrick. Is seems screwed up in Mongrel. I'll swap to using webrick in development (and try to find out where/how to let the Mongrel team about this). Interestingly I noted that with webrick the logging doesn't come out on the console, but rather I had to open a second iTerm and tail the log file itself. Perhaps there is a "script/server webrick" setting I could use to enable logging to console if I went looking. Tks Greg -- Posted via http://www.ruby-forum.com/. From jftucker at gmail.com Fri Feb 20 07:46:45 2009 From: jftucker at gmail.com (James Tucker) Date: Fri, 20 Feb 2009 12:46:45 +0000 Subject: [Mongrel] Mongrel as a Windows Service (not running Rails) In-Reply-To: <71166b3b0902191103t1d2cb101r3ffb1be719ac4b42@mail.gmail.com> References: <30b56f731a43aea60472ab8da202c919@ruby-forum.com> <71166b3b0902191103t1d2cb101r3ffb1be719ac4b42@mail.gmail.com> Message-ID: <5B538D88-71A1-4873-9A1E-2CB39F9FC7B7@gmail.com> > You have a few options for your situation: > > 1) check mongrel_service FreeBASIC code (which is the actual service) > and implement your own variation. > (willl take you some time) > > 2) look into options like svrany or firedaemon, which let you run > console applications as services. 3) http://github.com/raggi/ruby_service_helper/, and I recommend you also use http://github.com/raggi/rubyw_helper/, these work with win32- service-0.6.1. If you're on a mingw build of ruby, you may need to gem install --platform=x86-mswin32-60 win32-service first, as gcc can't deal with SEH. The above provides something that's relatively easy to prototype, but also still mostly debuggable: http://pastie.textmate.org/private/rsnvpy5eogjhicawttjgra (untested) HTH From ms at pccl.info Fri Feb 20 07:45:53 2009 From: ms at pccl.info (Mark Somerville) Date: Fri, 20 Feb 2009 12:45:53 +0000 Subject: [Mongrel] Linux ps reports mongrel as [ruby18] In-Reply-To: <676dc3ab9970011215aa5efa3cb8f0b3@ruby-forum.com> References: <676dc3ab9970011215aa5efa3cb8f0b3@ruby-forum.com> Message-ID: <20090220124553.GD9755@titan.pccl.info> On Wed, Feb 18, 2009 at 05:32:35AM +0100, Jay Kraly wrote: > I'm running two sets of mongrels using mongrel 1.1.4, one for production > one for staging. When executing 'ps' from a linux shell, the production > mongrels report as expected, however the staging processes are listed as > [ruby 18]. The result seems to be that mongrel_rails cannot stop the > staging processes because it doesn't recognize [ruby18] as a mongrel > process. You could try adding a line like this to the mongrel_rails script: $0 = "mongrel_rails" That will set the process name. Mark From rochkind at jhu.edu Fri Feb 20 10:01:11 2009 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Fri, 20 Feb 2009 10:01:11 -0500 Subject: [Mongrel] how can I disable the rails logging in development? In-Reply-To: <1850fcc6d974dcb5d21bdf4c32742a92@ruby-forum.com> References: <1850fcc6d974dcb5d21bdf4c32742a92@ruby-forum.com> Message-ID: <499EC5B7.3070904@jhu.edu> I've had no trouble disabling Rails logging using mongrel. In fact, I specifically do what you asked, turn off the SQL logging in development. I do it with these lines in my development.rb: ar_logger = config.logger.clone ar_logger.level = Logger::INFO ActiveRecord::Base.logger = ar_logger Works fine for me in Rails 2.1. I believe it used to work fine for me in Rails 1.x too. Using mongrel yeah, no problem. So I'm not sure what problem you're having, but I don't think it's universal to mongrel. Jonathan Robbie Allen wrote: > I can't seem to disable rails logging when using Mongrel. Any fix for > this? > > Also unanswered on the Rails forum: > http://www.ruby-forum.com/topic/109422#784596 > > Re: how can I disable the SQL logging which occurs in develo > Posted by Greg Hauptmann (Guest) on 29.05.2007 21:22 > You're exactly correct Isak! Thanks. > > The logging functionality worked as it should in webrick. Is seems > screwed up in Mongrel. I'll swap to using webrick in development (and > try to > find out where/how to let the Mongrel team about this). > > Interestingly I noted that with webrick the logging doesn't come out on > the console, but rather I had to open a second iTerm and tail the log > file > itself. Perhaps there is a "script/server webrick" setting I could use > to enable logging to console if I went looking. > > Tks > Greg > From lists at ruby-forum.com Fri Feb 20 13:31:11 2009 From: lists at ruby-forum.com (Daniel Mantilla) Date: Fri, 20 Feb 2009 19:31:11 +0100 Subject: [Mongrel] Mongrel as a Windows Service (not running Rails) In-Reply-To: <5B538D88-71A1-4873-9A1E-2CB39F9FC7B7@gmail.com> References: <30b56f731a43aea60472ab8da202c919@ruby-forum.com> <71166b3b0902191103t1d2cb101r3ffb1be719ac4b42@mail.gmail.com> <5B538D88-71A1-4873-9A1E-2CB39F9FC7B7@gmail.com> Message-ID: Thanks guys for your suggestions. I will give them both a shot. Daniel -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Feb 24 01:40:13 2009 From: lists at ruby-forum.com (hwang is) Date: Tue, 24 Feb 2009 07:40:13 +0100 Subject: [Mongrel] Errors in this file (tcphack.rb) Message-ID: <5668b6152c3301982fd5564f8ef6de7f@ruby-forum.com> hi all, i can not speak english well. my os is ubuntu , unbuntu update was yesterday. and then does not work. this is mongrel error /usr/local/lib/site_ruby/1.8/mongrel/tcphack.rb:12:in `initialize_without_backlog': Address already in use - bind(2) (Errno::EADDRINUSE) from /usr/local/lib/site_ruby/1.8/mongrel/tcphack.rb:12:in `initialize' from /usr/local/lib/site_ruby/1.8/mongrel.rb:93:in `new' from /usr/local/lib/site_ruby/1.8/mongrel.rb:93:in `initialize' from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:139:in `new' from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:139:in `listener' from conf_mongrel.rb:609:in `cloaker_' from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:50:in `call' from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:50:in `initialize' from conf_mongrel.rb:608:in `new' from conf_mongrel.rb:608 caused by the os update is going on? i don't understand this error Please let me know thank you for reading my article. -- Posted via http://www.ruby-forum.com/. From michael.dauria at gmail.com Tue Feb 24 11:47:18 2009 From: michael.dauria at gmail.com (Michael D'Auria) Date: Tue, 24 Feb 2009 11:47:18 -0500 Subject: [Mongrel] Errors in this file (tcphack.rb) In-Reply-To: <5668b6152c3301982fd5564f8ef6de7f@ruby-forum.com> References: <5668b6152c3301982fd5564f8ef6de7f@ruby-forum.com> Message-ID: <1907e2ca0902240847g6ea6e3ebwaa4b7446bd41c072@mail.gmail.com> it seems like you have another mongrel running on the port you tried to start it up on: Address already in use - bind(2) (Errno::EADDRINUSE). Try shutting down the other server process that's in the way or start the new one up on a different port. Michael On Tue, Feb 24, 2009 at 1:40 AM, hwang is wrote: > hi all, > > i can not speak english well. > > my os is ubuntu , > > unbuntu update was yesterday. > > and then does not work. > > this is mongrel error > > /usr/local/lib/site_ruby/1.8/mongrel/tcphack.rb:12:in > `initialize_without_backlog': Address already in use - bind(2) > (Errno::EADDRINUSE) > from /usr/local/lib/site_ruby/1.8/mongrel/tcphack.rb:12:in > `initialize' > from /usr/local/lib/site_ruby/1.8/mongrel.rb:93:in `new' > from /usr/local/lib/site_ruby/1.8/mongrel.rb:93:in `initialize' > from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:139:in > `new' > from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:139:in > `listener' > from conf_mongrel.rb:609:in `cloaker_' > from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:50:in > `call' > from /usr/local/lib/site_ruby/1.8/mongrel/configurator.rb:50:in > `initialize' > from conf_mongrel.rb:608:in `new' > from conf_mongrel.rb:608 > > > caused by the os update is going on? > > i don't understand this error > > Please let me know > > thank you for reading my article. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > 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 Tue Feb 24 21:46:22 2009 From: lists at ruby-forum.com (hwang is) Date: Wed, 25 Feb 2009 03:46:22 +0100 Subject: [Mongrel] Errors in this file (tcphack.rb) In-Reply-To: <1907e2ca0902240847g6ea6e3ebwaa4b7446bd41c072@mail.gmail.com> References: <5668b6152c3301982fd5564f8ef6de7f@ruby-forum.com> <1907e2ca0902240847g6ea6e3ebwaa4b7446bd41c072@mail.gmail.com> Message-ID: <8c2f579120c9b76ae8bed29af1c02834@ruby-forum.com> thank you ! Michael my server has mysql process -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Feb 27 13:47:02 2009 From: lists at ruby-forum.com (Marcel Sadlowski) Date: Fri, 27 Feb 2009 19:47:02 +0100 Subject: [Mongrel] Error while starting "ruby script/server" Message-ID: Hello, I am very new to Ruby on Rails, but also very excited to get those things started. I downloaded and installed "BitNami RubyStack Stack 1.4-beta-1" which includes all necessary tools for running RoR offline under OS X (10.5). I tried to get it started before in some other different ways, but I never got it, because I am very new to this. Finally now I tried to start my rails app, but then something strange happened. In my web browser should http://localhost:3000 open my active rails application, but there's only following error message: Status: 500 Internal Server Error Content-Type: text/html Application error (Rails) So I tried to start the rails app over the Terminal. I changed to my railsapp-folder and entered: "ruby script/server" which should start Mongrel for my railsapp. But the Terminal showed me: => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.2.2 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 Exiting /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/tcphack.rb:12:in `initialize_without_backlog': Address already in use - bind(2) (Errno::EADDRINUSE) from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/tcphack.rb:12:in `initialize' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:93:in `new' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:93:in `initialize' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:139:in `new' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:139:in `listener' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `call' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `initialize' ... 14 levels... from /Library/Ruby/Gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3 It says, that the localhost-address is already in use, but I have no idea how I can reset it. Can somebody help me with this problem? Greetz, Marcel -- Posted via http://www.ruby-forum.com/.