From lists at ruby-forum.com Fri Aug 1 01:53:46 2008 From: lists at ruby-forum.com (Tim Harper) Date: Fri, 1 Aug 2008 07:53:46 +0200 Subject: [Mongrel] Unix Domain Sockets + Fork for improved scalability In-Reply-To: <7f4149bb0805052037s458302f0n8c0111f36d79bab9@mail.gmail.com> References: <7f4149bb0805052037s458302f0n8c0111f36d79bab9@mail.gmail.com> Message-ID: Brian, I found your patch while looking for a solution that we've needed to decrease startup times, take advantage of COW, have completely graceful restarts ( < 0.1 seconds downtime max, new server must be ready to immediately start processing requests before the old server is booted out ), and scheduling of garbage collection between results. Your patch turned out to be a very good fit for all 4 of these arenas :) Though, I did need to do some refactoring and additional work on what you've started. The main parts of my improvements are the "-R" flag (Mongrel::UnixDispatchServer only), graceful shutdowns, and ability to specify pre/post fork hooks. The -R flag is like a hostile takeover restart. A new server boots up, gets all loaded and ready to go, then sends a TERM signal to the old process. The old process IMMEDIATELY stops listening on it's port, and waits for it's children to finish their requests. As soon as they are all done, the server shuts down. My changes are available here in my fork of mongrel: http://github.com/timcharper/mongrel/tree/super_cow_mongrel Here's the script I use to start up mongrel: http://pastie.org/245416 I'd still like to see some additional cleanup and get some input on the changes I've made. Additionally, I did all this while working for my company Lead Media Partners, so they should get a plug for this contribution. Peace and harmony, Tim -- Posted via http://www.ruby-forum.com/. From jos at catnook.com Fri Aug 1 02:19:22 2008 From: jos at catnook.com (Jos Backus) Date: Thu, 31 Jul 2008 23:19:22 -0700 Subject: [Mongrel] Unix Domain Sockets + Fork for improved scalability In-Reply-To: References: <7f4149bb0805052037s458302f0n8c0111f36d79bab9@mail.gmail.com> Message-ID: <20080801061922.GA67940@lizzy.catnook.local> This looks interesting. A question: can this version be made to run in the foreground, like `httpd -DFOREGROUND'? I'd like to use daemontools to control the master process, which requires the master to not fork and background itself but stay in the foregound and respond to signals. -- Jos Backus jos at catnook.com From lists at ruby-forum.com Fri Aug 1 02:28:18 2008 From: lists at ruby-forum.com (Tim Harper) Date: Fri, 1 Aug 2008 08:28:18 +0200 Subject: [Mongrel] Unix Domain Sockets + Fork for improved scalability In-Reply-To: <20080801061922.GA67940@lizzy.catnook.local> References: <7f4149bb0805052037s458302f0n8c0111f36d79bab9@mail.gmail.com> <20080801061922.GA67940@lizzy.catnook.local> Message-ID: <9d2aaef13c6636345eb5382db22d17a0@ruby-forum.com> Jos Backus wrote: > This looks interesting. > > A question: can this version be made to run in the foreground, like > `httpd > -DFOREGROUND'? I'd like to use daemontools to control the master > process, > which requires the master to not fork and background itself but stay in > the > foregound and respond to signals. It's run fine for me either in the foreground or daemonized. -- Posted via http://www.ruby-forum.com/. From jos at catnook.com Fri Aug 1 12:28:40 2008 From: jos at catnook.com (Jos Backus) Date: Fri, 1 Aug 2008 09:28:40 -0700 Subject: [Mongrel] Unix Domain Sockets + Fork for improved scalability In-Reply-To: <9d2aaef13c6636345eb5382db22d17a0@ruby-forum.com> References: <7f4149bb0805052037s458302f0n8c0111f36d79bab9@mail.gmail.com> <20080801061922.GA67940@lizzy.catnook.local> <9d2aaef13c6636345eb5382db22d17a0@ruby-forum.com> Message-ID: <20080801162840.GA74386@lizzy.catnook.local> On Fri, Aug 01, 2008 at 08:28:18AM +0200, Tim Harper wrote: > It's run fine for me either in the foreground or daemonized. Great, thanks Tim. -- Jos Backus jos at catnook.com From lists at ruby-forum.com Tue Aug 5 21:52:43 2008 From: lists at ruby-forum.com (Josh Moore) Date: Wed, 6 Aug 2008 03:52:43 +0200 Subject: [Mongrel] Problem with daemonize Message-ID: Hi, I am new to working with mongrel (and rails in general) and I am experiencing a problem with mongrel. I have a rails application that for one view parses some information from our SVN server. I have to call the SVN several times to get all the information I need and it takes about 30 sec. to complete the request (This is ok because it is an internal app). The problem is that this only works when I run mongrel non daemonized. If I deamonize the process the rest of my rails site works fine. But, this page hangs when I try to load it. I have looked through the mongrel.log, error.log, and development.log (still using the development environment) and I cannot find any errors. The web browser (firefox 3) just sits there and acts like it loads the page but nothing happens. Does anybody know what might be the problem? It seams weird to me that it works when non deamonized but does not work when mongrel is run as a deamon. Thanks for any ideas. Josh -- Posted via http://www.ruby-forum.com/. From mcr at simtone.net Tue Aug 5 22:00:48 2008 From: mcr at simtone.net (mcr at simtone.net) Date: Tue, 05 Aug 2008 22:00:48 -0400 Subject: [Mongrel] Problem with daemonize In-Reply-To: References: Message-ID: <20080806020731.2627A18581B0@rubyforge.org> >>>>> "Josh" == Josh Moore writes: Josh> happens. Does anybody know what might be the problem? It seams weird Josh> to me that it works when non deamonized but does not work when mongrel Josh> is run as a deamon. When daemonized, does it run as you, or as another user? When it hangs, do you see "svn" processes waiting in the ps listing? Do you get errors from the popen calls that you are doing? Do you get anything when you look at the page source for the page that loads? -- Michael Richardson Director -- Consumer Desktop Development, Simtone Corporation, Ottawa, Canada Personal: http://www.sandelman.ca/mcr/ SIMtone Corporation fundamentally transforms computing into simple, secure, and very low-cost network-provisioned services pervasively accessible by everyone. Learn more at www.simtone.net and www.SIMtoneVDU.com From lists at ruby-forum.com Tue Aug 5 22:37:23 2008 From: lists at ruby-forum.com (Josh Moore) Date: Wed, 6 Aug 2008 04:37:23 +0200 Subject: [Mongrel] Problem with daemonize In-Reply-To: <20080806020731.2627A18581B0@rubyforge.org> References: <20080806020731.2627A18581B0@rubyforge.org> Message-ID: > When daemonized, does it run as you, or as another user? The deamonized process runs as me. > When it hangs, do you see "svn" processes waiting in the ps listing? There is no svn process in the ps listing ("ps afx | grep svn") > Do you get errors from the popen calls that you are doing? It actually hangs on the call and I do not get any output. > Do you get anything when you look at the page source for the page that > loads? I get this "" Thanks, Josh unknown wrote: >>>>>> "Josh" == Josh Moore writes: > Josh> happens. Does anybody know what might be the problem? It > seams weird > Josh> to me that it works when non deamonized but does not work when > mongrel > Josh> is run as a deamon. > > When daemonized, does it run as you, or as another user? > When it hangs, do you see "svn" processes waiting in the ps listing? > Do you get errors from the popen calls that you are doing? > Do you get anything when you look at the page source for the page that > loads? > > -- > Michael Richardson > Director -- Consumer Desktop Development, Simtone Corporation, Ottawa, > Canada > Personal: http://www.sandelman.ca/mcr/ > > SIMtone Corporation fundamentally transforms computing into simple, > secure, and very low-cost network-provisioned services pervasively > accessible by everyone. Learn more at www.simtone.net and > www.SIMtoneVDU.com -- Posted via http://www.ruby-forum.com/. From mcr at simtone.net Wed Aug 6 09:21:39 2008 From: mcr at simtone.net (mcr at simtone.net) Date: Wed, 06 Aug 2008 09:21:39 -0400 Subject: [Mongrel] Problem with daemonize In-Reply-To: References: <20080806020731.2627A18581B0@rubyforge.org> Message-ID: <20080806132141.A2E4F185818A@rubyforge.org> >>>>> "Josh" == Josh Moore writes: >> When daemonized, does it run as you, or as another user? Josh> The deamonized process runs as me. >> When it hangs, do you see "svn" processes waiting in the ps listing? Josh> There is no svn process in the ps listing ("ps afx | grep svn") >> Do you get errors from the popen calls that you are doing? Josh> It actually hangs on the call and I do not get any output. I would run "strace -f -p XXXX" on the mongrel process(es), and try things. I would suspect either that the exec part of the popen() fails due to $PATH issues. Since there is no "svn" process around, then it should not be an issue with the underlying ssh that might be invoked. You might also replace the call to svn with echo/cat/env. instead of: foo = IO.popen("svn stuff", "r") do: foo = IO.popen("sh -c 'env >/tmp/env$$; cat /tmp/canned-svn-reply'", "r") and if that helps diag things. -- Michael Richardson Director -- Consumer Desktop Development, Simtone Corporation, Ottawa, Canada Personal: http://www.sandelman.ca/mcr/ SIMtone Corporation fundamentally transforms computing into simple, secure, and very low-cost network-provisioned services pervasively accessible by everyone. Learn more at www.simtone.net and www.SIMtoneVDU.com From lists at ruby-forum.com Wed Aug 6 17:33:46 2008 From: lists at ruby-forum.com (Roberto Ramirez) Date: Wed, 6 Aug 2008 23:33:46 +0200 Subject: [Mongrel] restart mongrel Message-ID: can i, restart my mongrel server, from a rails application... i need to do it because i have to modify my database.yml and ldap.yml from my settings_controller -- Posted via http://www.ruby-forum.com/. From wayneeseguin at gmail.com Thu Aug 7 16:30:04 2008 From: wayneeseguin at gmail.com (Wayne Seguin) Date: Thu, 7 Aug 2008 16:30:04 -0400 Subject: [Mongrel] restart mongrel In-Reply-To: References: Message-ID: Simply have your other rails application send the mongrel server a SIGQUIT. This should work fine. ~Wayne On Aug 6, 2008, at 17:33 , Roberto Ramirez wrote: > can i, restart my mongrel server, from a rails application... i need > to > do it because i have to modify my database.yml and ldap.yml from my > settings_controller > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Fri Aug 8 12:35:46 2008 From: lists at ruby-forum.com (John Hancock) Date: Fri, 8 Aug 2008 18:35:46 +0200 Subject: [Mongrel] Why Mongrel with NginX Message-ID: <3c3921fe0c21a5270d3b6aad7de93a8b@ruby-forum.com> Hi, I'm a newbie to Ruby. I'm installing an small server (256MB RAM) with NginX, Neko, Perl, PHP4, PHP5, Ruby & MySQL. It's easy Perl, Neko & PHP with FastCGI but why to use a mongrel cluster? It's my first time with nginx & ruby, so why I should use mongrel? Why not just FastCGI-ruby if available? Is mongrel cluster too much load for 256MB RAM? With PHP there is no security for shared servers. How does ruby handle shared hosting security? Is there an appropriate way to install ruby-mongrel this way? Thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Aug 8 15:41:38 2008 From: lists at ruby-forum.com (John Hancock) Date: Fri, 8 Aug 2008 21:41:38 +0200 Subject: [Mongrel] Why Mongrel with NginX In-Reply-To: <20080808184134.GA6504@localdomain> References: <3c3921fe0c21a5270d3b6aad7de93a8b@ruby-forum.com> <20080808184134.GA6504@localdomain> Message-ID: > It varies tremendously with the kind of applications you develope. I > will assume that, as is the case with most new Ruby webapps, you are > developing Rails. In my server, each Mongrel instance takes typically > between 20 and 50 MB RAM, for smallish applications. In this scenario, I'll wait to get an other VPS because 2 mongrel instances are taking more ram than the rest of the server. In the event of high load my VPS will start killing any process because doesn't have swap space. What specs you would request for a ruby server (maybe just mongrel cluster and mysql listening to the prior VPS) > With Mongrel, you can launch each instance as a different user - > The webserver just opens a socket to talk with Mongrel, but each > Mongrel can be owned by a different user, and get the user's set of > permissions. So, a shared server is not the best approach for ruby (or getting the same problems of PHP). Having 100 accounts with the corresponding instance would be problematic. Thank you -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Aug 9 21:28:40 2008 From: lists at ruby-forum.com (Luiz Biagi) Date: Sun, 10 Aug 2008 03:28:40 +0200 Subject: [Mongrel] custom_require.rb:27:in `gem_original_require': no such file Message-ID: <4f4c9ae04e9350da8df9e96d2d5b96e4@ruby-forum.com> Hi, maybe that's a lame question but it's hard to find about't. I don't know what is happening but my mongrel just don't start, I'm using: ------ RubyGems Environment: - RUBYGEMS VERSION: 1.2.0 - RUBY VERSION: 1.8.6 (2008-07-17 patchlevel 279) [i386-mingw32] - INSTALLATION DIRECTORY: C:/Ruby18/lib/ruby/gems/1.8 - RUBY EXECUTABLE: C:/Ruby18/bin/ruby.exe - EXECUTABLE DIRECTORY: C:/Ruby18/bin - RUBYGEMS PLATFORMS: - ruby - x86-mingw32 - GEM PATHS: - C:/Ruby18/lib/ruby/gems/1.8 - C:/Users/FullMetal Alchemist/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => falsego - :backtrace => false - :bulk_threshold => 1000 - :sources => ["http://gems.rubyforge.org", "http://gems.github.com"] - REMOTE SOURCES: - http://gems.rubyforge.org - http://gems.github.com i'm using windows vista too, and when i'm tryingh to start mongrel I get: C:\projects\blogsys>ruby script\server => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.0 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_ require': no such file to load -- win32/service (MissingSourceFile) from C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in ` require' from C:/Ruby18/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_sup port/dependencies.rb:509:in `require' from C:/Ruby18/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_sup port/dependencies.rb:354:in `new_constants_in' from C:/Ruby18/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_sup port/dependencies.rb:509:in `require' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel_service-0.1/lib/mongrel_se rvice/init.rb:5 from C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in ` gem_original_require' from C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in ` require' from C:/Ruby18/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_sup port/dependencies.rb:509:in `require' ... 17 levels... from C:/Ruby18/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb :39 from C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in ` gem_original_require' from C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in ` require' from script/server:3 I've just installed the new version of ruby one click installer, and since that i just can't start mongrel, which I believe could be a windows compability problem, please help me -- Posted via http://www.ruby-forum.com/. From will at hotgazpacho.com Sat Aug 9 22:54:32 2008 From: will at hotgazpacho.com (Will Green) Date: Sat, 09 Aug 2008 22:54:32 -0400 Subject: [Mongrel] custom_require.rb:27:in `gem_original_require': no such file In-Reply-To: <4f4c9ae04e9350da8df9e96d2d5b96e4@ruby-forum.com> References: <4f4c9ae04e9350da8df9e96d2d5b96e4@ruby-forum.com> Message-ID: <489E5868.6050707@hotgazpacho.com> The answer is in the dump from Mongrel startup: `gem_original_require': no such file to load -- win32/service (MissingSourceFile) Try installing the win32-service gem. From ry at tinyclouds.org Sun Aug 10 08:47:18 2008 From: ry at tinyclouds.org (ryah dahl) Date: Sun, 10 Aug 2008 14:47:18 +0200 Subject: [Mongrel] Why Mongrel with NginX In-Reply-To: <3c3921fe0c21a5270d3b6aad7de93a8b@ruby-forum.com> References: <3c3921fe0c21a5270d3b6aad7de93a8b@ruby-forum.com> Message-ID: <3ae7f4480808100547t509d8fd0n29cd5bf575ea8449@mail.gmail.com> Hi John On Fri, Aug 8, 2008 at 6:35 PM, John Hancock wrote: > Hi, I'm a newbie to Ruby. I'm installing an small server (256MB RAM) > with NginX, Neko, Perl, PHP4, PHP5, Ruby & MySQL. It's easy Perl, Neko & > PHP with FastCGI but why to use a mongrel cluster? The only conceptual difference is the protocol being used between the reverse-proxy (nginx in this case) and the application servers. FastCGI is a protocol for reverse-proxies to speak to application servers. FastCGI is strange because it carries HTTP but is not HTTP. With a Mongrel-style setup your application servers speak to the reverse-proxy via HTTP. FastCGI has a slight advantage over HTTP in that it's easier to parser and more space-efficient on the line. However it adds an extra layer of complexity - an extra protocol. You can't, for example, use CURL to access a FastCGI application server. The structure is the same though - a load balancer reverse proxy process (nginx) and many application server processes (mongrel or FastCGI instances). The load balancer distributes requests to the app servers - gets a responses and sends them back to the clients. Mongrel has worked better for many of us - not because of the protocol difference - because it handles requests better. Ruby-FastCGI is also a web server and has request handling logic - it just speaks FastCGI instead of HTTP. Someone could develop a better Ruby-FastCGI binding which understood FastCGI but handled connections from the reverse-proxy better - but that hasn't been done yet. And IMO it is a bit pointless - there need not be a special protocol just for communication between load balancers and app servers. ry From lists at ruby-forum.com Sun Aug 10 11:11:41 2008 From: lists at ruby-forum.com (Luiz Biagi) Date: Sun, 10 Aug 2008 17:11:41 +0200 Subject: [Mongrel] custom_require.rb:27:in `gem_original_require': no such In-Reply-To: <489E5868.6050707@hotgazpacho.com> References: <4f4c9ae04e9350da8df9e96d2d5b96e4@ruby-forum.com> <489E5868.6050707@hotgazpacho.com> Message-ID: <0941c65130835314042021878536b729@ruby-forum.com> Will Green wrote: > The answer is in the dump from Mongrel startup: > > `gem_original_require': no such file to load -- win32/service > (MissingSourceFile) > > Try installing the win32-service gem. thanks man, I somehow was with the service version 0.0.1, now I installed the mswin32 up to date version and I'm receiving a new error: => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.0 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 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins Exiting C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/config urator.rb:372:in `trap': unsupported signal SIGUSR1 (ArgumentError) from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/m ongrel/configurator.rb:372:in `setup_signals' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/. ./lib/mongrel/rails.rb:174:in `setup_rails_signals' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/m ongrel_rails:124:in `cloaker_' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/m ongrel/configurator.rb:149:in `call' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/m ongrel/configurator.rb:149:in `listener' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/m ongrel_rails:99:in `cloaker_' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/m ongrel/configurator.rb:50:in `call' from C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/m ongrel/configurator.rb:50:in `initialize' ... 14 levels... from C:/Ruby18/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb :39 from C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in ` gem_original_require' from C:/Ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in ` require' from script/server:3 maybe I should use other version of mongrel? thanks for the help -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Sun Aug 10 16:23:24 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 10 Aug 2008 22:23:24 +0200 Subject: [Mongrel] custom_require.rb:27:in `gem_original_require': no such In-Reply-To: <0941c65130835314042021878536b729@ruby-forum.com> References: <4f4c9ae04e9350da8df9e96d2d5b96e4@ruby-forum.com> <489E5868.6050707@hotgazpacho.com> <0941c65130835314042021878536b729@ruby-forum.com> Message-ID: <71166b3b0808101323g118a53e2oe0b2dd8bb75f79f8@mail.gmail.com> On Sun, Aug 10, 2008 at 5:11 PM, Luiz Biagi wrote: > Will Green wrote: >> The answer is in the dump from Mongrel startup: >> >> `gem_original_require': no such file to load -- win32/service >> (MissingSourceFile) >> >> Try installing the win32-service gem. > > thanks man, I somehow was with the service version 0.0.1, now I > installed the mswin32 up to date version and I'm receiving a new error: > > => Booting Mongrel (use 'script/server webrick' to force WEBrick) > => Rails 2.1.0 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 > ** Starting Rails with development environment... > ** Rails loaded. > ** Loading any Rails specific GemPlugins > Exiting > C:/Ruby18/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/config > urator.rb:372:in `trap': unsupported signal SIGUSR1 (ArgumentError) > from Can you tell us which version of Ruby and RubyGems you have installed? Looks like is trying to setup signals not support on Windows (SIGUSR1). Is just me or you've installed mongrel with --platform=mswin32 during the gem installation? That is plain wrong. You should install the gem available for your platform, which I think is mingw32. -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From lists at ruby-forum.com Sun Aug 10 17:45:40 2008 From: lists at ruby-forum.com (Luiz Biagi) Date: Sun, 10 Aug 2008 23:45:40 +0200 Subject: [Mongrel] custom_require.rb:27:in `gem_original_require': no such In-Reply-To: <71166b3b0808101323g118a53e2oe0b2dd8bb75f79f8@mail.gmail.com> References: <4f4c9ae04e9350da8df9e96d2d5b96e4@ruby-forum.com> <489E5868.6050707@hotgazpacho.com> <0941c65130835314042021878536b729@ruby-forum.com> <71166b3b0808101323g118a53e2oe0b2dd8bb75f79f8@mail.gmail.com> Message-ID: <289ada8171e948208a63f57f1167e268@ruby-forum.com> Luis Lavena wrote: > On Sun, Aug 10, 2008 at 5:11 PM, Luiz Biagi > wrote: > You should install the gem available for your platform, which I think > is mingw32. I followed Akita's explanation, and that was wrong now I could do it, following your blog recomendations thank you! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Aug 10 19:15:19 2008 From: lists at ruby-forum.com (John Hancock) Date: Mon, 11 Aug 2008 01:15:19 +0200 Subject: [Mongrel] Why Mongrel with NginX In-Reply-To: <3ae7f4480808100547t509d8fd0n29cd5bf575ea8449@mail.gmail.com> References: <3c3921fe0c21a5270d3b6aad7de93a8b@ruby-forum.com> <3ae7f4480808100547t509d8fd0n29cd5bf575ea8449@mail.gmail.com> Message-ID: <9815108f8c220dde838045e0bdbe3323@ruby-forum.com> > Mongrel has worked better for many of us - not because of the protocol > difference - because it handles requests better. Ruby-FastCGI is also > a web server and has request handling logic - it just speaks FastCGI > instead of HTTP. The easier and useful answers are never given on documentation, thanks everybody. I'm just dropping Apache because it's not memory efficient and these days with my question I've searching all about mongrel. There is a new branch of the Ruby language called "Ruby Enterprise Edition" that seems to use enough memory to fit in my VPS. The problem is the server it uses, Apache. For me there is not value to reduce the memory usage of ruby when it is done into a platform that is not memory efficient. Is there an adaptation of mongrel to use ruby enterprise? This is an awesome forum with awesome pals. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Aug 11 08:01:40 2008 From: lists at ruby-forum.com (Hongli Lai) Date: Mon, 11 Aug 2008 14:01:40 +0200 Subject: [Mongrel] Why Mongrel with NginX In-Reply-To: <9815108f8c220dde838045e0bdbe3323@ruby-forum.com> References: <3c3921fe0c21a5270d3b6aad7de93a8b@ruby-forum.com> <3ae7f4480808100547t509d8fd0n29cd5bf575ea8449@mail.gmail.com> <9815108f8c220dde838045e0bdbe3323@ruby-forum.com> Message-ID: <7dbbce305441c9c81d76ecfbb723ba27@ruby-forum.com> John Hancock wrote: > The easier and useful answers are never given on documentation, thanks > everybody. > I'm just dropping Apache because it's not memory efficient and these > days with my question I've searching all about mongrel. > There is a new branch of the Ruby language called "Ruby Enterprise > Edition" that seems to use enough memory to fit in my VPS. The problem > is the server it uses, Apache. For me there is not value to reduce the > memory usage of ruby when it is done into a platform that is not memory > efficient. Is there an adaptation of mongrel to use ruby enterprise? > > This is an awesome forum with awesome pals. At the moment Mongrel can't use the copy-on-write optimizations provided by Ruby Enterprise Edition. As for Apache, it's possible to tweak it to lower its memory usage to levels comparable to Nginx. The key lies in disabling all modules that you don't need, and using the worker MPM instead of the default prefork MPM, with settings comparable to Nginx's. The resulting memory usage is described at http://www.rubyenterpriseedition.com/comparisons.html. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Aug 13 17:45:04 2008 From: lists at ruby-forum.com (Chris Schmitt) Date: Wed, 13 Aug 2008 23:45:04 +0200 Subject: [Mongrel] Unresponsive Mongrel Windows 2003 Timeout Shutdown Message-ID: I have a very strange issue going on that just started happening last week. I am running an apache/mongrel stack on a windows 2003 box connecting to a sql server 2005. Apache 2.2.3 Mongrel 1.1.5 Since last Thursday I have had 5 crashes where the mongrel service becomes unresponsive. If I restart the service all is fine. Nothing is being reported in the rails logs... But I did notice something in the mongrel logs. Each time it look like I get the following log entry: ** INT signal received. Wed Aug 13 15:01:20 -0500 2008: Reaping 103 threads for slow workers because of 'shutdown' Thread # is too old, killing. Wed Aug 13 15:01:20 -0500 2008: Error calling Dispatcher.dispatch # c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:221:in `process' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:159:in `process_client' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:158:in `each' I have seen this pattern repeated for each of the crashes. I have 5 instances running and about 50 concurrent users who are banging away at this web application. Any advice or thoughts would be much appreciated. Thanks in advance -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Aug 14 00:18:59 2008 From: lists at ruby-forum.com (Josh Moore) Date: Thu, 14 Aug 2008 06:18:59 +0200 Subject: [Mongrel] Problem with daemonize In-Reply-To: <20080806132141.A2E4F185818A@rubyforge.org> References: <20080806020731.2627A18581B0@rubyforge.org> <20080806132141.A2E4F185818A@rubyforge.org> Message-ID: <2c2aa4fd62a86ea986d99961e7e81f02@ruby-forum.com> Hi, Sorry it took so long have been called way to other projects. Now that I am back I have been doing some looking and it seams whenever I try to access the file system (even to run an 'ls' or 'pwd' command) it spawns another mongrel and hangs. The last line in the strace log: 20558 select(4, [3], [2], [], {0, 871586}) = -1 EBADF (Bad file descriptor) This line prints a huge number of times in a very very short period of time (I shortend the log so that it would be smaller. But it printed this line in the order of 100,000 times in a couple of minutes). Even when I run as the root user this same thing happens. I have attached the strace log because I have looked at it but cannot really make heads or tails of what it means. Thanks, for all ideas. Josh P.S. Sorry, the strace file is about 400k and is to big to attach. If anybody is willing to look at it please just email me joshua.moore at armorize.com and I will be happy to send it to you. unknown wrote: >>>>>> "Josh" == Josh Moore writes: > >> When daemonized, does it run as you, or as another user? > Josh> The deamonized process runs as me. > > >> When it hangs, do you see "svn" processes waiting in the ps > listing? > Josh> There is no svn process in the ps listing ("ps afx | grep > svn") > > >> Do you get errors from the popen calls that you are doing? > Josh> It actually hangs on the call and I do not get any output. > > I would run "strace -f -p XXXX" on the mongrel process(es), and try > things. I would suspect either that the exec part of the popen() fails > due to $PATH issues. Since there is no "svn" process around, then it > should not be an issue with the underlying ssh that might be invoked. > You might also replace the call to svn with echo/cat/env. > > instead of: > foo = IO.popen("svn stuff", "r") > > do: > foo = IO.popen("sh -c 'env >/tmp/env$$; cat /tmp/canned-svn-reply'", > "r") > > and if that helps diag things. > > -- > Michael Richardson > Director -- Consumer Desktop Development, Simtone Corporation, Ottawa, > Canada > Personal: http://www.sandelman.ca/mcr/ > > SIMtone Corporation fundamentally transforms computing into simple, > secure, and very low-cost network-provisioned services pervasively > accessible by everyone. Learn more at www.simtone.net and > www.SIMtoneVDU.com -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Thu Aug 14 18:47:54 2008 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 15 Aug 2008 00:47:54 +0200 Subject: [Mongrel] Unresponsive Mongrel Windows 2003 Timeout Shutdown In-Reply-To: References: Message-ID: <71166b3b0808141547j2036228dl93d3cd21eada2d68@mail.gmail.com> On Wed, Aug 13, 2008 at 11:45 PM, Chris Schmitt wrote: > I have a very strange issue going on that just started happening last > week. I am running an apache/mongrel stack on a windows 2003 box > connecting to a sql server 2005. > > Apache 2.2.3 > Mongrel 1.1.5 > > Since last Thursday I have had 5 crashes where the mongrel service > becomes unresponsive. If I restart the service all is fine. Nothing > is being reported in the rails logs... But I did notice something in the > mongrel logs. > > Each time it look like I get the following log entry: > > ** INT signal received. > Wed Aug 13 15:01:20 -0500 2008: Reaping 103 threads for slow workers > because of 'shutdown' > Thread # is too old, killing. > Wed Aug 13 15:01:20 -0500 2008: Error calling Dispatcher.dispatch > # > c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:221:in > `process' > c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:159:in > `process_client' > c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:158:in > `each' > > I have seen this pattern repeated for each of the crashes. I have 5 > instances running and about 50 concurrent users who are banging away at > this web application. > > Any advice or thoughts would be much appreciated. > > Thanks in advance Hey Chris, I have seen this, but with mysql. When you try to stop the mongrel_service, mongrel is trying to stop all the threads that are pending, so that is what you see is being logged in the mongrel log. There are several ways to end having "stalled" threads, a few of them involves timeouts and disconnections from the database. You can check the docs about that here: http://mongrel.rubyforge.org/wiki/FAQ#WhydoIgetMySQLlostconnectiontodatabaseerrors The other issue can be related to code that is being doing something wrong in some request and just never finish those. This FAQ section describe what to do on a *nix environment: http://mongrel.rubyforge.org/wiki/FAQ#WhydoesMongrelkeepdyingonme But since you're not there, you can: 1) remove and reinstall the mongrel_service adding the debugging option (-B or --debug) 2) Start the service 3) when you see it is staled, stop it and collect the log information to pinpoint which thread and which library break it.. Hope this help you, but without more information about your Rails version, Ruby version (and patchlevel) and some lirbaries involved I cannot comment further than that :-D Regards, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From lists at ruby-forum.com Fri Aug 15 10:19:52 2008 From: lists at ruby-forum.com (Chris Schmitt) Date: Fri, 15 Aug 2008 16:19:52 +0200 Subject: [Mongrel] Unresponsive Mongrel Windows 2003 Timeout Shutdown In-Reply-To: <71166b3b0808141547j2036228dl93d3cd21eada2d68@mail.gmail.com> References: <71166b3b0808141547j2036228dl93d3cd21eada2d68@mail.gmail.com> Message-ID: Thanks Luis.. I will check those links out. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Aug 15 17:18:45 2008 From: lists at ruby-forum.com (Tam Kbe) Date: Fri, 15 Aug 2008 23:18:45 +0200 Subject: [Mongrel] Cant access ROR site externally using mongrel on shared host Message-ID: <77f1177a1e52a455a7223117b255e70a@ruby-forum.com> Hi, I have been trying to deploy my Ruby on Rails site using Mongrel on Shared host. Mongrel seems to start fine using the command below: cd /home/linkamed/public_html/mysite mongrel_rails start -p 12003 -l /home/linkamed/public_html/mysite/log/mongrel.log -c /home/linkamed/public_html/mysite/ -e production -d and If I type something like this on the server: curl http://localhost:12003/users I get an HTML code output that resembles what should be displayed which means that Mongrel is working fine. I just couldn't figure out how to access it externally!! I tried www.mysite.com:12003/users - www.mysite.com/12003/users - www.mysite.com/mysite/users Is there a rule or configuration I have to do for this to work? Thanks in Advance, Tam -- Posted via http://www.ruby-forum.com/. From elw at brandorr.com Fri Aug 15 17:30:01 2008 From: elw at brandorr.com (Elijah Wright) Date: Fri, 15 Aug 2008 17:30:01 -0400 Subject: [Mongrel] Cant access ROR site externally using mongrel on shared host In-Reply-To: <77f1177a1e52a455a7223117b255e70a@ruby-forum.com> References: <77f1177a1e52a455a7223117b255e70a@ruby-forum.com> Message-ID: <57babe2b0808151430y4b46ce53r2f8126770ada6824@mail.gmail.com> odds are that you need to tell mongrel to listen on 0.0.0.0 rather than 127.0.0.1 ..... (the latter being a really common config for mongrels that are frontended by something else............) --elijah On Fri, Aug 15, 2008 at 5:18 PM, Tam Kbe wrote: > Hi, > > I have been trying to deploy my Ruby on Rails site using Mongrel on > Shared host. Mongrel seems to start fine using the command below: > > cd /home/linkamed/public_html/mysite > > mongrel_rails start -p 12003 -l > /home/linkamed/public_html/mysite/log/mongrel.log -c > /home/linkamed/public_html/mysite/ -e production -d > > and If I type something like this on the server: > > curl http://localhost:12003/users > > I get an HTML code output that resembles what should be displayed which > means that Mongrel is working fine. > > I just couldn't figure out how to access it externally!! > > I tried www.mysite.com:12003/users - www.mysite.com/12003/users - > www.mysite.com/mysite/users > > Is there a rule or configuration I have to do for this to work? > > Thanks in Advance, > > Tam > -- > 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 Aug 15 18:17:48 2008 From: lists at ruby-forum.com (Tam Kbe) Date: Sat, 16 Aug 2008 00:17:48 +0200 Subject: [Mongrel] Cant access ROR site externally using mongrel on shared host In-Reply-To: <57babe2b0808151430y4b46ce53r2f8126770ada6824@mail.gmail.com> References: <77f1177a1e52a455a7223117b255e70a@ruby-forum.com> <57babe2b0808151430y4b46ce53r2f8126770ada6824@mail.gmail.com> Message-ID: <84af00b32e36479630d31274aa721a45@ruby-forum.com> Thanks Elijah for answer. I thought that might be the problem but Mongrel will actually start at port 0.0.0.0 unless you expliciatly tell it to start on 127.0.0.1. Here is output of Mongrel. ** Starting Mongrel listening at 0.0.0.0:12003 ** 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.4 available at 0.0.0.0:12003 ** Use CTRL-C to stop. Any other ideas? Thanks -- Posted via http://www.ruby-forum.com/. From matte at ruckuswireless.com Fri Aug 15 18:32:31 2008 From: matte at ruckuswireless.com (Matte Edens) Date: Fri, 15 Aug 2008 15:32:31 -0700 Subject: [Mongrel] Cant access ROR site externally using mongrel on shared host In-Reply-To: <84af00b32e36479630d31274aa721a45@ruby-forum.com> References: <77f1177a1e52a455a7223117b255e70a@ruby-forum.com> <57babe2b0808151430y4b46ce53r2f8126770ada6824@mail.gmail.com> <84af00b32e36479630d31274aa721a45@ruby-forum.com> Message-ID: <48A603FF.7080104@ruckuswireless.com> since it's a shared host, are you sure they have port 12003 open for http requests? usually mongrel is sitting behind apache/nginx which proxies the requests to the specified port matte Tam Kbe wrote: > Thanks Elijah for answer. I thought that might be the problem but > Mongrel will actually start at port 0.0.0.0 unless you expliciatly tell > it to start on 127.0.0.1. Here is output of Mongrel. > ** Starting Mongrel listening at 0.0.0.0:12003 > ** 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.4 available at 0.0.0.0:12003 > ** Use CTRL-C to stop. > > Any other ideas? > > Thanks > From lists at ruby-forum.com Sat Aug 16 01:35:21 2008 From: lists at ruby-forum.com (Roger Pack) Date: Sat, 16 Aug 2008 07:35:21 +0200 Subject: [Mongrel] Mongrel on Ruby 1.8.6 w/ patchlevel 279 (Win) In-Reply-To: <4346e504c02dc762fdb231b055045317@ruby-forum.com> References: <4346e504c02dc762fdb231b055045317@ruby-forum.com> Message-ID: > C:\ruby18>gem install mongrel -include-dependencies > Building native extensions. This could take a while... > ERROR: Error installing mongrel: > ERROR: Failed to build gem native extension. Yeah you'd need to install the devkit to be able to compile it [to force compilation install it as gem install mongrel --platform ruby]. As a note when I do install the latest mongrel precompiled for mingw, I get: c:\roger\dev\test_rails_app>irb irb(main):001:0> require 'mongrel' Gem::LoadError: Could not find RubyGem echoe (>= 0) from c:/roger/dev/rubyinstaller_lavena/sandbox/ruby_mingw/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error' from c:/roger/dev/rubyinstaller_lavena/sandbox/ruby_mingw/lib/ruby/site_ruby/1.8/rubygems.rb:134:in `activate' from c:/roger/dev/rubyinstaller_lavena/sandbox/ruby_mingw/lib/ruby/site_ruby/1.8/rubygems.rb:158:in `activate' from c:/roger/dev/rubyinstaller_lavena/sandbox/ruby_mingw/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `each' from c:/roger/dev/rubyinstaller_lavena/sandbox/ruby_mingw/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `activate' from c:/roger/dev/rubyinstaller_lavena/sandbox/ruby_mingw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from (irb):1 Thanks! -=R -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Sat Aug 16 09:44:00 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 16 Aug 2008 15:44:00 +0200 Subject: [Mongrel] Mongrel on Ruby 1.8.6 w/ patchlevel 279 (Win) In-Reply-To: References: <4346e504c02dc762fdb231b055045317@ruby-forum.com> Message-ID: <71166b3b0808160644g1899c049if0c673f04676440@mail.gmail.com> On Sat, Aug 16, 2008 at 7:35 AM, Roger Pack wrote: > >> C:\ruby18>gem install mongrel -include-dependencies >> Building native extensions. This could take a while... >> ERROR: Error installing mongrel: >> ERROR: Failed to build gem native extension. > > Yeah you'd need to install the devkit to be able to compile it [to force > compilation install it as gem install mongrel --platform ruby]. > > As a note when I do install the latest mongrel precompiled for mingw, I > get: > > c:\roger\dev\test_rails_app>irb > irb(main):001:0> require 'mongrel' > Gem::LoadError: Could not find RubyGem echoe (>= 0) > That's new, I'm taking a look right now. Thanks Roger to reporting it. -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From lists at ruby-forum.com Mon Aug 18 01:45:20 2008 From: lists at ruby-forum.com (Tam Kbe) Date: Mon, 18 Aug 2008 07:45:20 +0200 Subject: [Mongrel] =?utf-8?q?Cant_access_ROR_site_externally_using_mongrel?= =?utf-8?q?_on=09shared_host?= In-Reply-To: <48A603FF.7080104@ruckuswireless.com> References: <77f1177a1e52a455a7223117b255e70a@ruby-forum.com> <57babe2b0808151430y4b46ce53r2f8126770ada6824@mail.gmail.com> <84af00b32e36479630d31274aa721a45@ruby-forum.com> <48A603FF.7080104@ruckuswireless.com> Message-ID: Thanks matte that did the trick :) My shared host didn't have that port open, I assumed they will because CPanel automatically assigned that port for Mongrel! I talked to them and they opened that port..Thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Aug 18 13:29:32 2008 From: lists at ruby-forum.com (Rob Stiff) Date: Mon, 18 Aug 2008 19:29:32 +0200 Subject: [Mongrel] Win32 access denied Message-ID: Using the Win32 HOWTO information, I am attempting to start the service. upon the service::install command, I receiving the error 'Access is denied. (Win32::ServiceError). The error is occurring in line 146 of init.rb Version Information: Ruby 1.8.6 Rails 1.2.0 Gem 1.2.0 Win32-Service 0.5.2 Mongrel_service 0.3.4 OS - Windows Vista There is a newer version of Win32 avaiable (0.6.1), but this version is incompatible with mongrel_service and issues a version error. Thanks in advance! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Aug 19 10:26:44 2008 From: lists at ruby-forum.com (Rob Stiff) Date: Tue, 19 Aug 2008 16:26:44 +0200 Subject: [Mongrel] Win32 access denied In-Reply-To: References: Message-ID: Rob Stiff wrote: > Using the Win32 HOWTO information, I am attempting to start the service. > upon the service::install command, I receiving the error 'Access is > denied. (Win32::ServiceError). > > The error is occurring in line 146 of init.rb > > Version Information: > Ruby 1.8.6 > Rails 1.2.0 > Gem 1.2.0 > Win32-Service 0.5.2 > Mongrel_service 0.3.4 > OS - Windows Vista > > There is a newer version of Win32 available (0.6.1), but this version is > incompatible with mongrel_service and issues a version error. > > Thanks in advance! SOLVED. The issue was with Windows Vista. You must always run the command line by right-clicking and using the "Run as Administrator" option. -- Posted via http://www.ruby-forum.com/. From jeremy.cavagnolo at gmail.com Wed Aug 20 12:45:12 2008 From: jeremy.cavagnolo at gmail.com (Jeremy Cavagnolo) Date: Wed, 20 Aug 2008 09:45:12 -0700 Subject: [Mongrel] mod_proxy, mongrel, redirect issue Message-ID: <1510f05f0808200945l2895f77dr249dcdee49786e00@mail.gmail.com> Hello, I am configuring apache 2.2 to serve my rails app through mongrel at the root of my server. First, I redirect all http traffic to https with the following: ServerName emiliano NameVirtualHost *:80 RedirectPermanent / https://emiliano #this server is only accessed internally Inside the section, I have the following configuration, which seems extremely standard: BalancerMember http://localhost:8000 BalancerMember http://localhost:8001 BalancerMember http://localhost:8002 ProxyRequests Off Order deny,allow Allow from all ProxyPass /stylesheets ! ProxyPass /javascripts ! ProxyPass /images ! ProxyPass / balancer://mongrel/ ProxyPassReverse / balancer://mongrel/ ProxyPreserveHost On When I point my browser to "https://emiliano" I get the login page that I expect. When I submit the login form the authorization is properly processed (I checked the access log). However, my browser is then directed to https://emilianousers/home (note the missing "/" between hostname and 'users') which of course cannot be found. If I manually insert the slash I am properly directed to the user home page. I can click on links all day long and everything works, but when I try to submit any form, the form is processed properly, but the same issue with the missing slash returns. I have tried removing the proxy balancer and going directly to the mongrel instance, but I get the same behavior. I have also removed and replaced trailing slashes in my ProxyPass directives with no success. Because I can't seem to find any other documentation of this issue, I am left believing that this is a very trivial problem. Please Help! jeremy From bsiggelkow at mac.com Wed Aug 20 12:56:00 2008 From: bsiggelkow at mac.com (Bill Siggelkow) Date: Wed, 20 Aug 2008 12:56:00 -0400 Subject: [Mongrel] mod_proxy, mongrel, redirect issue In-Reply-To: <1510f05f0808200945l2895f77dr249dcdee49786e00@mail.gmail.com> References: <1510f05f0808200945l2895f77dr249dcdee49786e00@mail.gmail.com> Message-ID: <7D76F0DC-F833-4630-98B5-C8B6318E3513@mac.com> This might help ... I have the following rewrite rule in my conf file ... # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://resman_cluster%{REQUEST_URI} [P,QSA,L] Also, I have the following : # Add a special request header so Rails redirects stay on https RequestHeader set X_FORWARDED_PROTO "https" HTH Bill Siggelkow bsiggelkow at mac.com AIM: siggelkowb Home: 770-457-8854 Mobile: 770-354-2584 On Aug 20, 2008, at 12:45 PM, Jeremy Cavagnolo wrote: > Hello, > > I am configuring apache 2.2 to serve my rails app through mongrel at > the root of my server. First, I redirect all http traffic to https > with the following: > > ServerName emiliano > > NameVirtualHost *:80 > > RedirectPermanent / https://emiliano #this server is only accessed > internally > > > Inside the section, I have the following > configuration, which seems extremely standard: > > > BalancerMember http://localhost:8000 > BalancerMember http://localhost:8001 > BalancerMember http://localhost:8002 > > > ProxyRequests Off > > Order deny,allow > Allow from all > > > ProxyPass /stylesheets ! > ProxyPass /javascripts ! > ProxyPass /images ! > ProxyPass / balancer://mongrel/ > ProxyPassReverse / balancer://mongrel/ > ProxyPreserveHost On > > When I point my browser to "https://emiliano" I get the login page > that I expect. When I submit the login form the authorization is > properly processed (I checked the access log). However, my browser is > then directed to https://emilianousers/home (note the missing "/" > between hostname and 'users') which of course cannot be found. If I > manually insert the slash I am properly directed to the user home > page. I can click on links all day long and everything works, but > when I try to submit any form, the form is processed properly, but the > same issue with the missing slash returns. > > I have tried removing the proxy balancer and going directly to the > mongrel instance, but I get the same behavior. I have also removed > and replaced trailing slashes in my ProxyPass directives with no > success. > > Because I can't seem to find any other documentation of this issue, I > am left believing that this is a very trivial problem. > > Please Help! > > jeremy > _______________________________________________ > 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 jeremy.cavagnolo at gmail.com Wed Aug 20 14:17:29 2008 From: jeremy.cavagnolo at gmail.com (Jeremy Cavagnolo) Date: Wed, 20 Aug 2008 11:17:29 -0700 Subject: [Mongrel] mod_proxy, mongrel, redirect issue In-Reply-To: <7D76F0DC-F833-4630-98B5-C8B6318E3513@mac.com> References: <1510f05f0808200945l2895f77dr249dcdee49786e00@mail.gmail.com> <7D76F0DC-F833-4630-98B5-C8B6318E3513@mac.com> Message-ID: <1510f05f0808201117u4407e3abn59fce7245d05ced@mail.gmail.com> Thanks for the reply. It turns out that because I have the following permanent redirection, I don't need to add the request header. NameVirtualHost *:80 RedirectPermanent / https://emiliano #this server is only accessed internally However, my problem came from the fact that I left off the trailing slash from https://emiliano in the RedirectPermanent directive. Does anyone think it is still a good idea, from a performance standpoint, to include: RequestHeader set X_FORWARDED_PROTO "https" even though the requests are forwarded by the RedirectPermanent directive? -jeremy On Wed, Aug 20, 2008 at 9:56 AM, Bill Siggelkow wrote: > This might help ... I have the following rewrite rule in my conf file ... > # Redirect all non-static requests to cluster > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://resman_cluster%{REQUEST_URI} [P,QSA,L] > Also, I have the following : > # Add a special request header so Rails redirects stay on https > RequestHeader set X_FORWARDED_PROTO "https" > HTH > Bill Siggelkow > bsiggelkow at mac.com > AIM: siggelkowb > Home: 770-457-8854 > Mobile: 770-354-2584 > > On Aug 20, 2008, at 12:45 PM, Jeremy Cavagnolo wrote: > > Hello, > > I am configuring apache 2.2 to serve my rails app through mongrel at > the root of my server. First, I redirect all http traffic to https > with the following: > > ServerName emiliano > > NameVirtualHost *:80 > > RedirectPermanent / https://emiliano #this server is only accessed > internally > > > Inside the section, I have the following > configuration, which seems extremely standard: > > > BalancerMember http://localhost:8000 > BalancerMember http://localhost:8001 > BalancerMember http://localhost:8002 > > > ProxyRequests Off > > Order deny,allow > Allow from all > > > ProxyPass /stylesheets ! > ProxyPass /javascripts ! > ProxyPass /images ! > ProxyPass / balancer://mongrel/ > ProxyPassReverse / balancer://mongrel/ > ProxyPreserveHost On > > When I point my browser to "https://emiliano" I get the login page > that I expect. When I submit the login form the authorization is > properly processed (I checked the access log). However, my browser is > then directed to https://emilianousers/home (note the missing "/" > between hostname and 'users') which of course cannot be found. If I > manually insert the slash I am properly directed to the user home > page. I can click on links all day long and everything works, but > when I try to submit any form, the form is processed properly, but the > same issue with the missing slash returns. > > I have tried removing the proxy balancer and going directly to the > mongrel instance, but I get the same behavior. I have also removed > and replaced trailing slashes in my ProxyPass directives with no > success. > > Because I can't seem to find any other documentation of this issue, I > am left believing that this is a very trivial problem. > > Please Help! > > jeremy > _______________________________________________ > 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 > From will at hotgazpacho.com Wed Aug 20 16:45:57 2008 From: will at hotgazpacho.com (Will Green) Date: Wed, 20 Aug 2008 16:45:57 -0400 Subject: [Mongrel] mod_proxy, mongrel, redirect issue In-Reply-To: <1510f05f0808201117u4407e3abn59fce7245d05ced@mail.gmail.com> References: <1510f05f0808200945l2895f77dr249dcdee49786e00@mail.gmail.com> <7D76F0DC-F833-4630-98B5-C8B6318E3513@mac.com> <1510f05f0808201117u4407e3abn59fce7245d05ced@mail.gmail.com> Message-ID: <48AC8285.6070509@hotgazpacho.com> Assuming you're running a Rails app, and you want all things generated by link_to, url_for, etc. to keep you in HTTPS , then yes. Otherwise, you effectively double the number of HTTP requests that the browser makes. This is wasteful, and depending on your allocated bandwidth and popularity, costly. Redirect them once to get them into HTTPS, but once they're there, the X_FORWARDED_PROTO header is an exceedingly GOOD idea. Jeremy Cavagnolo wrote: > Thanks for the reply. > > It turns out that because I have the following permanent redirection, > I don't need to add the request header. > > NameVirtualHost *:80 > > RedirectPermanent / https://emiliano #this server is only accessed internally > > > However, my problem came from the fact that I left off the trailing > slash from https://emiliano in the RedirectPermanent directive. > > Does anyone think it is still a good idea, from a performance > standpoint, to include: > > RequestHeader set X_FORWARDED_PROTO "https" > > even though the requests are forwarded by the RedirectPermanent directive? > > -jeremy > > On Wed, Aug 20, 2008 at 9:56 AM, Bill Siggelkow wrote: > >> This might help ... I have the following rewrite rule in my conf file ... >> # Redirect all non-static requests to cluster >> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f >> RewriteRule ^/(.*)$ balancer://resman_cluster%{REQUEST_URI} [P,QSA,L] >> Also, I have the following : >> # Add a special request header so Rails redirects stay on https >> RequestHeader set X_FORWARDED_PROTO "https" >> HTH >> Bill Siggelkow >> bsiggelkow at mac.com >> AIM: siggelkowb >> Home: 770-457-8854 >> Mobile: 770-354-2584 >> >> On Aug 20, 2008, at 12:45 PM, Jeremy Cavagnolo wrote: >> >> Hello, >> >> I am configuring apache 2.2 to serve my rails app through mongrel at >> the root of my server. First, I redirect all http traffic to https >> with the following: >> >> ServerName emiliano >> >> NameVirtualHost *:80 >> >> RedirectPermanent / https://emiliano #this server is only accessed >> internally >> >> >> Inside the section, I have the following >> configuration, which seems extremely standard: >> >> >> BalancerMember http://localhost:8000 >> BalancerMember http://localhost:8001 >> BalancerMember http://localhost:8002 >> >> >> ProxyRequests Off >> >> Order deny,allow >> Allow from all >> >> >> ProxyPass /stylesheets ! >> ProxyPass /javascripts ! >> ProxyPass /images ! >> ProxyPass / balancer://mongrel/ >> ProxyPassReverse / balancer://mongrel/ >> ProxyPreserveHost On >> >> When I point my browser to "https://emiliano" I get the login page >> that I expect. When I submit the login form the authorization is >> properly processed (I checked the access log). However, my browser is >> then directed to https://emilianousers/home (note the missing "/" >> between hostname and 'users') which of course cannot be found. If I >> manually insert the slash I am properly directed to the user home >> page. I can click on links all day long and everything works, but >> when I try to submit any form, the form is processed properly, but the >> same issue with the missing slash returns. >> >> I have tried removing the proxy balancer and going directly to the >> mongrel instance, but I get the same behavior. I have also removed >> and replaced trailing slashes in my ProxyPass directives with no >> success. >> >> Because I can't seem to find any other documentation of this issue, I >> am left believing that this is a very trivial problem. >> >> Please Help! >> >> jeremy >> _______________________________________________ >> 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 >> >> > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From gwolf at gwolf.org Fri Aug 22 17:40:29 2008 From: gwolf at gwolf.org (Gunnar Wolf) Date: Fri, 22 Aug 2008 16:40:29 -0500 Subject: [Mongrel] Cant access ROR site externally using mongrel on shared host In-Reply-To: References: <77f1177a1e52a455a7223117b255e70a@ruby-forum.com> <57babe2b0808151430y4b46ce53r2f8126770ada6824@mail.gmail.com> <84af00b32e36479630d31274aa721a45@ruby-forum.com> <48A603FF.7080104@ruckuswireless.com> Message-ID: <20080822214029.GA16568@cajita.gateway.2wire.net> Tam Kbe dijo [Mon, Aug 18, 2008 at 07:45:20AM +0200]: > Thanks matte that did the trick :) My shared host didn't have that port > open, I assumed they will because CPanel automatically assigned that > port for Mongrel! I talked to them and they opened that port..Thanks Just FWIW, the usual setup for Mongrel is not having it straight open to the outside world's requests, but to have it via a HTTP server handling all the static/easy responses (i.e. images), and leaving Mongrel just as a backend, application server. That way, you will decrease the net load on Mongrel. Greetings, -- Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244 PGP key 1024D/8BB527AF 2001-10-23 Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF From lists at ruby-forum.com Tue Aug 26 03:34:49 2008 From: lists at ruby-forum.com (Marc Willwacher) Date: Tue, 26 Aug 2008 09:34:49 +0200 Subject: [Mongrel] All mongrels crashing Message-ID: <114a2f90e549d136dad214a7a20810f8@ruby-forum.com> Hi, I got a problem running a rails app on swiftiply (0.6.1.1)/mongrel (1.1.4). It's running on a Debian 4.0 Etch, rails 1.2.6, ruby 1.8. Mostly its running fine, but sometimes ALL mongrels die with the following messages in mongrel.log /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:54:in `escape': can't convert nil into String (TypeError) from /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:303:in `join' from /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:303:in `join' from /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:303:in `each' from /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:303:in `join' from /var/lib/gems/1.8/gems/swiftiply-0.6.1.1/bin/mongrel_rails:145:in `run' from /var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run' from /var/lib/gems/1.8/gems/swiftiply-0.6.1.1/bin/mongrel_rails:252 from /var/lib/gems/1.8/bin/mongrel_rails:18:in `load' from /var/lib/gems/1.8/bin/mongrel_rails:18 I can not reproduce this error. But think it has to do with "Mongrel::Const::PATH_INFO" not set. Would be fine if some knows how to fix this. Many thanks, marc -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Aug 27 07:40:45 2008 From: lists at ruby-forum.com (Front Line) Date: Wed, 27 Aug 2008 13:40:45 +0200 Subject: [Mongrel] Mongrel hangs with 100% CPU / EBADF (Bad file descriptor) Message-ID: We have a server with 10 running mongrel_cluster instances with apache in front of them, and every now and then one or some of them hang. No activity is seen in the database (we're using activerecord sessions). Mysql with innodb tables. show innodb status shows no locks. show processlist shows nothing. The server is linux debian 4.0 Ruby is: ruby 1.8.6 (2008-03-03 patchlevel 114) [i486-linux] Rails is: Rails 1.1.2 (yes, quite old) We're using the native mysql connector (gem install mysql) "strace -p PID" gives the following in a loop for the hung mongrel process: gettimeofday({1219834026, 235289}, NULL) = 0 select(4, [3], [0], [], {0, 905241}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235477}, NULL) = 0 select(4, [3], [0], [], {0, 905053}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235654}, NULL) = 0 select(4, [3], [0], [], {0, 904875}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235829}, NULL) = 0 select(4, [3], [0], [], {0, 904700}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236017}, NULL) = 0 select(4, [3], [0], [], {0, 904513}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236192}, NULL) = 0 select(4, [3], [0], [], {0, 904338}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236367}, NULL) = 0 ... I used lsof and found that the process used 67 file descriptors (lsof -p PID |wc -l) Is there any other way I can debug this, so that I could for example determine which file descriptor is "bad"? Any other info or suggestions? Anybody else seen this? The site is fairly used, but not overly so, load averages usually around 0.3. -- Posted via http://www.ruby-forum.com/. From parkert at gmail.com Wed Aug 27 12:59:32 2008 From: parkert at gmail.com (Parker Thompson) Date: Wed, 27 Aug 2008 09:59:32 -0700 Subject: [Mongrel] Threading Rails Message-ID: Hey, We (Pivotal Labs) have bee experimenting with Mongrel and Rails Edge to see what happens if we remove the mutex around the dispatch to Rails, our goal being to reduce memory usage in virtualized environments where memory is tight. We're pretty happy with the results and ready to put together a real patch for Mongrel to allow users to run Rails this way. So, we're ready to patch Mongrel to support this. It probably doesn't make sense to just remove the handler's mutex around dispatch as this could lead to num-processors threads in rails concurrently. Probably we'll want to limit that separately. I'm thinking we should patch the handler to optionally allow threading, then make mongrel_rails support this + a limit on how many requests to process concurrenty. I'm wondeing what kind of patch you would want, and whether anyone has suggestions. Thanks, pt. From piyush.pr at gmail.com Wed Aug 27 15:38:58 2008 From: piyush.pr at gmail.com (Piyush Ranjan) Date: Thu, 28 Aug 2008 01:08:58 +0530 Subject: [Mongrel] Threading Rails In-Reply-To: References: Message-ID: <325148f70808271238p7fa3baa4kce70b236c40d5eca@mail.gmail.com> isn't rails 2.2 / edge supposed to have threading built in ? or am I missing something here ? also mongrel can handle multiple threads well . In fact I have tried it in mongrel handlers and it works very well (for 75 concurrent requests each taking 5 minutes to complete). On Wed, Aug 27, 2008 at 10:29 PM, Parker Thompson wrote: > Hey, > > We (Pivotal Labs) have bee experimenting with Mongrel and Rails Edge > to see what happens if we remove the mutex around the dispatch to > Rails, our goal being to reduce memory usage in virtualized > environments where memory is tight. We're pretty happy with the > results and ready to put together a real patch for Mongrel to allow > users to run Rails this way. So, we're ready to patch Mongrel to > support this. > > It probably doesn't make sense to just remove the handler's mutex > around dispatch as this could lead to num-processors threads in rails > concurrently. Probably we'll want to limit that separately. I'm > thinking we should patch the handler to optionally allow threading, > then make mongrel_rails support this + a limit on how many requests to > process concurrenty. > > I'm wondeing what kind of patch you would want, and whether anyone has > suggestions. > > Thanks, > > pt. > _______________________________________________ > 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 jw at innerewut.de Wed Aug 27 16:29:24 2008 From: jw at innerewut.de (Jonathan Weiss) Date: Wed, 27 Aug 2008 22:29:24 +0200 Subject: [Mongrel] Threading Rails In-Reply-To: <325148f70808271238p7fa3baa4kce70b236c40d5eca@mail.gmail.com> References: <325148f70808271238p7fa3baa4kce70b236c40d5eca@mail.gmail.com> Message-ID: <5f36a1bb0808271329r28252a06j874a329bb0db8d29@mail.gmail.com> On Wed, Aug 27, 2008 at 9:38 PM, Piyush Ranjan wrote: > isn't rails 2.2 / edge supposed to have threading built in ? or am I missing > something here ? > Rails 2.2 is thread-safe. This doesn't mean that it is automatically used this way. > also mongrel can handle multiple threads well . In fact I have tried it in > mongrel handlers and it works very well (for 75 concurrent requests each > taking 5 minutes to complete). > Mongrel can handle multiple threads, but Rails runs inside a big lock/mutex (because until 2.2 it isn't thread-safe). This whole discussion is about changing/removing the lock. Jonathan -- Jonathan Weiss http://blog.innerewut.de http://twitter.com/jweiss From parkert at gmail.com Wed Aug 27 22:00:34 2008 From: parkert at gmail.com (Parker Thompson) Date: Wed, 27 Aug 2008 19:00:34 -0700 Subject: [Mongrel] Threading Rails In-Reply-To: <5f36a1bb0808271329r28252a06j874a329bb0db8d29@mail.gmail.com> References: <325148f70808271238p7fa3baa4kce70b236c40d5eca@mail.gmail.com> <5f36a1bb0808271329r28252a06j874a329bb0db8d29@mail.gmail.com> Message-ID: FYI, we are pretty much done with this: http://github.com/pivotal/mongrel/tree/master We'll probably test it a bit more tomorrow and then release it into the wild. Any feedback would be appreciated. Thanks, pt. On Wed, Aug 27, 2008 at 1:29 PM, Jonathan Weiss wrote: > On Wed, Aug 27, 2008 at 9:38 PM, Piyush Ranjan wrote: >> isn't rails 2.2 / edge supposed to have threading built in ? or am I missing >> something here ? >> > > Rails 2.2 is thread-safe. This doesn't mean that it is automatically > used this way. > >> also mongrel can handle multiple threads well . In fact I have tried it in >> mongrel handlers and it works very well (for 75 concurrent requests each >> taking 5 minutes to complete). >> > > Mongrel can handle multiple threads, but Rails runs inside a big > lock/mutex (because until 2.2 it isn't thread-safe). > > This whole discussion is about changing/removing the lock. > > Jonathan > > -- > Jonathan Weiss > http://blog.innerewut.de > http://twitter.com/jweiss > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From lists at ruby-forum.com Fri Aug 29 05:07:37 2008 From: lists at ruby-forum.com (Antoine Antoine) Date: Fri, 29 Aug 2008 11:07:37 +0200 Subject: [Mongrel] Apache, Mongrel, Authentication In-Reply-To: <1086fb5f0801230708v2c10dc54q590203113f855888@mail.gmail.com> References: <1086fb5f0801230708v2c10dc54q590203113f855888@mail.gmail.com> Message-ID: Hello Sean, Did this solution in the proxy balancer posted by rafael worked for you ? because it seems that applying that, I have no authentication anymore .... Did you find any solution for this problem ? Regards, Antoine -- Posted via http://www.ruby-forum.com/. From rgo at aspgems.com Fri Aug 29 06:38:28 2008 From: rgo at aspgems.com (Rafael G.) Date: Fri, 29 Aug 2008 12:38:28 +0200 Subject: [Mongrel] Apache, Mongrel, Authentication In-Reply-To: References: <1086fb5f0801230708v2c10dc54q590203113f855888@mail.gmail.com> Message-ID: <48B7D1A4.5050507@aspgems.com> Antoine Antoine escribi?: > Hello Sean, > > Did this solution in the proxy balancer posted by rafael worked for you > ? because it seems that applying that, I have no authentication anymore > .... > Did you find any solution for this problem ? > > Regards, > > Antoine > > > Hi Antoine, When you want protect an application with basic authentication you need protect the static content (served by apache) and dinamic content (served by mongrel). A complete example: ==== foo.conf (vhost config file) BalancerMember http://127.0.0.1:8008 AuthType Basic AuthName "foo authentication" AuthUserFile /usr/local/apache2/conf/passwords Require user bar ServerName foo.com ServerAlias *.foo.com DocumentRoot /home/foo/current/public Options FollowSymLinks AllowOverride None Order allow,deny Allow from all AuthType Basic AuthName "foo" AuthUserFile /usr/local/apache2/conf/passwords Require user bar RewriteEngine On # Check for maintenance file and redirect all requests # ( this is for use with Capistrano's disable_web task ) RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_FILENAME} !\. RewriteCond %{REQUEST_FILENAME} (^[^\.]*$)|(.format:js) RewriteRule ^/(.*)$ balancer://foo_cluster%{REQUEST_URI} [P,QSA,L] # Deflate AddOutputFilterByType DEFLATE text/html text/plain text/css # ... text/xml application/xml application/xhtml+xml text/javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html === /usr/local/apache2/conf/passwords passwords file is created: # htpasswd -c /usr/local/apache2/conf/passwords bar Add new user: # htpasswd /usr/local/apache2/conf/passwords baz -- Rafael Garcia Ortega -------------- next part -------------- A non-text attachment was scrubbed... Name: rgo.vcf Type: text/x-vcard Size: 241 bytes Desc: not available URL: From lists at ruby-forum.com Fri Aug 29 08:52:13 2008 From: lists at ruby-forum.com (Antoine Antoine) Date: Fri, 29 Aug 2008 14:52:13 +0200 Subject: [Mongrel] Apache, Mongrel, Authentication In-Reply-To: <48B7D1A4.5050507@aspgems.com> References: <1086fb5f0801230708v2c10dc54q590203113f855888@mail.gmail.com> <48B7D1A4.5050507@aspgems.com> Message-ID: Thanks rafael for your fast reply, But I tried to apply that and I still have the problem. Here is my situation. ---------------------------------------------------------------------- Options Indexes FollowSymLinks MultiViews AllowOverride All Order Allow,Deny Allow from all Deny from env=blockAccess AcceptPathInfo Off Satisfy Any ServerName my.servername.com ..... # this virtual host doesn't have anymore authentication # and with mongrel_cluster .... ServerName my.servername.com ..... DocumentRoot /..../public/ Options Indexes FollowSymLinks MultiViews AllowOverride All Order Allow,deny Allow from all Deny from env=blockAccess AuthType Basic AuthName "Version Foo" AuthUserFile "/mypath/to/.htpasswd" require valid-user BalancerMember http://localhost:4000 AuthType Basic AuthName "Version Foo" AuthUserFile "/mypath/to/.htpasswd" require valid-user [.....] ---------------------------------------------------------------------- Maybe that's due to my in front of it no ? -- Posted via http://www.ruby-forum.com/. From rgo at aspgems.com Fri Aug 29 12:16:24 2008 From: rgo at aspgems.com (Rafael G.) Date: Fri, 29 Aug 2008 18:16:24 +0200 Subject: [Mongrel] Apache, Mongrel, Authentication In-Reply-To: References: <1086fb5f0801230708v2c10dc54q590203113f855888@mail.gmail.com> <48B7D1A4.5050507@aspgems.com> Message-ID: <48B820D8.9090104@aspgems.com> Antoine Antoine escribi?: > ---------------------------------------------------------------------- > > Maybe that's due to my in front of it no ? > It could be because apache read config files sequentially and maybe give priority to proxy * but I don't know really. Try to comment it. -- Rafael Garcia Ortega -------------- next part -------------- A non-text attachment was scrubbed... Name: rgo.vcf Type: text/x-vcard Size: 241 bytes Desc: not available URL: From lists at ruby-forum.com Sat Aug 30 16:57:04 2008 From: lists at ruby-forum.com (Roger Pack) Date: Sat, 30 Aug 2008 22:57:04 +0200 Subject: [Mongrel] speed curiosity Message-ID: <960bbb7c18ebdb80973cf32047aa90b7@ruby-forum.com> As a note--using the mongrel example from http://mongrel.rubyforge.org/web/mongrel/files/README.html and Mongrel 1.1.5 It yielded (for me) ~800 req/s [running ab -n 1000 -c 1 http://localhost:3000/test] and if I changed out.write("hello!\n") to out.write("hello!\n"*10_000) it yielded ~300 req/s. I was unable to get evented mongrel to run so wasn't able to compare the two. Doing a little bit of investigating, kcachegrind+ruby-prof points the latency to http_response.rb line 137 @socket.write(data) Experimenting by changing this line haphazardly to while data and data.length > 0 wrote = @socket.write_nonblock(data) data = data[wrote..-1] end yielded ~938 req/s [AFAICT] Thoughts? -=R -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Aug 30 22:17:38 2008 From: lists at ruby-forum.com (Manfred Lange) Date: Sun, 31 Aug 2008 04:17:38 +0200 Subject: [Mongrel] mongrel startup fails now: already initialized constant In-Reply-To: <8a17b227eaf20ff0f85d3fad1cc04f5f@ruby-forum.com> References: <6157d35f0b42389234242367d66e5971@ruby-forum.com> <8a17b227eaf20ff0f85d3fad1cc04f5f@ruby-forum.com> Message-ID: Kirk Schafer wrote: > [...] > --------------------------- > I realize this is an old post, so apologize for bumping it if that's > what occurs. I encountered the same issue on a new Gentoo box after a > "darcs get", whereby script/server started WEBrick but then out popped > Mongrel..and then the error "warning: already initialized constant > OPTIONS." > > This made no sense to me, and I landed here. The suggestion to run the > rake tasks had no effect, but a mongrel_rails start did report a > different error: > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- tzinfo > (MissingSourceFile) > > Subsequently, only a single "gem install tzinfo" (your circumstances may > vary) was required to allow both "script/server" and "mongrel_rails > start" to function normally. So, an FYI for the community at large. In my case the cause for the problem was a spelling error in environment.rb. The error message of "mongrel_rails start" was much more helpful than what came out of "script/server". Thank you, Kirk for posting! -- Posted via http://www.ruby-forum.com/.