From ni-di at web.de Wed Aug 1 03:42:23 2007 From: ni-di at web.de (Niko Dittmann) Date: Wed, 1 Aug 2007 09:42:23 +0200 Subject: [Swiftiply-users] 'start_tcp_server': no acceptor error In-Reply-To: <3DAFD60B-7630-45DB-874E-15876D25C1A0@web.de> References: <3DAFD60B-7630-45DB-874E-15876D25C1A0@web.de> Message-ID: <8D9BE6C6-86DE-4E49-8108-718D7068F269@web.de> Could this be an issue with the new version of eventmachine (being out for 3 days now)? Does swiftiply 0.5.3 work with eventmachine 0.8.1? From jnicoll at goldnoteexpress.com Wed Aug 1 12:51:10 2007 From: jnicoll at goldnoteexpress.com (Jeremy Nicoll) Date: Wed, 01 Aug 2007 10:51:10 -0600 Subject: [Swiftiply-users] Troubles setting up Message-ID: <46B0B9FE.50104@goldnoteexpress.com> Hello all, I just discovered Swiftiply today, and am excited to be using it. Currently I am developing on my local machine, and have seemed to have almost everything working. I can pull up the home page using RoR, but whenever I try to connect to my local database, I get an error message saying that it cannot be found. Does anyone have any hints that would point me in the right direction? Also, when I first start the clusters, my first few requests have an "OK" appended before the headers, which really mucks up the display. After refreshing a few times, the "OK" goes away. TIA, Jeremy --------------------------------------------------------------------------------- Here are the details for my environment: --------------------------------------------------------------------------------- OS: OS X 10.4.10 Ruby: ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] Swiftiply: 0.5.1 (installed via gem) Mongrel: 1.0.1 (via gem) Mongrel_Cluster: 1.0.2, 0.2.1 (gem) --------------------------------------------------------------------------------- Here is what I am using to start Swiftiply and the mongrels: --------------------------------------------------------------------------------- sudo swiftiply -c config/swiftiply.yml sudo swiftiply_mongrel_rails -n5 -d --------------------------------------------------------------------------------- My swiftiply.yml file: --------------------------------------------------------------------------------- cluster_address: localhost cluster_port: 2500 daemonize: true map: - incoming: - localhost outgoing: 127.0.0.1:4000 default: true From ni-di at web.de Mon Aug 6 13:03:07 2007 From: ni-di at web.de (Niko Dittmann) Date: Mon, 6 Aug 2007 19:03:07 +0200 Subject: [Swiftiply-users] 'start_tcp_server': no acceptor error In-Reply-To: <8D9BE6C6-86DE-4E49-8108-718D7068F269@web.de> References: <3DAFD60B-7630-45DB-874E-15876D25C1A0@web.de> <8D9BE6C6-86DE-4E49-8108-718D7068F269@web.de> Message-ID: <107D4377-93CD-49B7-8AC7-CBAD63B5FC77@web.de> The "no acceptor error" occurs if there's already a swiftiply process running. "killall swiftiply" doesn't stop a running swiftiply. "killall -9" does. Not nice though. What's the approved method to stop and/or restart swiftiply? Don't answer here, I'll open a new thread for that. Niko. Just for (self-)documentation purpose here's my conf files (it's single Rails app server that's why I have the conf files in /etc/): /etc/mongrel/mongrel.yaml: --- :config_script: :environment: production :num_processors: 1024 :docroot: public :timeout: 0 :host: 0.0.0.0 :mime_map: /etc/mongrel/mongrel_mime.yaml :port: 4000 :daemon: true :cwd: /srv/rails/mydomain/current :includes: - mongrel :debug: false :log_file: /var/log/mongrel.log :user: myuser :group: mygroup /etc/swiftiply/swiftconf.yaml: cluster_address: 0.0.0.0 cluster_port: 80 daemonize: true timeout: 3 map: - incoming: - localhost - www.mydomain.com - my.IP.XX.XX outgoing: 0.0.0.0:4000 default: true /etc/init.d/swiftiply: #!/bin/bash case "$1" in start) echo -n "Starting swiftiply:" swiftiply -c /etc/swiftiply/swiftconf.yaml echo ;; stop) echo -n "Stopping swiftiply:" killall -9 swiftiply # not nice! better way? echo ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" esac exit 0 From ni-di at web.de Mon Aug 6 13:04:07 2007 From: ni-di at web.de (Niko Dittmann) Date: Mon, 6 Aug 2007 19:04:07 +0200 Subject: [Swiftiply-users] start/restart/stop swiftiply Message-ID: What's the approved method to stop and/or restart swiftiply? From ni-di at web.de Sun Aug 12 13:56:47 2007 From: ni-di at web.de (Niko Dittmann) Date: Sun, 12 Aug 2007 19:56:47 +0200 Subject: [Swiftiply-users] [swiftiply users] HTTP response getting rendered as text Message-ID: Hi everybody, I still have the problem that the HTTP response gets rendered as text. After one to three refreshes the page gets displayed correctly. I think the problem got discussed in these threads already: http://rubyforge.org/pipermail/swiftiply-users/2007-June/000027.html (bottom of page) http://rubyforge.org/pipermail/swiftiply-users/2007-June/000023.html (one third from top as 1) ) http://rubyforge.org/pipermail/swiftiply-users/2007-June/000025.html (as "problem #2") My setup is a pure swiftiply (0.6) + mongrel stack, no apache, nginx, whatever else... I had the problem before using swiftiply 0.5.1 (no idea how I came to claim to be using 0.5.3 in my last post; sorry bout the fuzz). The difference is that with 0.5.1 I had the HTTP header rendered after restart once per running Mongrel. So I could work around this issue by curl-ing my site 3 times after starting the 3 Mongrels. Now with Swiftiply 0.6 I get those pages not only after restarts, but once in a while during normal operation. And if it occurs it occurs again 3 times if 3 Mongrels are running. Any idea what's going on here? Kind regards, Niko. From sandrods at gmail.com Sun Aug 12 20:54:36 2007 From: sandrods at gmail.com (Sandro Duarte) Date: Sun, 12 Aug 2007 21:54:36 -0300 Subject: [Swiftiply-users] [swiftiply users] HTTP response getting rendered as text In-Reply-To: References: Message-ID: <8133b8010708121754k7ef5604ev29de9adc9c8ef137@mail.gmail.com> I got the very same problem. Since no one here or in anywhere else came up with an answer, I gave up on Swiftiply. Sandro On 8/12/07, Niko Dittmann wrote: > > Hi everybody, > > > I still have the problem that the HTTP response gets rendered as > text. After one to three refreshes the page gets displayed > correctly. I think the problem got discussed in these threads already: > > http://rubyforge.org/pipermail/swiftiply-users/2007-June/000027.html > (bottom of page) > http://rubyforge.org/pipermail/swiftiply-users/2007-June/000023.html > (one third from top as 1) ) > http://rubyforge.org/pipermail/swiftiply-users/2007-June/000025.html > (as "problem #2") > > My setup is a pure swiftiply (0.6) + mongrel stack, no apache, nginx, > whatever else... > > I had the problem before using swiftiply 0.5.1 (no idea how I came to > claim to be using 0.5.3 in my last post; sorry bout the fuzz). The > difference is that with 0.5.1 I had the HTTP header rendered after > restart once per running Mongrel. So I could work around this issue > by curl-ing my site 3 times after starting the 3 Mongrels. Now with > Swiftiply 0.6 I get those pages not only after restarts, but once in > a while during normal operation. And if it occurs it occurs again 3 > times if 3 Mongrels are running. > > Any idea what's going on here? > > > Kind regards, Niko. > _______________________________________________ > Swiftiply-users mailing list > Swiftiply-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/swiftiply-users > -- Sandro Duarte Analista de Sistemas STI/SADES TRE-RS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/swiftiply-users/attachments/20070812/99b6b986/attachment-0001.html From wyhaines at gmail.com Mon Aug 13 01:01:28 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sun, 12 Aug 2007 22:01:28 -0700 Subject: [Swiftiply-users] [swiftiply users] HTTP response getting rendered as text In-Reply-To: <8133b8010708121754k7ef5604ev29de9adc9c8ef137@mail.gmail.com> References: <8133b8010708121754k7ef5604ev29de9adc9c8ef137@mail.gmail.com> Message-ID: On 8/12/07, Sandro Duarte wrote: > I got the very same problem. Since no one here or in anywhere else came up > with an answer, I gave up on Swiftiply. (I just realized that I sent this directly to Sandro instead of to the list....) I appologize if I missed your email. It's been mentioned in here before in other threads. It is a bug in swiftiplied_mongrel. It is fixed in 0.6.1 (which I released, finally, a couple hours ago). Kirk Haines P.S. This release requires EventMachine 0.8.1, as there were some things that went into the latest EM release that directly facilitated this release. From alexkwolfe at gmail.com Mon Aug 13 14:50:57 2007 From: alexkwolfe at gmail.com (Alex Wolfe) Date: Mon, 13 Aug 2007 13:50:57 -0500 Subject: [Swiftiply-users] no such file to load -- rubyeventmachine Message-ID: I'm working on getting Swiftiply installed for use with a mongrel cluster, but am getting an error on startup: $ swiftiply -c config/swiftiply.yml /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rubyeventmachine (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:27:in `require' from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.8.1/ lib/eventmachine.rb:59 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:33:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:33:in `require' from /usr/local/lib/ruby/gems/1.8/gems/swiftiply-0.6.1/src/ swiftcore/Swiftiply.rb:4 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:33:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:33:in `require' from /usr/local/lib/ruby/gems/1.8/gems/swiftiply-0.6.1/bin/ swiftiply:8 from /usr/local/bin/swiftiply:18:in `load' from /usr/local/bin/swiftiply:18 Anyone seen this before? From wyhaines at gmail.com Mon Aug 13 18:26:07 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 13 Aug 2007 15:26:07 -0700 Subject: [Swiftiply-users] no such file to load -- rubyeventmachine In-Reply-To: References: Message-ID: On 8/13/07, Alex Wolfe wrote: > I'm working on getting Swiftiply installed for use with a mongrel > cluster, but am getting an error on startup: > > $ swiftiply -c config/swiftiply.yml > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- rubyeventmachine Make sure you have EventMachine installed. If you installed with rubygems, it should have been installed as a dependency (version 0.8.1 is required). If you installed via tarball, I clearly need to make the dependency on EventMachine more prominent. Thanks for trying Swiftiply. Let me know if you run into anything else. Kirk Haines From alexkwolfe at gmail.com Mon Aug 13 23:57:05 2007 From: alexkwolfe at gmail.com (Alex Wolfe) Date: Mon, 13 Aug 2007 22:57:05 -0500 Subject: [Swiftiply-users] no such file to load -- rubyeventmachine In-Reply-To: References: Message-ID: <90220d70708132057x74838134x70b0bf9aaafe4914@mail.gmail.com> Hi Kirk. Thanks for your response. I do have EventMachine installed. Here is a list of the relevant gems currently installed on my system: eventmachine (0.8.1) fastthread (1.0) mongrel (1.0.1) mongrel_cluster (1.0.2, 0.2.0) swiftiply (0.6.1) On my Mac OS X machine, I have the rubyeventmachine.bundle file in my gems/eventmachine-0.8.1/lib directory. On the target machine however, that file is curiously missing. Seems like it might be a problem with the EventMachine installation. -Alex On 8/13/07, Kirk Haines wrote: > On 8/13/07, Alex Wolfe wrote: > > I'm working on getting Swiftiply installed for use with a mongrel > > cluster, but am getting an error on startup: > > > > $ swiftiply -c config/swiftiply.yml > > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `gem_original_require': no such file to load -- rubyeventmachine > > Make sure you have EventMachine installed. If you installed with > rubygems, it should have been installed as a dependency (version 0.8.1 > is required). If you installed via tarball, I clearly need to make > the dependency on EventMachine more prominent. > > Thanks for trying Swiftiply. Let me know if you run into anything else. > > > Kirk Haines > From jos at catnook.com Wed Aug 15 02:29:31 2007 From: jos at catnook.com (Jos Backus) Date: Tue, 14 Aug 2007 23:29:31 -0700 Subject: [Swiftiply-users] [patch] swiftiply_mongrel_rails isn't passing --host to mongrel_rails Message-ID: <20070815062931.GA18447@lizzy.catnook.local> This patch fixes that. --- /usr/lib/ruby/gems/1.8/gems/swiftiply-0.6.1/bin/swiftiply_mongrel_rails.orig 2007-08-15 02:23:44.000000000 -0400 +++ /usr/lib/ruby/gems/1.8/gems/swiftiply-0.6.1/bin/swiftiply_mongrel_rails 2007-08-15 02:25:31.000000000 -0400 @@ -41,9 +41,10 @@ parse_options @config[:num].times do |i| cmd = "mongrel_rails start -p #{@config[:port]} " << - "-e #{@config[:env]} #{@config[:daemonize] ? '-d' : ''}" << - "-P #{File.join(@config[:pid],'dog' + i.to_s + '.pid')}" << - "#{@config[:conf] ? ' -C '+ at config[:conf] : ''}" + "-e #{@config[:env]} #{@config[:daemonize] ? '-d' : ''} " << + "-P #{File.join(@config[:pid],'dog' + i.to_s + '.pid')} " << + "#{@config[:conf] ? ' -C '+ at config[:conf] : ''} " << + "-a #{@config[:host]} " output = `#{cmd}` puts output end -- Jos Backus jos at catnook.com From ammon.christiansen at gmail.com Wed Aug 15 16:21:22 2007 From: ammon.christiansen at gmail.com (Ammon Christiansen) Date: Wed, 15 Aug 2007 13:21:22 -0700 Subject: [Swiftiply-users] evented_mongrel Message-ID: <5dc7d1c20708151321r4450229av991cb945108dc69f@mail.gmail.com> >From my understanding, one evented_mongrel instance could handle multiple concurrent requests. I assume that those requests being file uploads wouldn't be an issue at all. Is there any reason to use multiple mongrels to handle concurrent file uploads? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/swiftiply-users/attachments/20070815/28bd5e0e/attachment.html From jos at catnook.com Wed Aug 15 16:28:21 2007 From: jos at catnook.com (Jos Backus) Date: Wed, 15 Aug 2007 13:28:21 -0700 Subject: [Swiftiply-users] [patch] swiftiply_mongrel_rails executes the wrong instance of mongrel_rails Message-ID: <20070815202821.GA15956@lizzy.catnook.local> swiftiply_mongrel_rails is supposed to execute the swiftiplied version of mongrel_rails, supplied with the swiftiply gem. Instead it runs whatever mongrel_rails is in the PATH (usually the stock mogrel_rails that ships with mongrel). This patch attempts to address that issue. --- /usr/lib/ruby/gems/1.8/gems/swiftiply-0.6.1/bin/swiftiply_mongrel_rails.orig 2007-08-15 16:23:23.000000000 -0400 +++ /usr/lib/ruby/gems/1.8/gems/swiftiply-0.6.1/bin/swiftiply_mongrel_rails 2007-08-15 16:20:14.000000000 -0400 @@ -45,7 +45,7 @@ "-P #{File.join(@config[:pid],'dog' + i.to_s + '.pid')} " << "#{@config[:conf] ? ' -C '+ at config[:conf] : ''} " << "-a #{@config[:host]} " - output = `#{cmd}` + output = `ruby #{File.dirname(__FILE__)}/#{cmd}` puts output end end -- Jos Backus jos at catnook.com From ni-di at web.de Thu Aug 16 05:11:13 2007 From: ni-di at web.de (Niko Dittmann) Date: Thu, 16 Aug 2007 11:11:13 +0200 Subject: [Swiftiply-users] http head prefixed with "00000000fa000" Message-ID: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> Hi everybody. Since upgrading to 0.6.1 I sometime have the problem that the page gets prepended with a strange string: 00000000fa000HTTP/1.1 200 OK Connection: close Date: Thu, 16 Aug 2007 09:07:01 GMT ... and thus the head gets rendered again. This only occurs from time to time and I have the impression it's only when the site didn't get accessed for some time. Is this a known issue? Niko. From jm at thevaluecreators.com Thu Aug 16 05:54:17 2007 From: jm at thevaluecreators.com (Julien Marie) Date: Thu, 16 Aug 2007 11:54:17 +0200 Subject: [Swiftiply-users] I need an overview about swiftiply architecture... Message-ID: <1A0AB549-243A-4497-896C-8B932FFBBFF4@thevaluecreators.com> Hi, I'm not a programmer, i'm a geek starting a company, our product is being developed actually on rails and I've been searching these last weeks on the best way to have a scalable setup for the website. So far, I think that Amazon EC2 services will be the best for our product which will have heavy hourly spikes. The structure of the site is a bit particular, because there's only one html page, everything is pure js, so except the static html page and interface pictures that will be cached, everything will be XML requests and pictures. The set up I thought to be the best, but I'm not sure how things do fit together and "were exactly" to install them, would use Nginx + Varnish + Swiftiply on the Load balancing server, and Swiftiplied Mongrels on each app server + Rails + Monit. For Sql, i thought using a SQL Relay server as SQL load balancer and some MySQL servers. And to have an automated backup of SQL databases to S3. All this on CentOS. So, overall, I'm not sure to have understood all the details, and as I'm not an IT expert or a developper, but what I'd like to be sure is if this setup is functionnal, or if I need to change things (like adding nginx to each app servers...) Thanks for your help, Julien Marie From wyhaines at gmail.com Thu Aug 16 08:04:53 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 16 Aug 2007 05:04:53 -0700 Subject: [Swiftiply-users] http head prefixed with "00000000fa000" In-Reply-To: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> References: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> Message-ID: On 8/16/07, Niko Dittmann wrote: > Hi everybody. > > Since upgrading to 0.6.1 I sometime have the problem that the page > gets prepended with a strange string: > > 00000000fa000HTTP/1.1 200 OK > Connection: close > Date: Thu, 16 Aug 2007 09:07:01 GMT > ... > > and thus the head gets rendered again. This only occurs from time to > time and I have the impression it's only when the site didn't get > accessed for some time. Is this a known issue? It is not. I know which code would probably be responsible for that, but can't think of why it would happen, so building a test case is hard. :) It happens only irregularly, after the app has been sitting unused for a while? Kirk Haines From ni-di at web.de Thu Aug 16 08:22:28 2007 From: ni-di at web.de (Niko Dittmann) Date: Thu, 16 Aug 2007 14:22:28 +0200 Subject: [Swiftiply-users] http head prefixed with "00000000fa000" In-Reply-To: References: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> Message-ID: <47896CFC-D67C-43C5-8108-527883AC92BF@web.de> Hi Kirk. It seems to happen just when it sits unused for some time. I'll send you a link to the app in a private email. Niko. From jos at catnook.com Thu Aug 16 20:02:12 2007 From: jos at catnook.com (Jos Backus) Date: Thu, 16 Aug 2007 17:02:12 -0700 Subject: [Swiftiply-users] [patch] Make swiftiply_mongrel_rails use the Slave library Message-ID: <20070817000212.GA11062@lizzy.catnook.local> This change consists of two parts: a patch against swiftiply_mongrel_rails which adds the --use-slaves option, and a patch which is to be applied to a copy of mongrel_rails named mongrel_rails.rb. Both files live in the Swiftiply gem bin directory. One benefit of this change is that one can now run swiftiply_mongrel_rails under daemontools without having to worry about zombies. Patch to swiftiply_mongrel_rails: --- swiftiply_mongrel_rails.orig 2007-08-15 16:23:23.000000000 -0400 +++ swiftiply_mongrel_rails 2007-08-16 19:25:46.000000000 -0400 @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# vim:expandtab softtabstop=2 shiftwidth=2 ENV['SWIFT'] = 'true' require 'optparse' @@ -10,7 +11,8 @@ :pid => (File.expand_path(Dir.pwd)+'/log'), :host => '127.0.0.1', :port => 4000, - :num => 1 + :num => 1, + :use_slaves => false, } OptionParser.new do |opts| opts.banner = 'Usage: mongrel_swift [options]' @@ -27,6 +29,9 @@ opts.on('-d','--daemonize','Whether mongrel_rails should put itself into the background.') do |yn| config[:daemonize] = true end + opts.on('-s','--use-slaves','Whether mongrel_rails should be run using Slaves.') do |yn| + config[:use_slaves] = true + end opts.on('-n','--num-mongrels [NUM]','The number of mongrels to start.') do |numm| config[:num] = numm.to_i end @@ -39,16 +44,29 @@ def self.run parse_options + slaves = [] + args = [ + 'start', '-p', @config[:port], + '-e', @config[:env], + '-a', @config[:host], + ] + args += ['-C', @config[:conf]] if @config[:conf] @config[:num].times do |i| - cmd = "mongrel_rails start -p #{@config[:port]} " << - "-e #{@config[:env]} #{@config[:daemonize] ? '-d' : ''} " << - "-P #{File.join(@config[:pid],'dog' + i.to_s + '.pid')} " << - "#{@config[:conf] ? ' -C '+ at config[:conf] : ''} " << - "-a #{@config[:host]} " - output = `#{cmd}` + my_args = ['-P', File.join(@config[:pid],'dog' + i.to_s + '.pid')] + if @config[:use_slaves] + require 'slave' + require "#{File.dirname(__FILE__)}/mongrel_rails" + slaves << Slave.object(:async => true) { + Mongrel::Runner.new.run(args + my_args) + } + else + cmd = [File.join(File.dirname(__FILE__), 'mongrel_rails'), *(args + my_args)].join(' ') + output = `ruby #{cmd}` puts output end end + slaves.each {|t| t.join} if @config[:use_slaves] + end end Patch to apply after `cp mongrel_rails mongrel_rails.rb': --- mongrel_rails 2007-08-16 18:14:16.000000000 -0400 +++ mongrel_rails.rb 2007-08-16 18:55:35.000000000 -0400 @@ -243,10 +243,16 @@ end end end -end + class Runner + def initialize GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE, "rails" => GemPlugin::EXCLUDE + end -if not Mongrel::Command::Registry.instance.run ARGV + def run(argv) + if not Mongrel::Command::Registry.instance.run argv exit 1 end + end + end +end There is probably a better, DRYer way to do the latter (or all this, for that matter :-) ) -- Jos Backus jos at catnook.com From ni-di at web.de Fri Aug 17 04:53:40 2007 From: ni-di at web.de (Niko Dittmann) Date: Fri, 17 Aug 2007 10:53:40 +0200 Subject: [Swiftiply-users] http head prefixed with "00000000fa000" In-Reply-To: References: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> Message-ID: <534EE38D-0359-4C70-B3DB-1E50A630D29A@web.de> This doesn't just occur after restart or after the app not being invoked for some time but at random times. Sometimes once, sometimes three times in a row (I've 3 Mongrels running). Sorry for bugging you, but is there any cure in sight, Kirk? Do you need further information? Can I do anything else to help? Kind regards, Niko. From wyhaines at gmail.com Fri Aug 17 09:53:34 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 17 Aug 2007 06:53:34 -0700 Subject: [Swiftiply-users] http head prefixed with "00000000fa000" In-Reply-To: <534EE38D-0359-4C70-B3DB-1E50A630D29A@web.de> References: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> <534EE38D-0359-4C70-B3DB-1E50A630D29A@web.de> Message-ID: On 8/17/07, Niko Dittmann wrote: > This doesn't just occur after restart or after the app not being > invoked for some time but at random times. Sometimes once, sometimes > three times in a row (I've 3 Mongrels running). > > > Sorry for bugging you, but is there any cure in sight, Kirk? Do you > need further information? Can I do anything else to help? Ok. I am so far having no luck reproducing this. So, let me make sure I have the facts right: You are using Rails. There doesn't seem to be any pattern to when this happens. It's always the exact same sequence: 00000000fa000 Right? 13 characters? Kirk From wyhaines at gmail.com Fri Aug 17 12:01:02 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 17 Aug 2007 09:01:02 -0700 Subject: [Swiftiply-users] http head prefixed with "00000000fa000" In-Reply-To: References: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> <534EE38D-0359-4C70-B3DB-1E50A630D29A@web.de> Message-ID: This is solved. It is the result of a bug. I'm pinning it down now and am adding a testcase for it. The short term workaround is to just make sure you are not using a port under 4096 for your mongrel. You won't see it on 4096 or greater. Thanks, Kirk Haines From jos at catnook.com Sat Aug 18 18:31:49 2007 From: jos at catnook.com (Jos Backus) Date: Sat, 18 Aug 2007 15:31:49 -0700 Subject: [Swiftiply-users] Update: [patch] Make swiftiply_mongrel_rails fork to run mongrel_rails In-Reply-To: <20070817000212.GA11062@lizzy.catnook.local> References: <20070817000212.GA11062@lizzy.catnook.local> Message-ID: <20070818223149.GE24744@lizzy.catnook.local> This new patch doesn't use the slave gem but puts the fork() inside swiftiply_mongrel_rails. To prevent the forked children from becoming zombies each child has a Thread that blocks on a pipe read which unblocks and exits the child when the parent dies, preventing zombies. The --use-slaves option has been renamed --fork. The mongrel_rails.rb change from my previous post is still required for this patch. Thanks to Ara Howard for the idea. --- swiftiply_mongrel_rails.orig 2007-08-15 16:23:23.000000000 -0400 +++ swiftiply_mongrel_rails 2007-08-18 18:29:19.000000000 -0400 @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# vim:expandtab softtabstop=2 shiftwidth=2 ENV['SWIFT'] = 'true' require 'optparse' @@ -10,7 +11,8 @@ :pid => (File.expand_path(Dir.pwd)+'/log'), :host => '127.0.0.1', :port => 4000, - :num => 1 + :num => 1, + :fork => false, } OptionParser.new do |opts| opts.banner = 'Usage: mongrel_swift [options]' @@ -27,6 +29,9 @@ opts.on('-d','--daemonize','Whether mongrel_rails should put itself into the background.') do |yn| config[:daemonize] = true end + opts.on('-F','--fork','Whether swiftiply_mongrel_rails should fork to run mongrel_rails.') do |yn| + config[:fork] = true + end opts.on('-n','--num-mongrels [NUM]','The number of mongrels to start.') do |numm| config[:num] = numm.to_i end @@ -39,16 +44,46 @@ def self.run parse_options + args = [ + 'start', + '-p', @config[:port], + '-e', @config[:env], + '-a', @config[:host], + ] + args += ['-C', @config[:conf]] if @config[:conf] + children = [] @config[:num].times do |i| - cmd = "mongrel_rails start -p #{@config[:port]} " << - "-e #{@config[:env]} #{@config[:daemonize] ? '-d' : ''} " << - "-P #{File.join(@config[:pid],'dog' + i.to_s + '.pid')} " << - "#{@config[:conf] ? ' -C '+ at config[:conf] : ''} " << - "-a #{@config[:host]} " + my_args = ['-P', File.join(@config[:pid],'dog' + i.to_s + '.pid')] + if @config[:fork] + r, w = IO.pipe + cid = fork + unless cid # child + w.close + Thread.new { + begin + r.read + ensure + STDERR.puts "pid #{Process.pid}: parent died... exiting!" + Kernel.exit + end + } + require File.join(File.dirname(__FILE__), 'mongrel_rails') + Mongrel::Runner.new.run(args + my_args) + exit + else + r.close + children << cid + end + else + cmd = ['ruby', File.join(File.dirname(__FILE__), 'mongrel_rails'), *(args + my_args)].join(' ') output = `#{cmd}` puts output end end + $stderr.puts "waiting for children: #{children.join(' ')}" + Process.waitall + $stderr.puts "all children exited." + end end -- Jos Backus jos at catnook.com From wyhaines at gmail.com Mon Aug 20 10:00:24 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 20 Aug 2007 07:00:24 -0700 Subject: [Swiftiply-users] http head prefixed with "00000000fa000" In-Reply-To: <47896CFC-D67C-43C5-8108-527883AC92BF@web.de> References: <29118E91-4E86-40D9-82B7-76DEC33417CB@web.de> <47896CFC-D67C-43C5-8108-527883AC92BF@web.de> Message-ID: On 8/16/07, Niko Dittmann wrote: > It seems to happen just when it sits unused for some time. I'll send > you a link to the app in a private email. It probably doesn't have to sit unused for very long. I imagine that a few minutes of complete disuse is sufficient when the port number is below 4096. Kirk From auto359669 at hushmail.com Tue Aug 28 05:00:21 2007 From: auto359669 at hushmail.com (Auto 359669) Date: Tue, 28 Aug 2007 19:00:21 +1000 Subject: [Swiftiply-users] Swiftiply & Mongrel on Debian Etch Message-ID: <20070828090021.9B9E222822@mailserver9.hushmail.com> Hi All, I have a standard Debian Etch (2.6.18-4-486): ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux] mongrel (1.0.1) swiftiply (0.6.1) There is an existing Ruby application (RadiantCMS) located at /var/www/radiant, which is the one I am trying to serve. cat config/swiftiply.yml ## swiftiply.yaml ## cluster_address: 192.168.100.30 cluster_port: 80 daemonize: true epoll: true epoll_descriptors: 20000 map: - incoming: - testonly.org ## outgoing: 127.0.0.1:30000 outgoing: 192.168.100.30:30000 default: true docroot: /var/www/radiant ## outgoing: 127.0.0.1:30020 outgoing: 192.168.100.30:30020 - incoming: - testonly.org outgoing: 127.0.0.1:30030 redeployable: true docroot: /var/www/radiant cache_directory: public cache_extensions: - htm - html - txt - kml - kmz Launching Swiftiply using: sudo swiftiply -c config/swiftiply.yml Pointing a browser at http://192.168.100.30 => Server Unavailable Perhaps I have misunderstood what is supposed to occur but any comments or advice would be welcome. Auto 359669 -- Learn to trade with confidence! Online Stock Trading. Click Now! http://tagline.hushmail.com/fc/Ioyw6h4dPc0Afl5zJzbuz2TxmIFCzLqtEqK2ulnOWEoaKFKvtA4fih/ From wyhaines at gmail.com Tue Aug 28 10:06:45 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 28 Aug 2007 07:06:45 -0700 Subject: [Swiftiply-users] Swiftiply & Mongrel on Debian Etch In-Reply-To: <20070828090021.9B9E222822@mailserver9.hushmail.com> References: <20070828090021.9B9E222822@mailserver9.hushmail.com> Message-ID: On 8/28/07, Auto 359669 wrote: > ## swiftiply.yaml > ## > cluster_address: 192.168.100.30 > cluster_port: 80 > daemonize: true > epoll: true > epoll_descriptors: 20000 > map: > - incoming: > - testonly.org > ## outgoing: 127.0.0.1:30000 > outgoing: 192.168.100.30:30000 > default: true > docroot: /var/www/radiant > ## outgoing: 127.0.0.1:30020 > outgoing: 192.168.100.30:30020 > - incoming: > - testonly.org > outgoing: 127.0.0.1:30030 > redeployable: true > docroot: /var/www/radiant > cache_directory: public > cache_extensions: > - htm > - html > - txt > - kml > - kmz > > Launching Swiftiply using: > > sudo swiftiply -c config/swiftiply.yml > > Pointing a browser at http://192.168.100.30 => Server Unavailable Okay. First of all, since the IP address is not in an incoming section, it won't match to one of those sections when you make a request using it. Second, it looks like you have testonly.org listed in two separate incoming sections? Try this: ## swiftiply.yaml ## cluster_address: 192.168.100.30 cluster_port: 80 daemonize: true epoll: true epoll_descriptors: 20000 map: - incoming: - testonly.org - 192.168.100.30 outgoing: 127.0.0.1:30030 redeployable: true docroot: /var/www/radiant cache_directory: public cache_extensions: - htm - html - txt - kml - kmz If your backend(s) are connecting to 127.0.0.1:30030, then this will work. Kirk Haines From auto359669 at hushmail.com Wed Aug 29 06:49:20 2007 From: auto359669 at hushmail.com (Auto 359669) Date: Wed, 29 Aug 2007 20:49:20 +1000 Subject: [Swiftiply-users] Failure on Multiple Site Swiftiply.yml Message-ID: <20070829104926.21C4BC3821@mailserver10.hushmail.com> Hi, I am attemtping to configure a multiple site swiftiply.yml to run 3 seperate instances of Radiant on the one server. Each Radiant is located in it's own directory; /var/www/radiant /var/www/radiant02 /var/www/radiant03 The existing swiftiply.yml is located in /var/www/radiant/config/ Here is the file: -- ## ## swiftiply.yaml ## cluster_address: 192.168.100.30 cluster_port: 80 daemonize: true epoll: true epoll_descriptors: 20000 map: - incoming: - debser00 - 192.168.100.30 default: true outgoing: 127.0.0.1:30030 redeployable: true docroot: /var/www/radiant cache_directory: public cache_extensions: - htm - html - txt - kml - kmz - incoming: - debser01 - 192.168.100.30 default: true outgoing: 127.0.0.1:30040 redeployable: true docroot: /var/www/ecofacts cache_directory: public cache_extensions: - htm - html - txt - kml - kmz -- When I run swiftiply -c /var/www/radiant/config/swiftiply.yml & swiftiply_mongrel_rails start I can load http://debser00 but not http://debser01 Any ideas why this has failed? Auto 359669 -- Click for free info on business schools, $150K/ year potential. http://tagline.hushmail.com/fc/Ioyw6h4dC6mpFqEN5HjUl9CwgYup6IohZTnnrMYtM8cAZX9cshcOcJ/