From luislavena at gmail.com Mon Feb 20 14:29:59 2006 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 20 Feb 2006 16:29:59 -0300 Subject: [Mongrel-users] Introduce myself. Message-ID: <71166b3b0602201129udf62498n50f1de89eb82a6b7@mail.gmail.com> Hello mailing list! (Ehhh, that sounds a bit silly, don't you think?) Anyway, I'm glad that Zed allow me contribute to this project. Been using Ruby and Rails for half-year and lot of things I have learned running on win32 arena, that I wanted to share with everybody. As previously post on ruby-talk by Zed, I will create the scripts that made posible run mongrel as services on win32 (*nix already is solved using daemonize). Well, nothing more to say... just be polite with your comments and excuse my poor non-existant english... not my main language. :-) Later, Luis From zedshaw at zedshaw.com Mon Feb 20 15:06:47 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Mon, 20 Feb 2006 15:06:47 -0500 Subject: [Mongrel-users] Introduce myself. In-Reply-To: <71166b3b0602201129udf62498n50f1de89eb82a6b7@mail.gmail.com> Message-ID: Alright, first list post for me too. List has kind of just been here but we might as well use it. So I got your changes for the 0.3.6 release. You should also update so you get revision 51. I basically checked in your mongrel_simple_ctrl.rb and mongrel_simple_service.rb files in the examples directory. I'll try them out and we can include them in the release for people to play with. About tagging: I've actually never done it so I'll look it up and give it a try. Don't blame me if the world ends :-) When you think the rails running win32 service is good we'll check it into bin, add it to the gem, and then I'll write up the README docs for it. Also, when you reply do you get the list address or my address? I think the list is configured wrong but I can't seem to get in as an administrator. Let me know. Zed On 2/20/06 2:29 PM, "Luis Lavena" wrote: > Hello mailing list! > > (Ehhh, that sounds a bit silly, don't you think?) > > Anyway, I'm glad that Zed allow me contribute to this project. > > Been using Ruby and Rails for half-year and lot of things I have > learned running on win32 arena, that I wanted to share with everybody. > > As previously post on ruby-talk by Zed, I will create the scripts that > made posible run mongrel as services on win32 (*nix already is solved > using daemonize). > > Well, nothing more to say... just be polite with your comments and > excuse my poor non-existant english... not my main language. :-) > > Later, > > Luis > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From francois.beausoleil at gmail.com Mon Feb 20 15:09:21 2006 From: francois.beausoleil at gmail.com (Francois Beausoleil) Date: Mon, 20 Feb 2006 15:09:21 -0500 Subject: [Mongrel-users] Introduce myself. In-Reply-To: References: <71166b3b0602201129udf62498n50f1de89eb82a6b7@mail.gmail.com> Message-ID: <41d5fadf0602201209r6d9a95c3p@mail.gmail.com> Hello Zed, 2006/2/20, Zed Shaw :> Also, when you reply do you get the list address or my address? I think the> list is configured wrong but I can't seem to get in as an administrator.> Let me know. Reply goes to poster, not list. Bye !Fran?ois From zedshaw at zedshaw.com Mon Feb 20 15:11:50 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Mon, 20 Feb 2006 15:11:50 -0500 Subject: [Mongrel-users] Introduce myself. In-Reply-To: <41d5fadf0602201209r6d9a95c3p@mail.gmail.com> Message-ID: Damn, and either I don't know the list admin password or was never given it. Time to contact Tom! :-) Thanks Francios. Zed On 2/20/06 3:09 PM, "Francois Beausoleil" wrote: > Hello Zed, 2006/2/20, Zed Shaw : > Also, when you reply > do you get the list address or my address? I think the > list is configured > wrong but I can't seem to get in as an administrator. > Let me know. Reply > goes to poster, not list. Bye ! Fran?ois From zedshaw at zedshaw.com Mon Feb 20 15:16:17 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Mon, 20 Feb 2006 15:16:17 -0500 Subject: [Mongrel] Test of reply to list Message-ID: Just a test. Found the list password. Zed From zedshaw at zedshaw.com Mon Feb 20 15:17:13 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Mon, 20 Feb 2006 15:17:13 -0500 Subject: [Mongrel] Test of reply to list In-Reply-To: Message-ID: Worked. Let me know if people have other mailing list preferences. Changed the subject prefix to just [Mongrel]. Zed On 2/20/06 3:16 PM, "Zed Shaw" wrote: > Just a test. Found the list password. > > Zed > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From zedshaw at zedshaw.com Mon Feb 20 17:50:24 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Mon, 20 Feb 2006 17:50:24 -0500 Subject: [Mongrel] Graceful stop in, timeouts out (for now) Message-ID: Hey Luis, Just implemented the first cut at a graceful stop setup. It seems to mostly work except for a few hicups here and there which I'll test out. I've tested this under OSX and will test on the other platforms soon. To use it take a look at the examples/simpletest.rb and see how I setup an "INT" handler to call HttpServer.stop. Hopefully this will help with your win32 service shutdown. The bad news is while doing this I found that Timeout doesn't work so well on OSX. I've taken out the timeout functionality but left the option in so that people existing code don't break. More to come. Zed From zedshaw at zedshaw.com Mon Feb 20 18:53:12 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Mon, 20 Feb 2006 18:53:12 -0500 Subject: [Mongrel] A quick refactoring for handlers and CGI Message-ID: Luis, The mongrel.rb file is starting to get a bit too big so I'm going to refactor it out a bit. I'm going to create a lib/mongrel/cgi.rb file for the CGI specific stuff and a lib/mongrel/handlers.rb file for the various handlers we'll be making. Let me know if this causes you any pain. Zed A. Shaw From luislavena at gmail.com Mon Feb 20 23:35:45 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 21 Feb 2006 01:35:45 -0300 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: References: Message-ID: <71166b3b0602202035r73c166c4o29bdf9e178677f15@mail.gmail.com> Mmm, still the trap of Interrupt need 1 request to stop it. (hitting ctrl-c didn't stop it, need to refresh a the browser to actually get the "server stopped" line). Anyway, working with mongrel/plugins to create mongrel_rails_service Guess that your refactoring will help more informative requires (mongrel/cgi and mongrel/handlers) Later, Luis On 2/20/06, Zed Shaw wrote: > Hey Luis, > > Just implemented the first cut at a graceful stop setup. It seems to mostly > work except for a few hicups here and there which I'll test out. I've > tested this under OSX and will test on the other platforms soon. > > To use it take a look at the examples/simpletest.rb and see how I setup an > "INT" handler to call HttpServer.stop. > > Hopefully this will help with your win32 service shutdown. > > The bad news is while doing this I found that Timeout doesn't work so well > on OSX. I've taken out the timeout functionality but left the option in so > that people existing code don't break. > > More to come. > > Zed > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From zedshaw at zedshaw.com Tue Feb 21 05:11:39 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Tue, 21 Feb 2006 05:11:39 -0500 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: <71166b3b0602202035r73c166c4o29bdf9e178677f15@mail.gmail.com> Message-ID: Ok, I'll look into this. Seems to work fine for me under OSX, NetBSD and win32. I've actually been using Mongrel this weekend as my development/test server for another project. Works real nice. :-) Let me know when you got something for the rails service and we'll start working on the release. Talk to you soon. Zed On 2/20/06 11:35 PM, "Luis Lavena" wrote: > Mmm, still the trap of Interrupt need 1 request to stop it. > > (hitting ctrl-c didn't stop it, need to refresh a the browser to > actually get the "server stopped" line). > > Anyway, working with mongrel/plugins to create mongrel_rails_service > > Guess that your refactoring will help more informative requires > (mongrel/cgi and mongrel/handlers) > > Later, > > Luis > > On 2/20/06, Zed Shaw wrote: From luislavena at gmail.com Tue Feb 21 08:15:47 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 21 Feb 2006 10:15:47 -0300 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: References: <71166b3b0602202035r73c166c4o29bdf9e178677f15@mail.gmail.com> Message-ID: <71166b3b0602210515n47cfa7e3i531604506fe2435a@mail.gmail.com> By "win32" you mean "Windows XP" or "Windows 2000"? I been using examples/simpletest.rb to try your modifications (the graceful shutdown and the Interrupt/trap catcher) What didn't work was the trap catcher, actually it requires you generate a new "hit" (or is named request?) after hitting ctrl-c for the HttpServer actually raise the Interrupt. No page get served before stop, just the incoming connection think that allow raising the exception. With Ctrl-Pause it break/stop execution, but the graful shutdown part never get raised. Will work today in the rails part. Later, Luis On 2/21/06, Zed Shaw wrote: > Ok, I'll look into this. Seems to work fine for me under OSX, NetBSD and > win32. I've actually been using Mongrel this weekend as my development/test > server for another project. Works real nice. :-) > > Let me know when you got something for the rails service and we'll start > working on the release. > > Talk to you soon. > > Zed > > > On 2/20/06 11:35 PM, "Luis Lavena" wrote: > > > Mmm, still the trap of Interrupt need 1 request to stop it. > > > > (hitting ctrl-c didn't stop it, need to refresh a the browser to > > actually get the "server stopped" line). > > > > Anyway, working with mongrel/plugins to create mongrel_rails_service > > > > Guess that your refactoring will help more informative requires > > (mongrel/cgi and mongrel/handlers) > > > > Later, > > > > Luis > > > > On 2/20/06, Zed Shaw wrote: > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From luislavena at gmail.com Tue Feb 21 08:39:08 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 21 Feb 2006 10:39:08 -0300 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: <71166b3b0602210515n47cfa7e3i531604506fe2435a@mail.gmail.com> References: <71166b3b0602202035r73c166c4o29bdf9e178677f15@mail.gmail.com> <71166b3b0602210515n47cfa7e3i531604506fe2435a@mail.gmail.com> Message-ID: <71166b3b0602210539y4b7250d8hdcd990109953d695@mail.gmail.com> OT: btw, where you put mongrel on ruby (or reference it) to have in verison control (in your working copy) and allow you test without installing it as gem? Luis On 2/21/06, Luis Lavena wrote: > By "win32" you mean "Windows XP" or "Windows 2000"? > > I been using examples/simpletest.rb to try your modifications (the > graceful shutdown and the Interrupt/trap catcher) > > What didn't work was the trap catcher, actually it requires you > generate a new "hit" (or is named request?) after hitting ctrl-c for > the HttpServer actually raise the Interrupt. No page get served before > stop, just the incoming connection think that allow raising the > exception. > > With Ctrl-Pause it break/stop execution, but the graful shutdown part > never get raised. > > Will work today in the rails part. > > Later, > > Luis > > On 2/21/06, Zed Shaw wrote: > > Ok, I'll look into this. Seems to work fine for me under OSX, NetBSD and > > win32. I've actually been using Mongrel this weekend as my development/test > > server for another project. Works real nice. :-) > > > > Let me know when you got something for the rails service and we'll start > > working on the release. > > > > Talk to you soon. > > > > Zed > > > > > > On 2/20/06 11:35 PM, "Luis Lavena" wrote: > > > > > Mmm, still the trap of Interrupt need 1 request to stop it. > > > > > > (hitting ctrl-c didn't stop it, need to refresh a the browser to > > > actually get the "server stopped" line). > > > > > > Anyway, working with mongrel/plugins to create mongrel_rails_service > > > > > > Guess that your refactoring will help more informative requires > > > (mongrel/cgi and mongrel/handlers) > > > > > > Later, > > > > > > Luis > > > > > > On 2/20/06, Zed Shaw wrote: > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > From zedshaw at zedshaw.com Tue Feb 21 09:03:47 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Tue, 21 Feb 2006 09:03:47 -0500 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: <71166b3b0602210539y4b7250d8hdcd990109953d695@mail.gmail.com> Message-ID: Yeah, win32 means any windows system (XP, 2000, etc.). I'll play with it some more. What I do is I just run the commands directly in the source with: ruby -Ilib bin/mongrel_rails start Or ruby -Ilib examples/simpletest.rb localhost 3000 doc/rdoc Is that what you needed? Zed On 2/21/06 8:39 AM, "Luis Lavena" wrote: > OT: > > btw, where you put mongrel on ruby (or reference it) to have in > verison control (in your working copy) and allow you test without > installing it as gem? > > Luis > > On 2/21/06, Luis Lavena wrote: >> By "win32" you mean "Windows XP" or "Windows 2000"? >> >> I been using examples/simpletest.rb to try your modifications (the >> graceful shutdown and the Interrupt/trap catcher) >> >> What didn't work was the trap catcher, actually it requires you >> generate a new "hit" (or is named request?) after hitting ctrl-c for >> the HttpServer actually raise the Interrupt. No page get served before >> stop, just the incoming connection think that allow raising the >> exception. >> >> With Ctrl-Pause it break/stop execution, but the graful shutdown part >> never get raised. >> >> Will work today in the rails part. >> >> Later, >> >> Luis >> From luislavena at gmail.com Tue Feb 21 09:30:12 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 21 Feb 2006 11:30:12 -0300 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: References: <71166b3b0602210539y4b7250d8hdcd990109953d695@mail.gmail.com> Message-ID: <71166b3b0602210630u2e17d352v6870e7769234ec9b@mail.gmail.com> Yep, thats what I needed :-) What do you think about this command line? mongrel_rails_service install --name=my_rails --display='My Mongrel powered Rails Service' --rails_root=d:/My/Rails/App options: --rails_root=current directory, anyway validated checking existance of app, config, db, log, public --environment=production --binding=0.0.0.0 --port=3000 --mime-types=path_to_mime_file Later, the StartCommand need just: mongrel_rails_service start --name=my_rails wanted to look a way to avoid --name requirement and just pass "my_rails" The command with get the display name from windows and show it when starting or stopping, a la "net start/stop" functionality. Later, Luis On 2/21/06, Zed Shaw wrote: > Yeah, win32 means any windows system (XP, 2000, etc.). I'll play with it > some more. > > What I do is I just run the commands directly in the source with: > > ruby -Ilib bin/mongrel_rails start > > Or > > ruby -Ilib examples/simpletest.rb localhost 3000 doc/rdoc > > Is that what you needed? > > Zed > > > On 2/21/06 8:39 AM, "Luis Lavena" wrote: > > > OT: > > > > btw, where you put mongrel on ruby (or reference it) to have in > > verison control (in your working copy) and allow you test without > > installing it as gem? > > > > Luis > > > > On 2/21/06, Luis Lavena wrote: > >> By "win32" you mean "Windows XP" or "Windows 2000"? > >> > >> I been using examples/simpletest.rb to try your modifications (the > >> graceful shutdown and the Interrupt/trap catcher) > >> > >> What didn't work was the trap catcher, actually it requires you > >> generate a new "hit" (or is named request?) after hitting ctrl-c for > >> the HttpServer actually raise the Interrupt. No page get served before > >> stop, just the incoming connection think that allow raising the > >> exception. > >> > >> With Ctrl-Pause it break/stop execution, but the graful shutdown part > >> never get raised. > >> > >> Will work today in the rails part. > >> > >> Later, > >> > >> Luis > >> > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From zedshaw at zedshaw.com Tue Feb 21 09:39:47 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Tue, 21 Feb 2006 09:39:47 -0500 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: <71166b3b0602210630u2e17d352v6870e7769234ec9b@mail.gmail.com> Message-ID: That looks great. I think it's a start and we can get more feedback from win32 users when it's out. Can you check that in? Zed On 2/21/06 9:30 AM, "Luis Lavena" wrote: > Yep, thats what I needed :-) > > What do you think about this command line? > > mongrel_rails_service install --name=my_rails --display='My Mongrel > powered Rails Service' --rails_root=d:/My/Rails/App > > options: > --rails_root=current directory, anyway validated checking existance of > app, config, db, log, public > --environment=production > --binding=0.0.0.0 > --port=3000 > --mime-types=path_to_mime_file > > Later, the StartCommand need just: > > mongrel_rails_service start --name=my_rails > > wanted to look a way to avoid --name requirement and just pass "my_rails" > > The command with get the display name from windows and show it when > starting or stopping, a la "net start/stop" functionality. > > Later, > > Luis > From luislavena at gmail.com Tue Feb 21 09:46:48 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 21 Feb 2006 11:46:48 -0300 Subject: [Mongrel] Graceful stop in, timeouts out (for now) In-Reply-To: References: <71166b3b0602210630u2e17d352v6870e7769234ec9b@mail.gmail.com> Message-ID: <71166b3b0602210646x3387b4e0j6753b561671f1cae@mail.gmail.com> Indenting and adding a few comments now, in 30 minutes I guess after playing a bit with it. Zed On 2/21/06, Zed Shaw wrote: > That looks great. I think it's a start and we can get more feedback from > win32 users when it's out. > > Can you check that in? > > Zed > > > On 2/21/06 9:30 AM, "Luis Lavena" wrote: > > > Yep, thats what I needed :-) > > > > What do you think about this command line? > > > > mongrel_rails_service install --name=my_rails --display='My Mongrel > > powered Rails Service' --rails_root=d:/My/Rails/App > > > > options: > > --rails_root=current directory, anyway validated checking existance of > > app, config, db, log, public > > --environment=production > > --binding=0.0.0.0 > > --port=3000 > > --mime-types=path_to_mime_file > > > > Later, the StartCommand need just: > > > > mongrel_rails_service start --name=my_rails > > > > wanted to look a way to avoid --name requirement and just pass "my_rails" > > > > The command with get the display name from windows and show it when > > starting or stopping, a la "net start/stop" functionality. > > > > Later, > > > > Luis > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From luislavena at gmail.com Tue Feb 21 18:47:42 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 21 Feb 2006 20:47:42 -0300 Subject: [Mongrel] Checked mongrel_rails_service drafts Message-ID: <71166b3b0602211547l1ad3794drba6fa6e9ef614792@mail.gmail.com> Ok, I have checked in the first draft of rails win32 service into examples mongrel_rails_service is the controller, and the _svc script is actually the service. The controller uses Mongrel Commands as requested by Zed, but the service was simplified for debugging purposes, later will merge and refactor both files. The environment defaults to production, so if wanted to run it on other, you must explicit so. The SimpleHandler start and stops ok, but still trying to find why CGI handler (Rails) make it fail during service stop. Will look into this tomorrow, now need a few hours to sleep ;-) -- Luis From francois.beausoleil at gmail.com Tue Feb 21 20:29:57 2006 From: francois.beausoleil at gmail.com (Francois Beausoleil) Date: Tue, 21 Feb 2006 20:29:57 -0500 Subject: [Mongrel] Checked mongrel_rails_service drafts In-Reply-To: <71166b3b0602211547l1ad3794drba6fa6e9ef614792@mail.gmail.com> References: <71166b3b0602211547l1ad3794drba6fa6e9ef614792@mail.gmail.com> Message-ID: <41d5fadf0602211729g295b677ex@mail.gmail.com> Hi ! 2006/2/21, Luis Lavena :> The environment defaults to production, so if wanted to run it on> other, you must explicit so. SCGI Rails and Rails itself both default to development. Should wechange expectations like that ? Just a thought. Bye !--Fran?ois Beausoleilhttp://blog.teksol.info/ From zedshaw at zedshaw.com Tue Feb 21 21:47:34 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Tue, 21 Feb 2006 21:47:34 -0500 Subject: [Mongrel] Checked mongrel_rails_service drafts In-Reply-To: <71166b3b0602211547l1ad3794drba6fa6e9ef614792@mail.gmail.com> Message-ID: So very nice. I'll boot up my win32 sys and try this out. If it all works reasonably well then I'll setup to do another release later tonight. Great work Luis. Zed On 2/21/06 6:47 PM, "Luis Lavena" wrote: > Ok, I have checked in the first draft of rails win32 service into examples > > mongrel_rails_service is the controller, and the _svc script is > actually the service. > > The controller uses Mongrel Commands as requested by Zed, but the > service was simplified for debugging purposes, later will merge and > refactor both files. > > The environment defaults to production, so if wanted to run it on > other, you must explicit so. > > The SimpleHandler start and stops ok, but still trying to find why CGI > handler (Rails) make it fail during service stop. > > Will look into this tomorrow, now need a few hours to sleep ;-) > > -- > Luis > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From zedshaw at zedshaw.com Tue Feb 21 21:48:29 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Tue, 21 Feb 2006 21:48:29 -0500 Subject: [Mongrel] Checked mongrel_rails_service drafts In-Reply-To: <41d5fadf0602211729g295b677ex@mail.gmail.com> Message-ID: I'll take a look at it. My impression though is that service would be for production runs, and just console plain mongrel_rails start would be for development. Would this be a reasonable thinking for you? Zed On 2/21/06 8:29 PM, "Francois Beausoleil" wrote: > Hi ! 2006/2/21, Luis Lavena :> The environment defaults > to production, so if wanted to run it on> other, you must explicit so. SCGI > Rails and Rails itself both default to development. Should wechange > expectations like that ? Just a thought. Bye !--Fran?ois > Beausoleilhttp://blog.teksol.info/ ___________________________________________ > ____ Mongrel-users mailing > list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel > -users From francois.beausoleil at gmail.com Tue Feb 21 22:12:17 2006 From: francois.beausoleil at gmail.com (Francois Beausoleil) Date: Tue, 21 Feb 2006 22:12:17 -0500 Subject: [Mongrel] Checked mongrel_rails_service drafts In-Reply-To: References: <41d5fadf0602211729g295b677ex@mail.gmail.com> Message-ID: <41d5fadf0602211912u2e87568cw@mail.gmail.com> 2006/2/21, Zed Shaw :> I'll take a look at it. My impression though is that service would be for> production runs, and just console plain mongrel_rails start would be for> development. Would this be a reasonable thinking for you? Ah, it wasn't clear from Luis' E-Mail if that would be the case. Although, maybe service should plain error out if nothing is specified? Hmmm, on second thought, no. Zed, go ahead with what you plannedout here. Thanks !Fran?ois From luislavena at gmail.com Wed Feb 22 00:00:32 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 02:00:32 -0300 Subject: [Mongrel] Checked mongrel_rails_service drafts In-Reply-To: <41d5fadf0602211912u2e87568cw@mail.gmail.com> References: <41d5fadf0602211729g295b677ex@mail.gmail.com> <41d5fadf0602211912u2e87568cw@mail.gmail.com> Message-ID: <71166b3b0602212100i150215fan90e89ece7291bb2c@mail.gmail.com> Francois, sorry that I missed comment that. Zed, still the HttpServer need some work to stop the work threads. The gracefully part of it still need some work. Somehow the threading nature of Wrapper or CGI handler make the service to fail at stop, so will investigate it tomorrow The SimpleHandler works OK as service, so is CGI handler, I need to confirm this but guess I'm on the right track. Til tomorrow Luis On 2/22/06, Francois Beausoleil wrote: > 2006/2/21, Zed Shaw :> I'll take a look at it. My impression though is that service would be for> production runs, and just console plain mongrel_rails start would be for> development. Would this be a reasonable thinking for you? > Ah, it wasn't clear from Luis' E-Mail if that would be the case. Although, maybe service should plain error out if nothing is specified? Hmmm, on second thought, no. Zed, go ahead with what you plannedout here. > Thanks !Fran?ois > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -- Luis From zedshaw at zedshaw.com Wed Feb 22 01:59:50 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 01:59:50 -0500 Subject: [Mongrel] win32 service rocks! In-Reply-To: <71166b3b0602212100i150215fan90e89ece7291bb2c@mail.gmail.com> Message-ID: Luis, I'm sitting here playing with the win32 and it is so damn hot. You're going to be a famous man with the win32 people. I think we should release even if it doesn't have the stop quite right. I took the time to do a win32-service gem which I think I'll put up on the mongrel site so people can just gem install and go. All works great so far. I also think we should take your examples/mongrel_rails_svc.rb and examples/mongrel_rails_service.rb and convert them to: bin/mongrel_rails_service bin/mongrel_rails_svc That way they can be install automagically by rubygems and available right on the command line to people. If you can make this change, sync up with svn, then I'll do a release tomorrow. Otherwise it's incredibly cool. It's sad to say that Mongrel will soon have better win32 support than Unix. Zed From zedshaw at zedshaw.com Wed Feb 22 02:24:34 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 02:24:34 -0500 Subject: [Mongrel] Temporary win32 gems up. Message-ID: Hey, I did some pre-compiled gems for both Mongrel and win32 service, wrote some quick instructions, and threw everything onto a (Mongrel hosted) temp site. Please go hit: http://zedshaw.homelinux.org:3000/files/win32_howto.html And give the instructions a shot. Luis should have the stuff moved around and then we'll have a nice clean install and set of instructions for all this. Any comments are welcome. Remember stop doesn't work quite yet. Zed From luislavena at gmail.com Wed Feb 22 12:19:05 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 14:19:05 -0300 Subject: [Mongrel] win32 service rocks! In-Reply-To: References: <71166b3b0602212100i150215fan90e89ece7291bb2c@mail.gmail.com> Message-ID: <71166b3b0602220919i24cd00fbxb000f7d0f6c777f7@mail.gmail.com> Hehehe, sounds good for me On 2/22/06, Zed Shaw wrote: > Luis, > > I'm sitting here playing with the win32 and it is so damn hot. You're going > to be a famous man with the win32 people. I think we should release even if > it doesn't have the stop quite right. > Still wanted to get it working right, but more feedback should hepl this, so a release is good. > I took the time to do a win32-service gem which I think I'll put up on the > mongrel site so people can just gem install and go. All works great so far. > Are you using the vc2003 I sent to you? adding the dependency is easy, but we need to provide the binary gem too. so win32-service and win32-service-mswin32... both gems available from mongrel site, good! :D > I also think we should take your examples/mongrel_rails_svc.rb and > examples/mongrel_rails_service.rb and convert them to: > > bin/mongrel_rails_service > bin/mongrel_rails_svc > > That way they can be install automagically by rubygems and available right > on the command line to people. > Only bin/mongrel_rails_service should be linked as executable, the _svc only will be used internally to fire it up (and cannot be fired from a batch file). > If you can make this change, sync up with svn, then I'll do a release > tomorrow. > Ok, moving the scripts to bin, changing the extensions and doing the right change in the gem. > Otherwise it's incredibly cool. It's sad to say that Mongrel will soon have > better win32 support than Unix. > > Zed Hehe, sounds great for me :-D Later, Luis From luislavena at gmail.com Wed Feb 22 12:27:45 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 14:27:45 -0300 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: References: Message-ID: <71166b3b0602220927o522d6980g6ae41225da42423@mail.gmail.com> Hi Zed, cannot access to the hosting... mail me the win32_howto please. Also, we need to comment/document the usage of mongrel_rails_service, in README maybe? Hope my english will be good to describe the process :-D Luis On 2/22/06, Zed Shaw wrote: > Hey, > > I did some pre-compiled gems for both Mongrel and win32 service, wrote some > quick instructions, and threw everything onto a (Mongrel hosted) temp site. > Please go hit: > > http://zedshaw.homelinux.org:3000/files/win32_howto.html > > And give the instructions a shot. Luis should have the stuff moved around > and then we'll have a nice clean install and set of instructions for all > this. > > Any comments are welcome. Remember stop doesn't work quite yet. > > Zed > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis From zedshaw at zedshaw.com Wed Feb 22 12:29:40 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 12:29:40 -0500 Subject: [Mongrel] win32 service rocks! In-Reply-To: <71166b3b0602220919i24cd00fbxb000f7d0f6c777f7@mail.gmail.com> Message-ID: Hey, I did surgery on the svn repo. Moved your source so be careful when you update. Comments below... On 2/22/06 12:19 PM, "Luis Lavena" wrote: > Hehehe, sounds good for me > > On 2/22/06, Zed Shaw wrote: >> Luis, >> >> I'm sitting here playing with the win32 and it is so damn hot. You're going >> to be a famous man with the win32 people. I think we should release even if >> it doesn't have the stop quite right. >> > > Still wanted to get it working right, but more feedback should hepl > this, so a release is good. > I just released! I've tested it out and it's hot. I'll be writing docs for the site next and then the e-mail goes out. People have been testing it like crazy for me so it should be pretty good. >> I took the time to do a win32-service gem which I think I'll put up on the >> mongrel site so people can just gem install and go. All works great so far. >> > > Are you using the vc2003 I sent to you? adding the dependency is easy, > but we need to provide the binary gem too. > Yep, works great thanks. And I already did the dependency so when you svn update you'll get it all. > so win32-service and win32-service-mswin32... both gems available from > mongrel site, good! :D > >> I also think we should take your examples/mongrel_rails_svc.rb and >> examples/mongrel_rails_service.rb and convert them to: >> >> bin/mongrel_rails_service >> bin/mongrel_rails_svc >> >> That way they can be install automagically by rubygems and available right >> on the command line to people. >> > Only bin/mongrel_rails_service should be linked as executable, the > _svc only will be used internally to fire it up (and cannot be fired > from a batch file). > I just kept it consistent, otherwise the gem system won't include both scripts. I modified the source for this. >> If you can make this change, sync up with svn, then I'll do a release >> tomorrow. >> > Ok, moving the scripts to bin, changing the extensions and doing the > right change in the gem. > Darn, just did that. Let me know if you have problems. Zed From zedshaw at zedshaw.com Wed Feb 22 12:43:49 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 12:43:49 -0500 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: <71166b3b0602220927o522d6980g6ae41225da42423@mail.gmail.com> Message-ID: I'll do the docs. I'm already reworking the documentation page to expand it out and give more docs. Oh and I took the little site down while I did the release. Did your svn update work out ok? Zed On 2/22/06 12:27 PM, "Luis Lavena" wrote: > Hi Zed, cannot access to the hosting... mail me the win32_howto please. > > Also, we need to comment/document the usage of mongrel_rails_service, > in README maybe? > > Hope my english will be good to describe the process :-D > > Luis > > On 2/22/06, Zed Shaw wrote: From luislavena at gmail.com Wed Feb 22 12:47:44 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 14:47:44 -0300 Subject: [Mongrel] win32 service rocks! In-Reply-To: References: <71166b3b0602220919i24cd00fbxb000f7d0f6c777f7@mail.gmail.com> Message-ID: <71166b3b0602220947k3f5ca5f1wd2d785330fd396ec@mail.gmail.com> Ok, I'm used to first to a update before my commit, got your changes before I made mines :-) > > Still wanted to get it working right, but more feedback should hepl > > this, so a release is good. > > > > I just released! I've tested it out and it's hot. I'll be writing docs for > the site next and then the e-mail goes out. > > People have been testing it like crazy for me so it should be pretty good. > Hehe, I also wanted feedback! is not fair that you get all the ppl testing and don't inform me! ;-) > > > >> I took the time to do a win32-service gem which I think I'll put up on the > >> mongrel site so people can just gem install and go. All works great so far. > >> > > Good, we should inform the win32utils guys of this, so no problem araises. > >> > > Only bin/mongrel_rails_service should be linked as executable, the > > _svc only will be used internally to fire it up (and cannot be fired > > from a batch file). > > > I just kept it consistent, otherwise the gem system won't include both > scripts. I modified the source for this. > Consistent? we need to add to line #38 of Rakefile (the scripts part) only the "mongrel_rails_service" scripts=['mongrel_rails'] to: scripts=['mongrel_rails', 'mongrel_rails_service'] A note: inside _svc still resides the SimpleHandler code (which I was using to test the graceful shutdown). Later we should remove it when every bug was ironed... Ok, doing the Rakefile modification :-) Luis From luislavena at gmail.com Wed Feb 22 12:51:51 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 14:51:51 -0300 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: References: <71166b3b0602220927o522d6980g6ae41225da42423@mail.gmail.com> Message-ID: <71166b3b0602220951oca94c40wf5e6dd680c759127@mail.gmail.com> Hey!, you work faster than I could think! SVN worked ok, checking the mongrel_rails_svc was named ok in the install_service method. Now what should I do? sit and wait your release? ;-) Will check the stopping fail issue. even in the graful shutdown of SimpleHandler there are things quite don't work yet... Now need to do some company work :-D Later, Luis On 2/22/06, Zed Shaw wrote: > I'll do the docs. I'm already reworking the documentation page to expand it > out and give more docs. > > Oh and I took the little site down while I did the release. Did your svn > update work out ok? > > Zed > > > On 2/22/06 12:27 PM, "Luis Lavena" wrote: > > > Hi Zed, cannot access to the hosting... mail me the win32_howto please. > > > > Also, we need to comment/document the usage of mongrel_rails_service, > > in README maybe? > > > > Hope my english will be good to describe the process :-D > > > > Luis > > > > On 2/22/06, Zed Shaw wrote: > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis From zedshaw at zedshaw.com Wed Feb 22 13:03:41 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 13:03:41 -0500 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: <71166b3b0602220951oca94c40wf5e6dd680c759127@mail.gmail.com> Message-ID: Yeah, I'm just updating docs right now. Go ahead and try a gem update on your box and see if everything comes out right. About the scripts var in Rakefile: It's updated right before the win32 gem build statement. No point in including the service files for other platforms. Stay tuned. Should be another 30 minutes or so. Zed On 2/22/06 12:51 PM, "Luis Lavena" wrote: > Hey!, you work faster than I could think! > > SVN worked ok, checking the mongrel_rails_svc was named ok in the > install_service method. > > Now what should I do? sit and wait your release? ;-) > > Will check the stopping fail issue. even in the graful shutdown of > SimpleHandler there are things quite don't work yet... > > Now need to do some company work :-D > > Later, > > Luis > From luislavena at gmail.com Wed Feb 22 13:12:35 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 15:12:35 -0300 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: References: <71166b3b0602220951oca94c40wf5e6dd680c759127@mail.gmail.com> Message-ID: <71166b3b0602221012x7b21522bk4e82dcbec3a33cc0@mail.gmail.com> > About the scripts var in Rakefile: It's updated right before the win32 gem > build statement. No point in including the service files for other > platforms. > Actually, only mongrel_rails_service should be included there... changed that line to reflect that. (the scripts_win32 part) reverted the scripts to list just mongrel_rails. So, fixed it... now its ok (revision 57). Later, Luis From zedshaw at zedshaw.com Wed Feb 22 13:36:29 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 13:36:29 -0500 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: <71166b3b0602221012x7b21522bk4e82dcbec3a33cc0@mail.gmail.com> Message-ID: Ok, we'll throw that in the next release. The gems are already up and work so I don't want to touch them since rubygems is real touchy. Zed On 2/22/06 1:12 PM, "Luis Lavena" wrote: >> About the scripts var in Rakefile: It's updated right before the win32 gem >> build statement. No point in including the service files for other >> platforms. >> > > Actually, only mongrel_rails_service should be included there... > changed that line to reflect that. > > (the scripts_win32 part) reverted the scripts to list just mongrel_rails. > > So, fixed it... now its ok (revision 57). > > Later, > > Luis > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From zedshaw at zedshaw.com Wed Feb 22 13:55:51 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 13:55:51 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.6 -- Win32 Service/Rails Real Good Message-ID: Hello Folks, This release of Mongrel should make the win32 folks go crazy. Thanks to Luis Lavena it supports a full service system for installing any Rails app as a service. This lets you start your rails apps from either the command line or the Service console. Stopping is still a bit problematic but we hope to have that solved in the next release. You win32 folks should probably send Luis cookies or something since his work just plain rocks. It's rare in a Ruby project that the win32 support starts to get better than the POSIX systems. == What is Mongrel? Mongrel is a fast HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI. It is framework agnostic and already supports Ruby On Rails, Og+Nitro, and Camping frameworks. == Changes for 0.3.6 * A really complete win32 service runner for installing any Rails app as a Mongrel service. * Lots of fixes to the Rails support and CGIWrapper. Other frameworks should be able to poach all the starter/runner scripts (even the service one) and replicate this setup. * Support for specifying a YAML file of additional MIME types you need. Mongrel has a few but you can specify more. This is available for both the win32 service and regular mongrel_rails runner. * It's been used heavily by myself and others while in development mode so it should be usable for many people. * content-type and redirects from behind a proxy are working again. * A bunch of documentation on how to run Mongrel in various situations with more to come. * Win32 gem no longer depends on daemons. Other systems do depend on it. -- Only thing with the win32 service is that stopping is a bit broken. Nothing big though since everyone loves Mongrel so much they probably will never stop it. == Installing The Goods For non-win32 people just do: $ gem install mongrel Or gem upgrade if you've already got Mongrel. For win32 folks I had to build a special win32-service gem based on Dan Berger's fantastic work. You'll need to do this: $ gem install win32-service $ gem install mongrel If you alredy have win32-service installed then skip the first command. The gem for win32-service is based on the 0.5.0 version. == Using The Win32 Service There's a more extensive doc here: http://mongrel.rubyforge.org/docs/win32.html But for the impatient, do this: $ mongrel_rails_service install -n myapp \ -r c:\my\path\to\myapp -p 4000 -e production $ mongrel_rails_service start -n myapp And you're hooked up. You can also still use the previous method of just running it from the command line with mongrel_rails start but use CTRL-Pause/Break to stop (not CTRL-C). == Mailing Lists We've been doing pre-release announcements and discussing development on the mailing list. Feel free to join http://rubyforge.org/mailman/listinfo/mongrel-users == Next Release We should have the stopping problem cleaned up and maybe a few more win32 goodies as well. There should also be the start of a filtering setup which will lead to some caching, gzip/deflate content, and security controls. Feel free to request any other features and report bugs. Zed A. Shaw http://www.zedshaw.com/ From zedshaw at zedshaw.com Wed Feb 22 13:57:14 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Wed, 22 Feb 2006 13:57:14 -0500 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: Message-ID: Alright, announcements are out and site is up. Let's now sit back and see what they think. Great work Luis. I think this stuff is just plain awesome. Zed From luislavena at gmail.com Wed Feb 22 14:10:02 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 16:10:02 -0300 Subject: [Mongrel] Temporary win32 gems up. In-Reply-To: References: <71166b3b0602221012x7b21522bk4e82dcbec3a33cc0@mail.gmail.com> Message-ID: <71166b3b0602221110x26e36219g3d570c31cc3d84c9@mail.gmail.com> On 2/22/06, Zed Shaw wrote: > Ok, we'll throw that in the next release. The gems are already up and work > so I don't want to touch them since rubygems is real touchy. Ok, anyway I have commited that so will show in next release. Luis From luislavena at gmail.com Wed Feb 22 20:34:57 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Feb 2006 22:34:57 -0300 Subject: [Mongrel] A few changes to rails services. Message-ID: <71166b3b0602221734r526f6d63obf008e245c07abb3@mail.gmail.com> Ok, commited a few modifications to mongrel_rails_svc (revision 59). For the ones running from svn, please do a update and take a look into it. Good news: services now start and stop ok from controller or net commands. Other good news: done some refactoring to the code into _svc file to create a RailsMongrel class. This class perform whatever you need to start a rails app powered by mongrel. Could be used as base for scripts later. Take a look at the command "debug" into _svc, soemthing similar you could use in your scripts. The bad news? I guess there isn't one :-D Ok, update, test and provide feedback. service still generate debug.log and debug-thread.log where it is located. Please include these files when reporting problems. Hopefully if everythings goes ok, that will be removed before next release. -- Luis From zedshaw at zedshaw.com Sat Feb 25 09:57:15 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Sat, 25 Feb 2006 09:57:15 -0500 Subject: [Mongrel] 0.3.7 release this weekend Message-ID: I'm doing another 0.3.7 release this weekend which will roll in changes from Luis for the win32 service, and some enhancements to the mongrel_rails Unix runner which makes it behave better with switchtower. There's also a new document on setting up a proxy with lighttpd to do simple clustering on the site: http://mongrel.rubyforge.org/docs/lighttpd.html I'll be writing up more documentation this weekend as well in order to cover the different questions I've received. Feel free to ask for docs. Zed From luislavena at gmail.com Sat Feb 25 12:31:24 2006 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 25 Feb 2006 14:31:24 -0300 Subject: [Mongrel] 0.3.7 release this weekend In-Reply-To: References: Message-ID: <71166b3b0602250931h2ff058dep5d253c83dd4f251d@mail.gmail.com> Zed, I'm doing some research in the rails-based instiki for the errors reported. Hope we could figure these out before your release. Anyway, could wait until sunday afternnon (GMT-3 here). In that way, we coordinate the two fronts (posix and win32) to fix issues. Later, On 2/25/06, Zed Shaw wrote: > I'm doing another 0.3.7 release this weekend which will roll in changes from > Luis for the win32 service, and some enhancements to the mongrel_rails Unix > runner which makes it behave better with switchtower. > > There's also a new document on setting up a proxy with lighttpd to do simple > clustering on the site: > > http://mongrel.rubyforge.org/docs/lighttpd.html > > I'll be writing up more documentation this weekend as well in order to cover > the different questions I've received. Feel free to ask for docs. > > Zed > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis From zedshaw at zedshaw.com Sat Feb 25 19:16:24 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Sat, 25 Feb 2006 19:16:24 -0500 Subject: [Mongrel] 0.3.7 release this weekend In-Reply-To: <71166b3b0602250931h2ff058dep5d253c83dd4f251d@mail.gmail.com> Message-ID: Most definitely we can coordinate it. I'm mostly interested in getting out the switchtower stuff for the unix side and that one fix you did for the service. I'll chat with you soon (right now gonna go see a movie). Zed On 2/25/06 12:31 PM, "Luis Lavena" wrote: > Zed, I'm doing some research in the rails-based instiki for the errors > reported. > > Hope we could figure these out before your release. > > Anyway, could wait until sunday afternnon (GMT-3 here). > > In that way, we coordinate the two fronts (posix and win32) to fix issues. > > Later, > From luislavena at gmail.com Sun Feb 26 21:46:04 2006 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 26 Feb 2006 23:46:04 -0300 Subject: [Mongrel] Processor Affinity for Services! Message-ID: <71166b3b0602261846g20873ad8q7d1ced8a70203923@mail.gmail.com> I was playing with a dualcore opteron at office this week. Thinking at because ruby Thread nature is no native (OS) Threads, multithreading actually means nothing to ruby, right? But after I saw the cluster-howto of Zed, thought a bit and do a research... service clustering even in the same machine? Because we truly have 2 cpus, bind a ruby interpreter to each one is no problem (because there isn't communication between them). That way, we could take maximum CPU availability for each interpreter... get the picture? Oh, almost forgot, just add --cpu N when installing the service (number range from 1 to 8). Don't have a 4-way machine here to test grather values than CPU 2 :-D This week I'll investigate what is needed to "gracefully crash" your service and make Windows Service Monitoring automatically restart it... like a "service guardian", sounds cool doesn't? BTW, now services stop OK, again was ruby threading nature which conflict with native (OS) ones. -- Luis From zedshaw at zedshaw.com Tue Feb 28 01:52:52 2006 From: zedshaw at zedshaw.com (Zed Shaw) Date: Tue, 28 Feb 2006 01:52:52 -0500 Subject: [Mongrel] New flexible plugin system in the works Message-ID: Hi Everyone, Just a quick message to say that I'm holding back the 0.3.7 release so I can get this flexible plugin system going that we'll need for the next step of loading user defined handlers and filters. What I've done is completely replaces pluginfactory with an alternative that lets you create simple classes like so: class Stop < Plugin "/commands" ... end And it'll get registered automagically into the PluginManager. I have the command system already doing this without problems and it is a lot faster than Plugin factory. The weird class definition syntax is a strange trick I picked up from the Camping folks and basically means that this plugin belongs in the "/commands" category. These categories can be fairly arbitrary and are really just using the URIClassifier. So, how will it get used? I'm adding an option -L that you can pass a path and Mongrel will load all the .rb files in that directory for you. All you then need to do is place your new commands (or other plugins) in this directory however you want and they'll be available. I'm going to then work out how you would create your own handlers from this, and finally add filters and loading those arbitrarily as well. Anyway, should have this into svn tonight so please test away and report the breakage to me. Zed From jjones at raindrop.co.uk Tue Feb 28 09:19:13 2006 From: jjones at raindrop.co.uk (Jeff Jones) Date: Tue, 28 Feb 2006 14:19:13 -0000 Subject: [Mongrel] Threading & database connections. Message-ID: <2366790BFF3A2944A8ED995501FAA95001D6E0F3@rd-w2k3-svrexg.raindrop.uk.local> Hello all. Bear with me, there is a Mongrel question in here ;) I have been having some fun with database connections and ruby. Long story ( Found here: http://www.ruby-forum.com/topic/56047 ) short: I was making far too many in my application. I eventually fixed this (I thought) and when running webrick there were only ever two connections (One to each database) no matter how many users, this was perfect! so I thought "Great! I'll now put it on that mongrel server I have read so much about since it kicks the stuffing out of webrick and is perfectly suited to a smallish intranet site!". Having messed around (Read: failed) with Apache getting Mongrel running was so simple (Thanks!). Then after a bit of testing I got shouted at by the Service department for a steadily increasing number of connections to the Oracle server. Having read up on Mongrel I see there is an option to limit the number of threads it can use. My question is: Does each thread correspond to a "Running" instance of the application? If so then limiting that would theoretically limit the number of DB connections...right? When I look at the task manager (Yet, I am running windows...no I didn't have a choice in the matter ;) I see only once instance of ruby.exe running. The threadedness of mongrel is the only difference I can see between it and the (I assume) threadless and working Webrick Thanks for reading through this rambling tale of adversity, sorrow and great dogs and I am hoping you can give me a happy ending. Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060228/bc1736f6/attachment.htm From luislavena at gmail.com Tue Feb 28 11:52:57 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 28 Feb 2006 13:52:57 -0300 Subject: [Mongrel] Threading & database connections. In-Reply-To: <2366790BFF3A2944A8ED995501FAA95001D6E0F3@rd-w2k3-svrexg.raindrop.uk.local> References: <2366790BFF3A2944A8ED995501FAA95001D6E0F3@rd-w2k3-svrexg.raindrop.uk.local> Message-ID: <71166b3b0602280852q5b5f2331rc6b5e8c3a60202a2@mail.gmail.com> Maybe Zed could answer this better, but will to a shot ;-) Comments bellow... On 2/28/06, Jeff Jones wrote: > > > > Hello all. > > Bear with me, there is a Mongrel question in here ;) > > [snip] > > Having messed around (Read: failed) with Apache getting Mongrel running was > so simple (Thanks!). Then after a bit of testing I got shouted at by the > Service department for a steadily increasing number of connections to the > Oracle server. > > Having read up on Mongrel I see there is an option to limit the number of > threads it can use. My question is: Does each thread correspond to a > "Running" instance of the application? If so then limiting that would > theoretically limit the number of DB connections...right? When I look at the > task manager (Yet, I am running windows...no I didn't have a choice in the > matter ;) I see only once instance of ruby.exe running. > The Threads that mongrel uses are only for socket connections. These "workers" only perform the socket handshake and leave the reply stuff to the CGI Wrapper (which in this case is rails). If you check the code in mongrel_rails, you will see that because rails isn't "thread-safe", a Mutex was used to avoid controllers from executing simultaneously. The number of active connections shouldn't be different from webrick. I don't know if there is a way to dump information from active or opened connections, maybe using script/console? I guess don't have a lot of experience debugging code :-P -- Luis From luislavena at gmail.com Tue Feb 28 11:55:59 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 28 Feb 2006 13:55:59 -0300 Subject: [Mongrel] New flexible plugin system in the works In-Reply-To: References: Message-ID: <71166b3b0602280855k705f809cmab79247645ff46a8@mail.gmail.com> Zed, that change will require rewrite of mongrel_rails and mongrel_rails_service. With this we are planning do a mongrel_service as we talk before? In that case, we will jump the handlers and filters into the mongrel core instead? Maybe 0.4.0 will be more appropiate. Let me know when changes are ready so I check out and update the scripts according the new plugin system. Luis On 2/28/06, Zed Shaw wrote: > Hi Everyone, > > Just a quick message to say that I'm holding back the 0.3.7 release so I can > get this flexible plugin system going that we'll need for the next step of > loading user defined handlers and filters. > > What I've done is completely replaces pluginfactory with an alternative that > lets you create simple classes like so: > > class Stop < Plugin "/commands" > ... > end > > And it'll get registered automagically into the PluginManager. I have the > command system already doing this without problems and it is a lot faster > than Plugin factory. The weird class definition syntax is a strange trick I > picked up from the Camping folks and basically means that this plugin > belongs in the "/commands" category. These categories can be fairly > arbitrary and are really just using the URIClassifier. > > So, how will it get used? I'm adding an option -L that you can pass a path > and Mongrel will load all the .rb files in that directory for you. All you > then need to do is place your new commands (or other plugins) in this > directory however you want and they'll be available. > > I'm going to then work out how you would create your own handlers from this, > and finally add filters and loading those arbitrarily as well. > > Anyway, should have this into svn tonight so please test away and report the > breakage to me. > > Zed > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >