From snacktime at gmail.com Wed Nov 1 00:00:01 2006 From: snacktime at gmail.com (snacktime) Date: Tue, 31 Oct 2006 21:00:01 -0800 Subject: [Mongrel] mongrel parser for server response In-Reply-To: <1f060c4c0610312051y89ec617p46b848cabbf3e59b@mail.gmail.com> References: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> <20061031174955.148986fa.zedshaw@zedshaw.com> <1f060c4c0610312051y89ec617p46b848cabbf3e59b@mail.gmail.com> Message-ID: <1f060c4c0610312100q707a877ap1d7c08b906f6f50d@mail.gmail.com> Should probably ask just in case. Is there a version of the mongrel parser laying around that sticks everything in instance vars like rfuzz does? Chris From zedshaw at zedshaw.com Wed Nov 1 02:59:47 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 31 Oct 2006 23:59:47 -0800 Subject: [Mongrel] mongrel parser for server response In-Reply-To: <1f060c4c0610312100q707a877ap1d7c08b906f6f50d@mail.gmail.com> References: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> <20061031174955.148986fa.zedshaw@zedshaw.com> <1f060c4c0610312051y89ec617p46b848cabbf3e59b@mail.gmail.com> <1f060c4c0610312100q707a877ap1d7c08b906f6f50d@mail.gmail.com> Message-ID: <20061031235947.1386d874.zedshaw@zedshaw.com> On Tue, 31 Oct 2006 21:00:01 -0800 snacktime wrote: > Should probably ask just in case. Is there a version of the mongrel > parser laying around that sticks everything in instance vars like > rfuzz does? > Nope, since nobody would use it anyway. Remember Mongrel has to talk to whatever the different framework authors cook up, which turns out to be a hash wrapped in half a cgi.rb sort of thing. With RFuzz I can do what I want so it's much cleaner. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://safari.oreilly.com/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From jgeiger at gmail.com Wed Nov 1 11:26:43 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Wed, 1 Nov 2006 10:26:43 -0600 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR Message-ID: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> I'm using a cluster of mongrels behind an apache 1.3 proxy pass. I've been passing the request to pen, which in turn balances the cluster of mongrels. Now, I'd like to be able to use a different server to send the static files created by the rails application, so I tried to replace pen with nginx. Everything seems to work fine except the environment variable REMOTE_ADDR. When I do a <%= request.env["REMOTE_ADDR"] %> with pen balancing, it sends in the proper (and expected) 192.168.1.21. When nginx is the balancer, the output becomes: 192.168.1.21, 127.0.0.1. the nginx proxy information I have set is: proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; Just wondering if anyone else has run into this problem, and it's possible solution. Thank you. From al-mongrelusers at none.at Wed Nov 1 13:55:42 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Wed, 1 Nov 2006 19:55:42 +0100 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> Message-ID: <20061101185542.GA10532@none.at> On Mit 01.11.2006 10:26, Joey Geiger wrote: >I'm using a cluster of mongrels behind an apache 1.3 proxy pass. I've >been passing the request to pen, which in turn balances the cluster of >mongrels. Now, I'd like to be able to use a different server to send >the static files created by the rails application, so I tried to >replace pen with nginx. Everything seems to work fine except the >environment variable REMOTE_ADDR. I think this isn't a mongrel issue. >When I do a <%= request.env["REMOTE_ADDR"] %> with pen balancing, it >sends in the proper (and expected) 192.168.1.21. > >When nginx is the balancer, the output becomes: 192.168.1.21, 127.0.0.1. > >the nginx proxy information I have set is: > >proxy_redirect off; >proxy_set_header Host $host; >proxy_set_header X-Real-IP $remote_addr; >proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; What do you get when you add this line: proxy_set_header REMOTE_ADDR $remote_addr; More about the proxy module can you find here: http://wiki.codemongers.com/NginxHttpProxyModule >Just wondering if anyone else has run into this problem, and it's >possible solution. How about to ask this on nginx list, I think it *could* be the better list ;-) Regards Aleks From zedshaw at zedshaw.com Wed Nov 1 14:48:09 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 1 Nov 2006 11:48:09 -0800 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> Message-ID: <20061101114809.f1743ba5.zedshaw@zedshaw.com> On Wed, 1 Nov 2006 10:26:43 -0600 "Joey Geiger" wrote: > When I do a <%= request.env["REMOTE_ADDR"] %> with pen balancing, it > sends in the proper (and expected) 192.168.1.21. > > When nginx is the balancer, the output becomes: 192.168.1.21, 127.0.0.1. That's odd. I wonder if nginx is doing this as a "feature" so you know that it's really 127.0.0.1 and the other IP. I kind of like that actually. What you can do is turn on -B logging, then go look at log/mongrel_debug/rails.log to see what is being passed to rails. That'll let you know if it's getting combined and where. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://safari.oreilly.com/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From jgeiger at gmail.com Wed Nov 1 16:02:45 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Wed, 1 Nov 2006 15:02:45 -0600 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <20061101185542.GA10532@none.at> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> <20061101185542.GA10532@none.at> Message-ID: <466af3440611011302x6709d9dep1022a30c62d3b0de@mail.gmail.com> I was able to figure it out after some file editing. I might be a special case because I'm proxying to nginx, which in turn proxies to mongrel. I removed the and only the normal IP was passed. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; On 11/1/06, Aleksandar Lazic wrote: > On Mit 01.11.2006 10:26, Joey Geiger wrote: > >I'm using a cluster of mongrels behind an apache 1.3 proxy pass. I've > >been passing the request to pen, which in turn balances the cluster of > >mongrels. Now, I'd like to be able to use a different server to send > >the static files created by the rails application, so I tried to > >replace pen with nginx. Everything seems to work fine except the > >environment variable REMOTE_ADDR. > > I think this isn't a mongrel issue. > > >When I do a <%= request.env["REMOTE_ADDR"] %> with pen balancing, it > >sends in the proper (and expected) 192.168.1.21. > > > >When nginx is the balancer, the output becomes: 192.168.1.21, 127.0.0.1. > > > >the nginx proxy information I have set is: > > > >proxy_redirect off; > >proxy_set_header Host $host; > >proxy_set_header X-Real-IP $remote_addr; > >proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > What do you get when you add this line: > > proxy_set_header REMOTE_ADDR $remote_addr; > > More about the proxy module can you find here: > > http://wiki.codemongers.com/NginxHttpProxyModule > > >Just wondering if anyone else has run into this problem, and it's > >possible solution. > > How about to ask this on nginx list, I think it *could* be the better > list ;-) > > Regards > > Aleks > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From jeremy at bitsweat.net Wed Nov 1 16:25:33 2006 From: jeremy at bitsweat.net (Jeremy Kemper) Date: Wed, 1 Nov 2006 13:25:33 -0800 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> Message-ID: <69a2885c0611011325l26c64183iaf8f1f4e44c948cf@mail.gmail.com> On 11/1/06, Joey Geiger wrote: > > I'm using a cluster of mongrels behind an apache 1.3 proxy pass. I've > been passing the request to pen, which in turn balances the cluster of > mongrels. Now, I'd like to be able to use a different server to send > the static files created by the rails application, so I tried to > replace pen with nginx. Everything seems to work fine except the > environment variable REMOTE_ADDR. > > When I do a <%= request.env["REMOTE_ADDR"] %> with pen balancing, it > sends in the proper (and expected) 192.168.1.21. > > When nginx is the balancer, the output becomes: 192.168.1.21, 127.0.0.1. > > the nginx proxy information I have set is: > > proxy_redirect off; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > Just wondering if anyone else has run into this problem, and it's > possible solution. Use request.remote_ip which also understands the proxy headers. jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061101/d06d993d/attachment.html From al-mongrelusers at none.at Wed Nov 1 17:11:24 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Wed, 1 Nov 2006 23:11:24 +0100 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <466af3440611011302x6709d9dep1022a30c62d3b0de@mail.gmail.com> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> <20061101185542.GA10532@none.at> <466af3440611011302x6709d9dep1022a30c62d3b0de@mail.gmail.com> Message-ID: <20061101221124.GA22746@none.at> On Mit 01.11.2006 15:02, Joey Geiger wrote: > >I removed the and only the normal IP was passed. ^^? Aehm what have you removed?! Regards Aleks From hip at lan-attack.ch Thu Nov 2 04:32:15 2006 From: hip at lan-attack.ch (Philippe Jayet) Date: Thu, 02 Nov 2006 10:32:15 +0100 Subject: [Mongrel] MogileFS handler Message-ID: <4549BB1F.6050600@lan-attack.ch> Hello, I've been using NFS for sharing files across a cluster of servers but I've had a lot of problems with that. I'm planning to move to MogileFS which seems to be more stable and more adapted to this usage (lots of user uploaded files). I wonder if someone has already worked on an integration of MogileFS into Mongrel (and Rails app) for serving the files ? If not, I think of writing a handler that would act as a bridge between the MogileFS keys and the actual files. I could use Perlbal from Danga but it involves a new technology (Perl) and a new setup. What do you think about this ? Thanks for all, Philippe From jarkko at jlaine.net Thu Nov 2 05:35:42 2006 From: jarkko at jlaine.net (Jarkko Laine) Date: Thu, 2 Nov 2006 12:35:42 +0200 Subject: [Mongrel] MogileFS handler In-Reply-To: <4549BB1F.6050600@lan-attack.ch> References: <4549BB1F.6050600@lan-attack.ch> Message-ID: <818D9159-3D5F-4AAA-B85D-5616E88A9E7F@jlaine.net> Hi Philippe, On 2.11.2006, at 11.32, Philippe Jayet wrote: > Hello, > > I've been using NFS for sharing files across a cluster of servers but > I've had a lot of problems with that. I'm planning to move to MogileFS > which seems to be more stable and more adapted to this usage (lots of > user uploaded files). > > I wonder if someone has already worked on an integration of MogileFS > into Mongrel (and Rails app) for serving the files ? If not, I > think of > writing a handler that would act as a bridge between the MogileFS keys > and the actual files. Have a look at Robot Co-op's MogileFS client (http:// blog.segment7.net/articles/2006/03/22/mogilefs-for-ruby). //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061102/88facb12/attachment.bin From jw at innerewut.de Thu Nov 2 05:46:45 2006 From: jw at innerewut.de (Jonathan Weiss) Date: Thu, 02 Nov 2006 11:46:45 +0100 Subject: [Mongrel] MogileFS handler In-Reply-To: <4549BB1F.6050600@lan-attack.ch> References: <4549BB1F.6050600@lan-attack.ch> Message-ID: <4549CC95.6040903@innerewut.de> > > What do you think about this ? There is a mogile-fs client from robotcoop http://dev.robotcoop.com/Libraries/mogilefs/index.html that can be easily integrated with your Rails app. Jonathan -- Jonathan Weiss http://blog.innerewut.de From hip at lan-attack.ch Thu Nov 2 07:50:11 2006 From: hip at lan-attack.ch (Philippe Jayet) Date: Thu, 02 Nov 2006 13:50:11 +0100 Subject: [Mongrel] MogileFS handler In-Reply-To: <4549CC95.6040903@innerewut.de> References: <4549BB1F.6050600@lan-attack.ch> <4549CC95.6040903@innerewut.de> Message-ID: <4549E983.3050608@lan-attack.ch> Hi, > There is a mogile-fs client from robotcoop > > http://dev.robotcoop.com/Libraries/mogilefs/index.html > > that can be easily integrated with your Rails app. I'll definitely be using this library in my application. But I need some way to serve the MogileFS files (mainly images and audio files) and I don't want to use Rails for this. All the overhead is unnecessary. To serve the MogileFS files, Robot Co-op are using their webrick-high-performance server with a servlet for accessing MogileFS (through their mogilefs-client library). I think it would be easier in my setup to use Mongrel for this task. By the way, my setup is : Apache 2.2 load balancing requests to Mongrel/Rails. Another option would be to use Apache to serve the MogileFS files. Thanks for your help, Philippe From runner at berkeley.edu Thu Nov 2 09:17:05 2006 From: runner at berkeley.edu (Steven Hansen) Date: Thu, 02 Nov 2006 06:17:05 -0800 Subject: [Mongrel] MogileFS handler In-Reply-To: <4549E983.3050608@lan-attack.ch> References: <4549BB1F.6050600@lan-attack.ch> <4549CC95.6040903@innerewut.de> <4549E983.3050608@lan-attack.ch> Message-ID: <4549FDE1.5050305@berkeley.edu> mod_xsendfile is pretty nice for serving files: http://celebnamer.celebworld.ws/stuff/mod_xsendfile/ Especially if you don't want to put all your files in the public directory. -Steven Philippe Jayet wrote: > Hi, > > >> There is a mogile-fs client from robotcoop >> >> http://dev.robotcoop.com/Libraries/mogilefs/index.html >> >> that can be easily integrated with your Rails app. >> > > I'll definitely be using this library in my application. But I need some > way to serve the MogileFS files (mainly images and audio files) and I > don't want to use Rails for this. All the overhead is unnecessary. > > To serve the MogileFS files, Robot Co-op are using their > webrick-high-performance server with a servlet for accessing MogileFS > (through their mogilefs-client library). I think it would be easier in > my setup to use Mongrel for this task. > > By the way, my setup is : Apache 2.2 load balancing requests to > Mongrel/Rails. Another option would be to use Apache to serve the > MogileFS files. > > Thanks for your help, > > Philippe > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From jgeiger at gmail.com Thu Nov 2 09:25:41 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Thu, 2 Nov 2006 08:25:41 -0600 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <20061101221124.GA22746@none.at> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> <20061101185542.GA10532@none.at> <466af3440611011302x6709d9dep1022a30c62d3b0de@mail.gmail.com> <20061101221124.GA22746@none.at> Message-ID: <466af3440611020625y1c2ad10ahcfb3276af3a06c36@mail.gmail.com> Whoops, I removed the line below. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; I believe what was happening, was that apache was proxying the request to nginx, and adding the x_forwarded_for as the real ip (192.168.1.21) then, nginx was passing the proxy request to mongrel, and was adding the ip that it was forwarding for (127.0.0.1) so the address that was passed to REMOTE_ADDR ended up as 192.168.1.21, 127.0.0.1. By removing that line from the nginx configuration, it only passed the first ip address. On 11/1/06, Aleksandar Lazic wrote: > On Mit 01.11.2006 15:02, Joey Geiger wrote: > > > >I removed the and only the normal IP was passed. > ^^? > Aehm what have you removed?! > > Regards > > Aleks > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From technoweenie at gmail.com Thu Nov 2 09:56:58 2006 From: technoweenie at gmail.com (Rick Olson) Date: Thu, 2 Nov 2006 08:56:58 -0600 Subject: [Mongrel] MogileFS handler In-Reply-To: <4549E983.3050608@lan-attack.ch> References: <4549BB1F.6050600@lan-attack.ch> <4549CC95.6040903@innerewut.de> <4549E983.3050608@lan-attack.ch> Message-ID: <48fe25b0611020656m587145bcj13a0346d52f8fb11@mail.gmail.com> On 11/2/06, Philippe Jayet wrote: > Hi, > > > There is a mogile-fs client from robotcoop > > > > http://dev.robotcoop.com/Libraries/mogilefs/index.html > > > > that can be easily integrated with your Rails app. > > I'll definitely be using this library in my application. But I need some > way to serve the MogileFS files (mainly images and audio files) and I > don't want to use Rails for this. All the overhead is unnecessary. > > To serve the MogileFS files, Robot Co-op are using their > webrick-high-performance server with a servlet for accessing MogileFS > (through their mogilefs-client library). I think it would be easier in > my setup to use Mongrel for this task. > > By the way, my setup is : Apache 2.2 load balancing requests to > Mongrel/Rails. Another option would be to use Apache to serve the > MogileFS files. > > Thanks for your help, > > Philippe You should be able to write one very easily. I have a mongrel_send_file plugin (unrelated to the sendfile header) that might be a good reference: http://rubyforge.org/projects/msend-file/ -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From hip at lan-attack.ch Thu Nov 2 10:23:16 2006 From: hip at lan-attack.ch (Philippe Jayet) Date: Thu, 02 Nov 2006 16:23:16 +0100 Subject: [Mongrel] MogileFS handler In-Reply-To: <4549FDE1.5050305@berkeley.edu> References: <4549BB1F.6050600@lan-attack.ch> <4549CC95.6040903@innerewut.de> <4549E983.3050608@lan-attack.ch> <4549FDE1.5050305@berkeley.edu> Message-ID: <454A0D64.4080400@lan-attack.ch> Hi, > mod_xsendfile is pretty nice for serving files: > > http://celebnamer.celebworld.ws/stuff/mod_xsendfile/ Yes, Zed posted that link some time ago. I'll have to give it a try, seems interesting and still maintained ... > Especially if you don't want to put all your files in the public directory. In the case of MogileFS, it creates a directory structure of its own to scale to a large number of files. So serving the files from these directories is not the solution I think of. And I plan to use MogileFS in HTTP mode (not NFS), so the files may even be unaccessible from the filesystem. That is why I think of developing a dynamic component that will ask the MogileFS tracker for the URL of the file (which may be local or not), get this file and return it to the client. Philippe From ian at blenke.com Thu Nov 2 12:37:49 2006 From: ian at blenke.com (Ian C. Blenke) Date: Thu, 02 Nov 2006 12:37:49 -0500 Subject: [Mongrel] MogileFS handler In-Reply-To: <454A0D64.4080400@lan-attack.ch> References: <4549BB1F.6050600@lan-attack.ch> <4549CC95.6040903@innerewut.de> <4549E983.3050608@lan-attack.ch> <4549FDE1.5050305@berkeley.edu> <454A0D64.4080400@lan-attack.ch> Message-ID: <454A2CED.1020903@blenke.com> Philippe Jayet wrote: >In the case of MogileFS, it creates a directory structure of its own to >scale to a large number of files. So serving the files from these >directories is not the solution I think of. And I plan to use MogileFS >in HTTP mode (not NFS), so the files may even be unaccessible from the >filesystem. That is why I think of developing a dynamic component that >will ask the MogileFS tracker for the URL of the file (which may be >local or not), get this file and return it to the client. > > I see two solutions for you here: 1. Write a Rails application that uses the mogilefs-client stuff to save/retrieve files as users create/request them (as MogileFS was intended to be used). 2. Use the FUSE mogilefs client to mount it as a filesystem for your entire rails project, and have mongrel serve up files as if they were static directly from public/. Knowing the state of the FUSE client the last time I looked at it, I would probably go with the former solution rather than the latter. There are other relational-master-metadata-distributed-replicated-datastore GRID style filesystems out there somewhat similar to MogileFS (like GFarm, CleverSafe, or even Hadoop), but MogileFS is probably one of your better bets when it comes to simplicity and a proven track record for Rails development/integration at the moment (with mogilefs-client). I suppose, in theory, you could modify mongrel to use mogilefs as a filesystem abstraction layer, but I really don't see the need for that code bloat. Smaller. Simpler. Faster. - Ian C. Blenke http://ian.blenke.com/ From zedshaw at zedshaw.com Thu Nov 2 17:03:19 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 2 Nov 2006 14:03:19 -0800 Subject: [Mongrel] MogileFS handler In-Reply-To: <4549BB1F.6050600@lan-attack.ch> References: <4549BB1F.6050600@lan-attack.ch> Message-ID: <20061102140319.0189b361.zedshaw@zedshaw.com> On Thu, 02 Nov 2006 10:32:15 +0100 Philippe Jayet wrote: > Hello, > > I've been using NFS for sharing files across a cluster of servers but > I've had a lot of problems with that. I'm planning to move to MogileFS > which seems to be more stable and more adapted to this usage (lots of > user uploaded files). > > I wonder if someone has already worked on an integration of MogileFS > into Mongrel (and Rails app) for serving the files ? If not, I think of > writing a handler that would act as a bridge between the MogileFS keys > and the actual files. > > I could use Perlbal from Danga but it involves a new technology (Perl) > and a new setup. Yep, this is totally possible depending on how you need to use it. If you just need to serve files out of mogilefs then look at the FUSE adapter and have your main web server do the work using either x-sendfile or plain old a-href. (many others mentioned this) If you're looking to do the upload and download with a bit of smarts behind it, then you're looking at doing a Mongrel handler or even set of Mongrel handlers. There's plenty of great examples you can leverage with Rick's mongrel_send_file and Ezra's merb stuff as examples. And of course, I'll pimp the book since it covers writing Mongrel handlers and how Mongrel is designed. :-) http://safari.oreilly.com/0321483502 Good luck, and when you do it, try to open source it since others will probably like something like this. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://safari.oreilly.com/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Thu Nov 2 17:05:30 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 2 Nov 2006 14:05:30 -0800 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <466af3440611020625y1c2ad10ahcfb3276af3a06c36@mail.gmail.com> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> <20061101185542.GA10532@none.at> <466af3440611011302x6709d9dep1022a30c62d3b0de@mail.gmail.com> <20061101221124.GA22746@none.at> <466af3440611020625y1c2ad10ahcfb3276af3a06c36@mail.gmail.com> Message-ID: <20061102140530.81ff55d1.zedshaw@zedshaw.com> On Thu, 2 Nov 2006 08:25:41 -0600 "Joey Geiger" wrote: > Whoops, > I removed the line below. > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > I believe what was happening, was that apache was proxying the request > to nginx, and adding the x_forwarded_for as the real ip (192.168.1.21) > then, nginx was passing the proxy request to mongrel, and was adding > the ip that it was forwarding for (127.0.0.1) so the address that was > passed to REMOTE_ADDR ended up as 192.168.1.21, 127.0.0.1. Uh, why do you have apache->nginx->mongrel when you can just do nginx->mongrel instead? -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://safari.oreilly.com/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From jgeiger at gmail.com Thu Nov 2 18:08:26 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Thu, 2 Nov 2006 17:08:26 -0600 Subject: [Mongrel] Nginx, Mongrel, Proxy and REMOTE_ADDR In-Reply-To: <20061102140530.81ff55d1.zedshaw@zedshaw.com> References: <466af3440611010826h7f795bc4r2fa83d0a3b37d536@mail.gmail.com> <20061101185542.GA10532@none.at> <466af3440611011302x6709d9dep1022a30c62d3b0de@mail.gmail.com> <20061101221124.GA22746@none.at> <466af3440611020625y1c2ad10ahcfb3276af3a06c36@mail.gmail.com> <20061102140530.81ff55d1.zedshaw@zedshaw.com> Message-ID: <466af3440611021508k165f2448y9d50fb9e6f89a843@mail.gmail.com> The site I work on was build about 7 years ago, using apache 1.3 and mod_perl. The majority of the site still exists in that format. I need to maintain the current apache 1.3edness and attempt to add new functionality using rails. I have http://site.com/app proxying to 127.0.0.1:8000/app (which is nginx) which in turn proxies to mongel listening at prefix=/app. It's a big mess, especially since I can't share the image files from the old site that the new rails code needs to use (no sense copying them to public, which is where config.action_controller.asset_host comes in, though it has issues with running under a prefix...) I switched from pen as the balancer to nginx because i believe that mongrel was going to be serving static files created by rails, so I wanted something in front of it that could handle that and pass the static file back to the apache proxy. It all seems to be working right now, fingers crossed. :) On 11/2/06, Zed A. Shaw wrote: > On Thu, 2 Nov 2006 08:25:41 -0600 > "Joey Geiger" wrote: > > > Whoops, > > I removed the line below. > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > > > I believe what was happening, was that apache was proxying the request > > to nginx, and adding the x_forwarded_for as the real ip (192.168.1.21) > > then, nginx was passing the proxy request to mongrel, and was adding > > the ip that it was forwarding for (127.0.0.1) so the address that was > > passed to REMOTE_ADDR ended up as 192.168.1.21, 127.0.0.1. > > Uh, why do you have apache->nginx->mongrel when you can just do nginx->mongrel instead? > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://safari.oreilly.com/0321483502 -- The Mongrel Book > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From robert at kitchendemocracy.org Thu Nov 2 21:13:54 2006 From: robert at kitchendemocracy.org (Robert Vogel) Date: Thu, 02 Nov 2006 19:13:54 -0700 Subject: [Mongrel] Problems with mongrel dying Message-ID: <20061102191354.c41e0b8117d7637a8f09ddbc78878a27.c1b5b48eaa.wbe@email.secureserver.net> Hello - I need help. For the past 11 days, one of the two mongrel processes on my railsmachine VPS has been crashing intermittently - it has crashed about 10 times, with increasing frequency in the past few days. Unfortunately, after many, many hours I still have not been able to reproduce this problem in a controlled way - neither on my production railsmachine nor on my development machine. As far as I can tell, I have followed these suggestions from Bradley and Zed and Zed's Mongrel book: lsop -i -P | grep CLOSE_WAIT shows nothing 99% CPU is not associated with either mongrel process - the CPU is never above 5%, usually at 0%, both while the process is crashed and while they are running Memory leak seems impossible. %MEM for both processes never above 15% both when crashed and when running. Dash Bee logging on my development machine shows that no object is steadily increasing its memory consumption - garbage collection seems to be working fine. Dash Bee logging on my develoment machine also shows no leaking files. Number of open files is stable (at 6). Traffic is miniscule (< 100 requests / hour); Inserting ActiveRecord::Base.verification_timeout = 14400 in environments/production.rb had no effect. Upgrading to pre-release mongrel had no effect: sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases My application is butt simple, and supported by oodles of unit, functional and integration test code. There is no transaction processing in the application and no opportunity for a jammed request due to using shared resources without proper locking. The application does not use RMagik, does not explicitely manipulate any files, and though I am not sure what you mean by 'shared resources', I suspect I am not using any. The only external libraries (external to rails) are three gems which access geo-coding services - but these were not in play when the processes crashed. killall -USR1 mongrel_rails has been in effect now through the last two crashes. The rails action which held things up was different in both cases - and is butt simple in both cases. Here is the mongrel.log in the vicinity of those two crashes: Thu Nov 02 13:07:16 PST 2006: 0 threads sync_waiting for /, 1 still active in Mongrel. Thu Nov 02 13:07:19 PST 2006: 0 threads sync_waiting for /login, 1 still active in Mongrel. Thu Nov 02 13:07:27 PST 2006: 0 threads sync_waiting for /login, 1 still active in Mongrel. Thu Nov 02 13:07:33 PST 2006: 0 threads sync_waiting for /admin/list_vote, 1 still active in Mongrel. Thu Nov 02 13:07:42 PST 2006: 0 threads sync_waiting for /admin/mark_reviewed, 1 still active in Mongrel. Thu Nov 02 13:08:17 PST 2006: 0 threads sync_waiting for /admin/mark_reviewed, 1 still active in Mongrel. Thu Nov 02 13:08:26 PST 2006: 0 threads sync_waiting for /admin/mark_reviewed, 3 still active in Mongrel. Thu Nov 02 13:08:37 PST 2006: 0 threads sync_waiting for /admin/mark_reviewed, 3 still active in Mongrel. Thu Nov 02 13:09:08 PST 2006: 1 threads sync_waiting for /admin/mark_reviewed, 4 still active in Mongrel. Thu Nov 02 13:09:35 PST 2006: Error calling Dispatcher.dispatch #) not locked.> /usr/lib/ruby/1.8/sync.rb:57:in `Fail' /usr/lib/ruby/1.8/sync.rb:63:in `Fail' and Thu Nov 02 00:05:29 PST 2006: 0 threads sync_waiting for /berkeley/downzoning/comments, 1 still active in Mongrel. Thu Nov 02 00:05:37 PST 2006: 0 threads sync_waiting for /berkeley/downzoning/comments, 1 still active in Mongrel. Thu Nov 02 00:06:11 PST 2006: 0 threads sync_waiting for /berkeley/downzoning/comments, 1 still active in Mongrel. Thu Nov 02 00:07:07 PST 2006: 0 threads sync_waiting for /berkeley/downzoning/comments, 1 still active in Mongrel. Thu Nov 02 00:07:27 PST 2006: 0 threads sync_waiting for /email_updates, 1 still active in Mongrel. Thu Nov 02 00:07:27 PST 2006: 0 threads sync_waiting for /email_updates_edit, 1 still active in Mongrel. Thu Nov 02 00:07:53 PST 2006: 0 threads sync_waiting for /berkeley/bus_rapid_transit/page/brtqanda, 1 still active in Mongrel. Thu Nov 02 00:08:11 PST 2006: 0 threads sync_waiting for /email_updates_edit, 2 still active in Mongrel. Thu Nov 02 00:08:39 PST 2006: 0 threads sync_waiting for /robots.txt, 1 still active in Mongrel. Thu Nov 02 00:08:39 PST 2006: 1 threads sync_waiting for /email_updates_edit, 3 still active in Mongrel. Thu Nov 02 00:09:50 PST 2006: 0 threads sync_waiting for /howitworks.php, 1 still active in Mongrel. Thu Nov 02 00:09:50 PST 2006: 3 threads sync_waiting for /email_updates_edit, 5 still active in Mongrel. So - as you can tell, I am a newbie at wits end, hoping you guys can 1) help me fix the problem, and 2) help me implement a temporary workaround so I can stop checking every few hours to see if I need to cap -a restart_app (which so far, has always worked...) Thanks for your careful attention. Cheers Robert Vogel > -------- Original Message -------- > Subject: Re: [Mongrel] Problems with mongrel dying > From: "Zed A. Shaw" > Date: Tue, October 31, 2006 2:36 pm > To: mongrel-users at rubyforge.org > > On Tue, 31 Oct 2006 12:48:02 -0700 > Robert Vogel wrote: > > > Hi > > > > One of the two mongrel processes has died in the middle of the night > > four times in the past 9 days, and I need help debugging this. > > > > Each time the symptoms are the same: > > Really, quick, but upgrade to the pre-release and then tell me if you still get these: > > sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases > > If it does not fix the problem (remember, it's random so let it run in production for a while), then turn on USR1 logging and watch for the rails action that is blocking things: > > sudo killall -USR1 mongrel_rails > > Otherwise, keep in mind that many many people use Mongrel without blocking problems, so you need to rule out anything non-standard you're using that can cause problems. RMagick, frequent DNS calls, working with files or shared resources, are all main culprits. > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://safari.oreilly.com/0321483502 -- The Mongrel Book > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From samuelgiffney at gmail.com Thu Nov 2 21:25:32 2006 From: samuelgiffney at gmail.com (Sam Giffney) Date: Fri, 3 Nov 2006 15:25:32 +1300 Subject: [Mongrel] Problems with mongrel dying Message-ID: Hi Robert, I have no idea about your problem but the workaround is simple. Use Monit to regulate your mongrels (it'll do the checking and restarting for you every 3 minutes) I risk falling on Zed's sword of wrath but my mongrels escalate in memory usage under load and I use Monit to restart them and keep em tidy (I fully presume it's because of MY lousy code) Sam From zedshaw at zedshaw.com Thu Nov 2 22:13:05 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 2 Nov 2006 19:13:05 -0800 Subject: [Mongrel] Problems with mongrel dying In-Reply-To: References: Message-ID: <20061102191305.b40f5443.zedshaw@zedshaw.com> On Fri, 3 Nov 2006 15:25:32 +1300 "Sam Giffney" wrote: > Hi Robert, > I have no idea about your problem but the workaround is simple. Use > Monit to regulate your mongrels (it'll do the checking and restarting > for you every 3 minutes) > I risk falling on Zed's sword of wrath but my mongrels escalate in > memory usage under load and I use Monit to restart them and keep em > tidy > (I fully presume it's because of MY lousy code) That's probably the best you can do until you can find out why it's leaking. My past experience has been to never trust Ruby's GC or any external C extensions you may be using. I've combed through Mongrel to insane levels to root out all possible leaks I can. Yet, the Sync vs. Mutex bug and recent Array patch from Eric M. shows that Ruby's GC has a long way to go. If you can't find it right away with the -B option and log/mongrel_debug/objects.log then it's probably too deep inside Ruby or a C extension you're using (RMagick is a big one). Just hit it with monit and at least your site keeps going. Ugly, but it works. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://safari.oreilly.com/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Thu Nov 2 22:19:51 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 2 Nov 2006 19:19:51 -0800 Subject: [Mongrel] Problems with mongrel dying In-Reply-To: <20061102191354.c41e0b8117d7637a8f09ddbc78878a27.c1b5b48eaa.wbe@email.secureserver.net> References: <20061102191354.c41e0b8117d7637a8f09ddbc78878a27.c1b5b48eaa.wbe@email.secureserver.net> Message-ID: <20061102191951.1a9665a8.zedshaw@zedshaw.com> On Thu, 02 Nov 2006 19:13:54 -0700 Robert Vogel wrote: > Hello - > > I need help. For the past 11 days, one of the two mongrel processes on > my railsmachine VPS has been crashing intermittently - it has crashed > about 10 times, with increasing frequency in the past few days. > Unfortunately, after many, many hours I still have not been able to > reproduce this problem in a controlled way - neither on my production > railsmachine nor on my development machine. As far as I can tell, I > have followed these suggestions from Bradley and Zed and Zed's Mongrel > book: That's awesomely complete for an analysis. And you say they just "poof" go away? Ok, so there *has* to be something different about your setup compared to other folks. I'm thinking the oom killer thing is to blame. Usually when someone says it "just goes boom" it's because of this. While you may think your mongrel process isn't using that much ram, keep in mind it's based on how much is available vs. what's used. You could have a mysql that eats all the ram and Linux decides to kill your mongrel. So, to confirm this isn't the case, monitor your memory usage totals during the day, and install monit to e-mail you when it needs to restart. Monit will tell you it had to restart, then you can jump on and see what your memory usage log was reporting. I usually just run a little cron job that spits out the free command to a file once every 5 minutes or so. Also, look in the linux log files. IIRC the oom killer doesn't say anything, but check to see if they improved this "magic". Zed From robert at kitchendemocracy.org Fri Nov 3 10:41:08 2006 From: robert at kitchendemocracy.org (Robert Vogel) Date: Fri, 03 Nov 2006 08:41:08 -0700 Subject: [Mongrel] Problems with mongrel dying Message-ID: <20061103084107.c41e0b8117d7637a8f09ddbc78878a27.e2c5d84fa5.wbe@email.secureserver.net> Hello Zed - Thanks for the response; I will follow your advice, and will get right on installing monit. Question - you also say 'look in the linux log files'. Which log files should I look at, where are they and what should I look for? Thanks Robert That's awesomely complete for an analysis. And you say they just "poof" go away? Ok, so there *has* to be something different about your setup compared to other folks. I'm thinking the oom killer thing is to blame. Usually when someone says it "just goes boom" it's because of this. While you may think your mongrel process isn't using that much ram, keep in mind it's based on how much is available vs. what's used. You could have a mysql that eats all the ram and Linux decides to kill your mongrel. So, to confirm this isn't the case, monitor your memory usage totals during the day, and install monit to e-mail you when it needs to restart. Monit will tell you it had to restart, then you can jump on and see what your memory usage log was reporting. I usually just run a little cron job that spits out the free command to a file once every 5 minutes or so. Also, look in the linux log files. IIRC the oom killer doesn't say anything, but check to see if they improved this "magic". From wyhaines at gmail.com Fri Nov 3 11:50:39 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 3 Nov 2006 09:50:39 -0700 Subject: [Mongrel] Problems with mongrel dying In-Reply-To: <20061102191305.b40f5443.zedshaw@zedshaw.com> References: <20061102191305.b40f5443.zedshaw@zedshaw.com> Message-ID: On 11/2/06, Zed A. Shaw wrote: > That's probably the best you can do until you can find out why it's leaking. My past > experience has been to never trust Ruby's GC or any external C extensions you may be > using. I've combed through Mongrel to insane levels to root out all possible leaks I can. > Yet, the Sync vs. Mutex bug and recent Array patch from Eric M. shows that Ruby's GC has > a long way to go. I'll 1/2 second Zed's comments here. I've spent a lot of time poking around in Ruby internals looking at memory usage. It is very easy for someone to write a C extension that mismanages memory and causes Ruby to leak, so always look suspiciously at an extension if you have a leak that you can't find another cause for, unless you know with great confidence that the extension is solid. The Ruby GC itself is pretty simple and does what it is supposed to. It will tend to have performance issues as the set of objects in RAM increases, though there are strategies a person can sometimes use to manage that, if needed. The Sync vs Mutex thing, though, can not be laid at the foot of the Ruby GC. The problem is with Array.c not releasing it's data in a way that allows the Ruby GC to handle it. Refer back to the beginning of this email about how easy it is to screw up memory management in C extensions.... Now, that said, if you are using arrays and are using push and shift operations to manage an array like a queue (or any libraries, like Mutex, that you are using do this), that _will_ bite you in the ass with memory usage, because of this Array bug. Mutex has much better performance than Sync, though, especially if there are more than a very small number of threads, so in this specific case I continue to use a Mutex, but have patched around the problemlematic Array usage by creating my own copy of the Mutex class that uses Array in a way that doesn't suffer from the bug. Kirk Haines Kirk Haines From ezmobius at gmail.com Fri Nov 3 13:03:37 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Fri, 3 Nov 2006 10:03:37 -0800 Subject: [Mongrel] Problems with mongrel dying In-Reply-To: References: <20061102191305.b40f5443.zedshaw@zedshaw.com> Message-ID: <5362D5D1-1C5A-4B83-99B3-7D0A105A21D5@brainspl.at> On Nov 3, 2006, at 8:50 AM, Kirk Haines wrote: > On 11/2/06, Zed A. Shaw wrote: > >> That's probably the best you can do until you can find out why >> it's leaking. My past >> experience has been to never trust Ruby's GC or any external C >> extensions you may be >> using. I've combed through Mongrel to insane levels to root out >> all possible leaks I can. >> Yet, the Sync vs. Mutex bug and recent Array patch from Eric M. >> shows that Ruby's GC has >> a long way to go. > > I'll 1/2 second Zed's comments here. I've spent a lot of time poking > around in Ruby internals looking at memory usage. It is very easy for > someone to write a C extension that mismanages memory and causes Ruby > to leak, so always look suspiciously at an extension if you have a > leak that you can't find another cause for, unless you know with great > confidence that the extension is solid. > > The Ruby GC itself is pretty simple and does what it is supposed to. > It will tend to have performance issues as the set of objects in RAM > increases, though there are strategies a person can sometimes use to > manage that, if needed. > > The Sync vs Mutex thing, though, can not be laid at the foot of the > Ruby GC. The problem is with Array.c not releasing it's data in a way > that allows the Ruby GC to handle it. Refer back to the beginning of > this email about how easy it is to screw up memory management in C > extensions.... > > Now, that said, if you are using arrays and are using push and shift > operations to manage an array like a queue (or any libraries, like > Mutex, that you are using do this), that _will_ bite you in the ass > with memory usage, because of this Array bug. > > Mutex has much better performance than Sync, though, especially if > there are more than a very small number of threads, so in this > specific case I continue to use a Mutex, but have patched around the > problemlematic Array usage by creating my own copy of the Mutex class > that uses Array in a way that doesn't suffer from the bug. > > > Kirk Haines Hey Kirk- Would you mind sharing your patched mutex.rb file? I woudl appreciate it. Thanks- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From jan.svitok at gmail.com Fri Nov 3 18:34:11 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Sat, 4 Nov 2006 00:34:11 +0100 Subject: [Mongrel] Problems with mongrel dying In-Reply-To: <5362D5D1-1C5A-4B83-99B3-7D0A105A21D5@brainspl.at> References: <20061102191305.b40f5443.zedshaw@zedshaw.com> <5362D5D1-1C5A-4B83-99B3-7D0A105A21D5@brainspl.at> Message-ID: <8d9b3d920611031534h63e4b85s26960946c6295859@mail.gmail.com> On 11/3/06, Ezra Zygmuntowicz wrote: > > On Nov 3, 2006, at 8:50 AM, Kirk Haines wrote: > > > On 11/2/06, Zed A. Shaw wrote: > > > >> That's probably the best you can do until you can find out why > >> it's leaking. My past > >> experience has been to never trust Ruby's GC or any external C > >> extensions you may be > >> using. I've combed through Mongrel to insane levels to root out > >> all possible leaks I can. > >> Yet, the Sync vs. Mutex bug and recent Array patch from Eric M. > >> shows that Ruby's GC has > >> a long way to go. > > > > I'll 1/2 second Zed's comments here. I've spent a lot of time poking > > around in Ruby internals looking at memory usage. It is very easy for > > someone to write a C extension that mismanages memory and causes Ruby > > to leak, so always look suspiciously at an extension if you have a > > leak that you can't find another cause for, unless you know with great > > confidence that the extension is solid. > > > > The Ruby GC itself is pretty simple and does what it is supposed to. > > It will tend to have performance issues as the set of objects in RAM > > increases, though there are strategies a person can sometimes use to > > manage that, if needed. > > > > The Sync vs Mutex thing, though, can not be laid at the foot of the > > Ruby GC. The problem is with Array.c not releasing it's data in a way > > that allows the Ruby GC to handle it. Refer back to the beginning of > > this email about how easy it is to screw up memory management in C > > extensions.... > > > > Now, that said, if you are using arrays and are using push and shift > > operations to manage an array like a queue (or any libraries, like > > Mutex, that you are using do this), that _will_ bite you in the ass > > with memory usage, because of this Array bug. > > > > Mutex has much better performance than Sync, though, especially if > > there are more than a very small number of threads, so in this > > specific case I continue to use a Mutex, but have patched around the > > problemlematic Array usage by creating my own copy of the Mutex class > > that uses Array in a way that doesn't suffer from the bug. > > > > > > Kirk Haines > > Hey Kirk- > > Would you mind sharing your patched mutex.rb file? I woudl > appreciate it. IIRC, the patch consist of replacing shift with pop, and push with unshift respectively thus reversing the queue direction. The idea is to avoid Array#shift as it retains the reference to the removed item. From luislavena at gmail.com Sat Nov 4 10:06:20 2006 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 4 Nov 2006 12:06:20 -0300 Subject: [Mongrel] works with webrick,lighty, not mongrel In-Reply-To: <2ef9bb620610310948t1b67f166y2a5e94dc62dac03b@mail.gmail.com> References: <2ef9bb620610310948t1b67f166y2a5e94dc62dac03b@mail.gmail.com> Message-ID: <71166b3b0611040706w73a151e6gf269b5fbed63f2ff@mail.gmail.com> On 10/31/06, Michael Fairchild wrote: > Hello, > I've been working away to setup mongrel as my production server, however I > am running into an odd problem and am not sure where to investigate for the > answer. > > When I run using mongrel_rails start most things work fine, but a I get a > few inexplicable undefined method errors, for example: > undefined method `send_qbxml' for # > The method is definitley there, and can be accessed from console. Further, > I tried running with webrick, and it worked as expected. I tried lightty > and it worked. > Thats because naming clashes... try put your Sync class implementation inside a module, that will clear the global namespace for the ruby standard Sync class. module MyApp class Sync ... end end In that way, both Sync will co exist friendly, and to call your Sync class you will need to do: MyApp::Sync instead of plain "Sync". > I am hoping to both get this working, and understand why such an error would > occur. Does anyone have any suggestions? > Hope that clears the image about the issue. > Thanks a lot, > > Michael Fairchild > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From andre.lewis at gmail.com Sat Nov 4 14:11:41 2006 From: andre.lewis at gmail.com (Andre Lewis) Date: Sat, 4 Nov 2006 11:11:41 -0800 Subject: [Mongrel] Three processes for each mongrel server? Message-ID: <3007ac150611041111w9fc8260ta34f834201a61944@mail.gmail.com> Hi everyone. Zed, thanks for Mongrel. I've been running mongrel on my WiFi cafe site (http://wifi.earthcode.com), and it's been great. It handled a front-page digg a few weeks ago without blinking. However, I'm setting up a staging environment right now, and I'm getting what looks like three mongrel processes *all listening on the same port* for each mongrel instance I start. Should I be seeing this? ps -ef | grep mongrel root 8971 1 6 13:37 ? 00:00:00 /usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l /var/www/apps/thoth/current/log/mongrel.log -P /var/www/apps/thoth/current/log/mongrel.8020.pid -c /var/www/apps/thoth/current root 8972 8971 0 13:37 ? 00:00:00 /usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l /var/www/apps/thoth/current/log/mongrel.log -P /var/www/apps/thoth/current/log/mongrel.8020.pid -c /var/www/apps/thoth/current root 8973 8972 0 13:37 ? 00:00:00 /usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l /var/www/apps/thoth/current/log/mongrel.log -P /var/www/apps/thoth/current/log/mongrel.8020.pid -c /var/www/apps/thoth/current root 8975 8919 0 13:37 pts/0 00:00:00 grep mongrel Background facts: - Overall setup: VPS at Rimu; custom compiled Apache 2.2 w/mod proxy -> mongrel cluster - distro: centos 4 - mongrel: 0.3.13.4 - ruby: 1.8.4 Here's a console session showing the three processes. Here I'm starting a single instance, but the same thing happens when I start a cluster (I get 3x process for each mongrel server). ------------------------------------------------------------- root$/var/www/apps/thoth/current/log >ps -ef | grep mongrel root 8968 8919 0 13:36 pts/0 00:00:00 grep mongrel root$/var/www/apps/thoth/current/log >/usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l /var/www/apps/thoth/current/log/mongrel.log -P /var/www/apps/thoth/current/log/mongrel.8020.pid -c /var/www/apps/thoth/current root$/var/www/apps/thoth/current/log >ps -ef | grep mongrel root 8971 1 6 13:37 ? 00:00:00 /usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l /var/www/apps/thoth/current/log/mongrel.log -P /var/www/apps/thoth/current/log/mongrel.8020.pid -c /var/www/apps/thoth/current root 8972 8971 0 13:37 ? 00:00:00 /usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l /var/www/apps/thoth/current/log/mongrel.log -P /var/www/apps/thoth/current/log/mongrel.8020.pid -c /var/www/apps/thoth/current root 8973 8972 0 13:37 ? 00:00:00 /usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l /var/www/apps/thoth/current/log/mongrel.log -P /var/www/apps/thoth/current/log/mongrel.8020.pid -c /var/www/apps/thoth/current root 8975 8919 0 13:37 pts/0 00:00:00 grep mongrel root$/var/www/apps/thoth/current/log >ls total 48 drwxrwxrwx 2 deploy deploy 4096 Nov 4 13:37 . drwxr-xr-x 6 deploy deploy 4096 Nov 3 20:06 .. -rw-rw-rw- 1 root root 4 Nov 4 13:37 mongrel.8020.pid -rw-rw-rw- 1 root root 590 Nov 4 13:37 mongrel.log -rw-r--r-- 1 root root 31632 Nov 3 21:20 production.log root$/var/www/apps/thoth/current/log >cat mongrel.log ** Daemonized, any open files are closed. Look at /var/www/apps/thoth/current/log/mongrel.8020.pid and /var/www/apps/thoth/current/log/mongrel.log for info. ** Starting Mongrel listening at 127.0.0.1:8020 ** 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 available at 127.0.0.1:8020 ** Writing PID file to /var/www/apps/thoth/current/log/mongrel.8020.pid root$/var/www/apps/thoth/current/log > -- andre.lewis at gmail.com My tech blog: http://earthcode.com Wifi cafes: http://wifi.earthcode.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061104/dfd53e6c/attachment-0001.html From jgeiger at gmail.com Sat Nov 4 20:06:51 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Sat, 4 Nov 2006 19:06:51 -0600 Subject: [Mongrel] logrotate, mongrel cluster and monit Message-ID: <466af3440611041706t5df13462p790cb9bdbdab2241@mail.gmail.com> While I could figure this out, I'm asking here first to see if anyone has already dealt with/created this. I'm running a mongrel cluster, running 4 mongrels on ports 8001-4. I'm using capistrano to deploy. And I'd like to use monit to check to make sure everything is running nice. I'd like to have monit restart only single mongrels if they fail, and also have monit restart the mongrels after logrotate does it's thing. Any quick suggestions/examples on a script for monit/logrotate? Thanks BTW I'm using the following cluster config: --- prefix: /myAPP cwd: /web/servers/rails/current port: "8001" address: 127.0.0.1 pid_file: log/mongrel.pid servers: 4 From robert at kitchendemocracy.org Sat Nov 4 21:57:02 2006 From: robert at kitchendemocracy.org (Robert Vogel) Date: Sat, 04 Nov 2006 19:57:02 -0700 Subject: [Mongrel] logrotate, mongrel cluster and monit Message-ID: <20061104195702.c41e0b8117d7637a8f09ddbc78878a27.d8d7ccdf19.wbe@email.secureserver.net> Hello Joey - Here are my two entries from monitrc which restarts single mongrels if they fail. I am running two mongrels: check process mongrel8000 with pidfile /var/www/apps/kd/current/log/mongrel.8000.pid start program = "/usr/bin/mongrel_rails start -d -e production -p 8000 -a 127.0.0.1 -c /var/www/apps/kd/current -P /var/www/apps/kd/current/log/mongrel.8000.pid" stop program = "/usr/bin/mongrel_rails stop -P /var/www/apps/kd/current/log/mongrel.8000.pid" check process mongrel8001 with pidfile /var/www/apps/kd/current/log/mongrel.8001.pid start program = "/usr/bin/mongrel_rails start -d -e production -p 8001 -a 127.0.0.1 -c /var/www/apps/kd/current -P /var/www/apps/kd/current/log/mongrel.8001.pid" stop program = "/usr/bin/mongrel_rails stop -P /var/www/apps/kd/current/log/mongrel.8001.pid" Cheers Robert > -------- Original Message -------- > Subject: [Mongrel] logrotate, mongrel cluster and monit > From: "Joey Geiger" > Date: Sat, November 04, 2006 5:06 pm > To: mongrel-users at rubyforge.org > > While I could figure this out, I'm asking here first to see if anyone > has already dealt with/created this. I'm running a mongrel cluster, > running 4 mongrels on ports 8001-4. I'm using capistrano to deploy. > And I'd like to use monit to check to make sure everything is running > nice. > > I'd like to have monit restart only single mongrels if they fail, and > also have monit restart the mongrels after logrotate does it's thing. > Any quick suggestions/examples on a script for monit/logrotate? > > Thanks > > BTW I'm using the following cluster config: > --- > prefix: /myAPP > cwd: /web/servers/rails/current > port: "8001" > address: 127.0.0.1 > pid_file: log/mongrel.pid > servers: 4 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From wilsonb at gmail.com Sat Nov 4 22:21:48 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Sat, 4 Nov 2006 22:21:48 -0500 Subject: [Mongrel] Three processes for each mongrel server? In-Reply-To: <3007ac150611041111w9fc8260ta34f834201a61944@mail.gmail.com> References: <3007ac150611041111w9fc8260ta34f834201a61944@mail.gmail.com> Message-ID: On 11/4/06, Andre Lewis wrote: > Hi everyone. Zed, thanks for Mongrel. I've been running mongrel on my WiFi > cafe site (http://wifi.earthcode.com), and it's been great. It handled a > front-page digg a few weeks ago without blinking. > > However, I'm setting up a staging environment right now, and I'm getting > what looks like three mongrel processes *all listening on the same port* for > each mongrel instance I start. Should I be seeing this? > > ps -ef | grep mongrel > root 8971 1 6 13:37 ? 00:00:00 /usr/local/bin/ruby > /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l > /var/www/apps/thoth/current/log/mongrel.log -P > /var/www/apps/thoth/current/log/mongrel.8020.pid -c > /var/www/apps/thoth/current > root 8972 8971 0 13:37 ? 00:00:00 /usr/local/bin/ruby > /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l > /var/www/apps/thoth/current/log/mongrel.log -P > /var/www/apps/thoth/current/log/mongrel.8020.pid -c > /var/www/apps/thoth/current > root 8973 8972 0 13:37 ? 00:00:00 /usr/local/bin/ruby > /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l > /var/www/apps/thoth/current/log/mongrel.log -P > /var/www/apps/thoth/current/log/mongrel.8020.pid -c > /var/www/apps/thoth/current > root 8975 8919 0 13:37 pts/0 00:00:00 grep mongrel > > Background facts: > - Overall setup: VPS at Rimu; custom compiled Apache 2.2 w/mod proxy -> > mongrel cluster > - distro: centos 4 > - mongrel: 0.3.13.4 > - ruby: 1.8.4 > > Here's a console session showing the three processes. Here I'm starting a > single instance, but the same thing happens when I start a cluster (I get 3x > process for each mongrel server). > ------------------------------------------------------------- > root$/var/www/apps/thoth/current/log >ps -ef | grep mongrel > root 8968 8919 0 13:36 pts/0 00:00:00 grep mongrel > root$/var/www/apps/thoth/current/log > >/usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l > /var/www/apps/thoth/current/log/mongrel.log -P > /var/www/apps/thoth/current/log/mongrel.8020.pid -c > /var/www/apps/thoth/current > root$/var/www/apps/thoth/current/log >ps -ef | grep mongrel > root 8971 1 6 13:37 ? 00:00:00 /usr/local/bin/ruby > /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l > /var/www/apps/thoth/current/log/mongrel.log -P > /var/www/apps/thoth/current/log/mongrel.8020.pid -c > /var/www/apps/thoth/current > root 8972 8971 0 13:37 ? 00:00:00 /usr/local/bin/ruby > /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l > /var/www/apps/thoth/current/log/mongrel.log -P > /var/www/apps/thoth/current/log/mongrel.8020.pid -c > /var/www/apps/thoth/current > root 8973 8972 0 13:37 ? 00:00:00 /usr/local/bin/ruby > /usr/local/bin/mongrel_rails start -d -e production -p 8020 -a 127.0.0.1 -l > /var/www/apps/thoth/current/log/mongrel.log -P > /var/www/apps/thoth/current/log/mongrel.8020.pid -c > /var/www/apps/thoth/current > root 8975 8919 0 13:37 pts/0 00:00:00 grep mongrel > root$/var/www/apps/thoth/current/log >ls > total 48 > drwxrwxrwx 2 deploy deploy 4096 Nov 4 13:37 . > drwxr-xr-x 6 deploy deploy 4096 Nov 3 20:06 .. > -rw-rw-rw- 1 root root 4 Nov 4 13:37 mongrel.8020.pid > -rw-rw-rw- 1 root root 590 Nov 4 13:37 mongrel.log > -rw-r--r-- 1 root root 31632 Nov 3 21:20 production.log > root$/var/www/apps/thoth/current/log >cat mongrel.log > ** Daemonized, any open files are closed. Look at > /var/www/apps/thoth/current/log/mongrel.8020.pid and > /var/www/apps/thoth/current/log/mongrel.log for info. > ** Starting Mongrel listening at 127.0.0.1:8020 > ** 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 available at 127.0.0.1:8020 > ** Writing PID file to > /var/www/apps/thoth/current/log/mongrel.8020.pid > root$/var/www/apps/thoth/current/log > > > This is just the wacky, wacky way that Linux displays processes that have multiple threads. I bothered Zed with this for a couple of weeks earlier in the year. Eventually I learned to stop worrying, and love the bomb. From g.vishnu at gmail.com Sun Nov 5 09:42:34 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Sun, 5 Nov 2006 20:12:34 +0530 Subject: [Mongrel] logrotate, mongrel cluster and monit In-Reply-To: <20061104195702.c41e0b8117d7637a8f09ddbc78878a27.d8d7ccdf19.wbe@email.secureserver.net> References: <20061104195702.c41e0b8117d7637a8f09ddbc78878a27.d8d7ccdf19.wbe@email.secureserver.net> Message-ID: Since monit plays around with the system path, if you have your ruby in /usr/local/bin, you might want to run mongrel explicitly with ruby. Search this list, I've posted a config before. Later, Vish On 11/5/06, Robert Vogel wrote: > Hello Joey - > > Here are my two entries from monitrc which restarts single mongrels if > they fail. I am running two mongrels: > > check process mongrel8000 with pidfile > /var/www/apps/kd/current/log/mongrel.8000.pid > start program = "/usr/bin/mongrel_rails start -d -e production -p 8000 > -a 127.0.0.1 -c /var/www/apps/kd/current -P > /var/www/apps/kd/current/log/mongrel.8000.pid" > stop program = "/usr/bin/mongrel_rails stop -P > /var/www/apps/kd/current/log/mongrel.8000.pid" > > check process mongrel8001 with pidfile > /var/www/apps/kd/current/log/mongrel.8001.pid > start program = "/usr/bin/mongrel_rails start -d -e production -p 8001 > -a 127.0.0.1 -c /var/www/apps/kd/current -P > /var/www/apps/kd/current/log/mongrel.8001.pid" > stop program = "/usr/bin/mongrel_rails stop -P > /var/www/apps/kd/current/log/mongrel.8001.pid" > > > Cheers > Robert > > > -------- Original Message -------- > > Subject: [Mongrel] logrotate, mongrel cluster and monit > > From: "Joey Geiger" > > Date: Sat, November 04, 2006 5:06 pm > > To: mongrel-users at rubyforge.org > > > > While I could figure this out, I'm asking here first to see if anyone > > has already dealt with/created this. I'm running a mongrel cluster, > > running 4 mongrels on ports 8001-4. I'm using capistrano to deploy. > > And I'd like to use monit to check to make sure everything is running > > nice. > > > > I'd like to have monit restart only single mongrels if they fail, and > > also have monit restart the mongrels after logrotate does it's thing. > > Any quick suggestions/examples on a script for monit/logrotate? > > > > Thanks > > > > BTW I'm using the following cluster config: > > --- > > prefix: /myAPP > > cwd: /web/servers/rails/current > > port: "8001" > > address: 127.0.0.1 > > pid_file: log/mongrel.pid > > servers: 4 > > _______________________________________________ > > 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 hughes.james at gmail.com Sun Nov 5 15:43:40 2006 From: hughes.james at gmail.com (James Hughes) Date: Sun, 5 Nov 2006 12:43:40 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> Message-ID: <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> On 10/26/06, Joey Geiger wrote: > I bought it, printed out a few chapters to read over. Ok, *how* did you buy it? The oreilly rough cuts page sez: "If you're not a Safari Subscriber, go to the book's page on oreilly.com and click on the purchase link." I've searched the page up and down, but can find no 'purchase' link. I want the pdf, but I don't want to have to get a full safari subscription. I just want to pay the $14.99 and be on my way. Any hints? James From ezmobius at gmail.com Sun Nov 5 16:29:00 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Sun, 5 Nov 2006 13:29:00 -0800 Subject: [Mongrel] Testing custom mongrel handlers? Message-ID: Hey Folks- I'm trying to setup a new test/spec harness for testing Merb. I was wondering if there is a way to mock the Mongrel request, response objects easily to test my handler without actually running a server? I can easily do the env hash but I'm not entirely sure what needs to go in the request StringIO object that gets passed into my mongrel handler's #process method. Is there a good way to do this? Or should I just fire up a server and use net/http to test it? Thanks- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From zedshaw at zedshaw.com Sun Nov 5 19:33:45 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 5 Nov 2006 16:33:45 -0800 Subject: [Mongrel] Testing custom mongrel handlers? In-Reply-To: References: Message-ID: <20061105163345.ba1410f2.zedshaw@zedshaw.com> On Sun, 5 Nov 2006 13:29:00 -0800 Ezra Zygmuntowicz wrote: > Hey Folks- > > I'm trying to setup a new test/spec harness for testing Merb. I was > wondering if there is a way to mock the Mongrel request, response > objects easily to test my handler without actually running a server? > I can easily do the env hash but I'm not entirely sure what needs to > go in the request StringIO object that gets passed into my mongrel > handler's #process method. Is there a good way to do this? Or should > I just fire up a server and use net/http to test it? It's pretty easy until you get to the StringIO. Basically, you put whatever encoded data would go into the body of the request. So, multipart mime, form posts, etc. You *might* be able to steal some of that from say RFuzz and then do an internal mock kind of thing. Normally though, I just use rfuzz to write an external testing setup and skip the mock stuff completely. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://safari.oreilly.com/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Sun Nov 5 19:35:29 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 5 Nov 2006 16:35:29 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> Message-ID: <20061105163529.673e4118.zedshaw@zedshaw.com> On Sun, 5 Nov 2006 12:43:40 -0800 "James Hughes" wrote: > On 10/26/06, Joey Geiger wrote: > > I bought it, printed out a few chapters to read over. > > Ok, *how* did you buy it? The oreilly rough cuts page sez: > > "If you're not a Safari Subscriber, go to the book's page on > oreilly.com and click on the purchase link." > > I've searched the page up and down, but can find no 'purchase' link. > http://safari.oreilly.com/0321483502 You should be able to get it there without any problems. Let me know if you do have some and I'll talk to people. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From wayneeseguin at gmail.com Sun Nov 5 22:09:27 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Sun, 5 Nov 2006 22:09:27 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061105163529.673e4118.zedshaw@zedshaw.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> Message-ID: <4DA6F254-AB85-46B2-B5D3-D51B3525E558@gmail.com> Zed, Just so you know I also experienced some confusion with the way the purchasing was setup. Clicking on the buy now button is deceiving because it takes you to an entirely different context/site (apparently at the least). It didn't make it clear that I was purchasing a PDF and not a hard copy, so I restarted the checkout process a few times. (Having 3 copies in my cart was amusing though ;)) ~Wayne On Nov 05, 2006, at 19:35 , Zed A. Shaw wrote: > On Sun, 5 Nov 2006 12:43:40 -0800 > "James Hughes" wrote: > >> On 10/26/06, Joey Geiger wrote: >>> I bought it, printed out a few chapters to read over. >> >> Ok, *how* did you buy it? The oreilly rough cuts page sez: >> >> "If you're not a Safari Subscriber, go to the book's page on >> oreilly.com and click on the purchase link." >> >> I've searched the page up and down, but can find no 'purchase' link. >> > > http://safari.oreilly.com/0321483502 > > You should be able to get it there without any problems. Let me > know if you do have some and I'll talk to people. > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From hughes.james at gmail.com Sun Nov 5 22:47:44 2006 From: hughes.james at gmail.com (James Hughes) Date: Sun, 5 Nov 2006 19:47:44 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061105163529.673e4118.zedshaw@zedshaw.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> Message-ID: <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> On 11/5/06, Zed A. Shaw wrote: > On Sun, 5 Nov 2006 12:43:40 -0800 > "James Hughes" wrote: > > > On 10/26/06, Joey Geiger wrote: > > > I bought it, printed out a few chapters to read over. > > > > Ok, *how* did you buy it? The oreilly rough cuts page sez: > > > > "If you're not a Safari Subscriber, go to the book's page on > > oreilly.com and click on the purchase link." > > > > I've searched the page up and down, but can find no 'purchase' link. > > > > http://safari.oreilly.com/0321483502 > That's where I've been going, but I see no option there to purchase the PDF for $14.95 as mentioned in your original message. There is a link to download the PDF, but you have to purchase a full Safari membership to do it. I don't want a full Safari membership; I just want to buy a PDF of your book. Are you sure this is possible? James From zedshaw at zedshaw.com Mon Nov 6 00:42:14 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 5 Nov 2006 21:42:14 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> Message-ID: <20061105214214.099f5d07.zedshaw@zedshaw.com> On Sun, 5 Nov 2006 19:47:44 -0800 "James Hughes" wrote: > > > > http://safari.oreilly.com/0321483502 > > > > That's where I've been going, but I see no option there to purchase > the PDF for $14.95 as mentioned in your original message. There is a > link to download the PDF, but you have to purchase a full Safari > membership to do it. I don't want a full Safari membership; I just > want to buy a PDF of your book. > > Are you sure this is possible? You know, this is kind of messed up. Yeah, I went through it when we announced it. Here's all the other links I know of to buy it at: http://www.awprofessional.com/bookstore/product.asp?isbn=0321483502&rl=1 http://www.informit.com/bookstore/product.asp?isbn=9780321483508&rl=1 And I'll talk to the powers that be since that's totally wrong people can't just buy the book outside of safari. Am I crazy that they used to be able to do this? -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://safari.oreilly.com/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From andre.lewis at gmail.com Mon Nov 6 01:43:45 2006 From: andre.lewis at gmail.com (Andre Lewis) Date: Sun, 5 Nov 2006 22:43:45 -0800 Subject: [Mongrel] Three processes for each mongrel server? In-Reply-To: References: <3007ac150611041111w9fc8260ta34f834201a61944@mail.gmail.com> Message-ID: <3007ac150611052243y5687fe8an5959b2a61d64dfe4@mail.gmail.com> Interesting thing though is that my other two servers (one Centos4 and one Ubuntu 6) show me only one process per mongrel instance. Is it indicative of a differing mongrel configuration between my boxes? Andre > This is just the wacky, wacky way that Linux displays processes that > have multiple threads. > I bothered Zed with this for a couple of weeks earlier in the year. > Eventually I learned to stop worrying, and love the bomb. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061105/58060586/attachment.html From philippe.lachaise at gmail.com Mon Nov 6 02:58:27 2006 From: philippe.lachaise at gmail.com (philippe lachaise) Date: Mon, 6 Nov 2006 08:58:27 +0100 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> Message-ID: I had the same sort of experience. I gave up when the Safari hassle-full registration form complained about my phone number being wrong. Much of a pity because I would looooove to buy your book ! Regards, Philippe. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061106/1c40e6ee/attachment.html From g.vishnu at gmail.com Mon Nov 6 05:21:14 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Mon, 6 Nov 2006 15:51:14 +0530 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> Message-ID: You could read it on Safari. I have a Safari subscription, and although the reading interface is clumsy, it's probably the cheapest way to read good books. Lots of em. Vish On 11/6/06, philippe lachaise wrote: > I had the same sort of experience. > > I gave up when the Safari hassle-full registration form complained about my > phone number being wrong. > > Much of a pity because I would looooove to buy your book ! > > Regards, > > Philippe. > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From justinjohnson at gmail.com Mon Nov 6 09:30:44 2006 From: justinjohnson at gmail.com (Justin Johnson) Date: Mon, 6 Nov 2006 08:30:44 -0600 Subject: [Mongrel] Errno::EBADF (Bad file descriptor) Message-ID: <94a776e70611060630h53a38f14vda1db2b3b8c1b6b2@mail.gmail.com> I posted this to the discussion forum on rubyforge.org, but it appears that it would have been better to post here. Does anyone have any advice on how to resolve the problem reported at http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145? Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061106/ee028807/attachment.html From jgeiger at gmail.com Mon Nov 6 09:34:07 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Mon, 6 Nov 2006 08:34:07 -0600 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> Message-ID: <466af3440611060634j335709bdpf75d949584bb6117@mail.gmail.com> I bought it without doing the whole safari thing. I just got a PDF to download. Can't tell you the process I went through, but I don't remember it being that complicated. On 11/6/06, Vishnu Gopal wrote: > You could read it on Safari. I have a Safari subscription, and > although the reading interface is clumsy, it's probably the cheapest > way to read good books. Lots of em. > > Vish > > On 11/6/06, philippe lachaise wrote: > > I had the same sort of experience. > > > > I gave up when the Safari hassle-full registration form complained about my > > phone number being wrong. > > > > Much of a pity because I would looooove to buy your book ! > > > > Regards, > > > > Philippe. > > > > _______________________________________________ > > 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 jeremy at hinegardner.org Mon Nov 6 11:44:40 2006 From: jeremy at hinegardner.org (Jeremy Hinegardner) Date: Mon, 6 Nov 2006 09:44:40 -0700 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061105214214.099f5d07.zedshaw@zedshaw.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> <20061105214214.099f5d07.zedshaw@zedshaw.com> Message-ID: <20061106164440.GH20926@hinegardner.org> On Sun, Nov 05, 2006 at 09:42:14PM -0800, Zed A. Shaw wrote: > http://www.awprofessional.com/bookstore/product.asp?isbn=0321483502&rl=1 This is the link I used to purchase it. Nice big "add to cart" button, then "Proceed to Checkout"... do all the normal fill out form stuff for delivery, then on the last page after you purchase it there should be a link to download your pdf. Depending on your Safari membership you should be able to download chapters for offline reading. But in general, safari is not a download and read service, its a read-online service. enjoy, -jeremy -- ======================================================================== Jeremy Hinegardner jeremy at hinegardner.org From wilsonb at gmail.com Mon Nov 6 12:20:36 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Mon, 6 Nov 2006 12:20:36 -0500 Subject: [Mongrel] Three processes for each mongrel server? In-Reply-To: <3007ac150611052243y5687fe8an5959b2a61d64dfe4@mail.gmail.com> References: <3007ac150611041111w9fc8260ta34f834201a61944@mail.gmail.com> <3007ac150611052243y5687fe8an5959b2a61d64dfe4@mail.gmail.com> Message-ID: It seems to have something subtle to do with the Linux config/distro. I see three processes on a Debian box of mine running 2.6.16, but only one per instance on a Centos box running the same version. On 11/6/06, Andre Lewis wrote: > Interesting thing though is that my other two servers (one Centos4 and one > Ubuntu 6) show me only one process per mongrel instance. Is it indicative of > a differing mongrel configuration between my boxes? > > Andre > > > > > > > > This is just the wacky, wacky way that Linux displays processes that > > have multiple threads. > > I bothered Zed with this for a couple of weeks earlier in the year. > > Eventually I learned to stop worrying, and love the bomb. > > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From hughes.james at gmail.com Mon Nov 6 13:20:06 2006 From: hughes.james at gmail.com (James Hughes) Date: Mon, 6 Nov 2006 10:20:06 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <4DA6F254-AB85-46B2-B5D3-D51B3525E558@gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <4DA6F254-AB85-46B2-B5D3-D51B3525E558@gmail.com> Message-ID: <765a2c230611061020k5af34635r7649856ecfca8ef4@mail.gmail.com> On 11/5/06, Wayne E. Seguin wrote: > Zed, > > Just so you know I also experienced some confusion with the way the > purchasing was setup. > Clicking on the buy now button is deceiving because it takes you to "Buy now"? I see no "buy now". At least not on the page linked to by Zed. Am I crazy, or what? jh From hughes.james at gmail.com Mon Nov 6 13:21:31 2006 From: hughes.james at gmail.com (James Hughes) Date: Mon, 6 Nov 2006 10:21:31 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> Message-ID: <765a2c230611061021ua735059vbbff1118085b2330@mail.gmail.com> On 11/6/06, Vishnu Gopal wrote: > You could read it on Safari. I have a Safari subscription, and > although the reading interface is clumsy, it's probably the cheapest > way to read good books. Lots of em. Yes, last resort I'll read the html version. But I'm going on a trip and thought it might be nice to read the pdf offline. thanks, James From hughes.james at gmail.com Mon Nov 6 13:28:32 2006 From: hughes.james at gmail.com (James Hughes) Date: Mon, 6 Nov 2006 10:28:32 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061105214214.099f5d07.zedshaw@zedshaw.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> <20061105214214.099f5d07.zedshaw@zedshaw.com> Message-ID: <765a2c230611061028iffd17e4pfc966fc07e3ad23b@mail.gmail.com> On 11/5/06, Zed A. Shaw wrote: > On Sun, 5 Nov 2006 19:47:44 -0800 > "James Hughes" wrote: > > > > > > > > http://safari.oreilly.com/0321483502 > > > > > > > That's where I've been going, but I see no option there to purchase > > the PDF for $14.95 as mentioned in your original message. There is a > > link to download the PDF, but you have to purchase a full Safari > > membership to do it. I don't want a full Safari membership; I just > > want to buy a PDF of your book. > > > > Are you sure this is possible? > > You know, this is kind of messed up. Yeah, I went through it when we announced it. > > Here's all the other links I know of to buy it at: > > http://www.awprofessional.com/bookstore/product.asp?isbn=0321483502&rl=1 > Ok, this one worked, I have the PDF now. Seems like O'Reilly is missing out on a lot of revenue by not letting people just purchase ebooks outright like this. Thanks for tracking down the links, Zed. Looking forward to reading the book. James From matt at eastmedia.com Mon Nov 6 13:48:12 2006 From: matt at eastmedia.com (Matt Pelletier) Date: Mon, 6 Nov 2006 13:48:12 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <466af3440611060634j335709bdpf75d949584bb6117@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> <466af3440611060634j335709bdpf75d949584bb6117@mail.gmail.com> Message-ID: Hi guys, Just to chime in here, I have brought up these issues with the publisher and they are definitely listening. I don't know how fast we can change the problem, but we're working on it. For now I think we might want to advertise a different URL (like the informit or awprofessional ones). Even though they all ultimately bring you to the same shopping cart, the Safari one might add a different requirement (like subscribing) along the way. Just be aware that we are familiar with these issues. Has anyone else had these kinds of problems that could describe them in detail so we can forward them to the publisher? You can email me privately if you prefer. Thanks to everyone who has (or wants to) buy the book. Matt On Nov 6, 2006, at 9:34 AM, Joey Geiger wrote: > I bought it without doing the whole safari thing. I just got a PDF > to download. > > Can't tell you the process I went through, but I don't remember it > being that complicated. > > On 11/6/06, Vishnu Gopal wrote: >> You could read it on Safari. I have a Safari subscription, and >> although the reading interface is clumsy, it's probably the cheapest >> way to read good books. Lots of em. >> >> Vish >> >> On 11/6/06, philippe lachaise wrote: >>> I had the same sort of experience. >>> >>> I gave up when the Safari hassle-full registration form >>> complained about my >>> phone number being wrong. >>> >>> Much of a pity because I would looooove to buy your book ! >>> >>> Regards, >>> >>> Philippe. >>> >>> _______________________________________________ >>> 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 ------------------ Matt Pelletier http://www.eastmedia.com -- EastMedia http://safari.oreilly.com/0321483502 -- The Mongrel Book http://identity.eastmedia.com -- OpenID, Identity 2.0 From matt at eastmedia.com Mon Nov 6 14:06:59 2006 From: matt at eastmedia.com (Matt Pelletier) Date: Mon, 6 Nov 2006 14:06:59 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061106164440.GH20926@hinegardner.org> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> <20061105214214.099f5d07.zedshaw@zedshaw.com> <20061106164440.GH20926@hinegardner.org> Message-ID: To be clear, these two links will lead to the non-Safari purchase pages, where you can download the PDF directly and don' t need to fuss with Safari subscription. The link below (that Jeremy used successfully) is the same thing. http://www.informit.com/title/0321483502 http://www.awprofessional.com/title/0321483502 Thanks, Matt ------------------ Matt Pelletier http://www.eastmedia.com -- EastMedia http://www.informit.com/title/0321483502 -- The Mongrel Book http://identity.eastmedia.com -- OpenID, Identity 2.0 On Nov 6, 2006, at 11:44 AM, Jeremy Hinegardner wrote: > On Sun, Nov 05, 2006 at 09:42:14PM -0800, Zed A. Shaw wrote: >> http://www.awprofessional.com/bookstore/product.asp? >> isbn=0321483502&rl=1 > > This is the link I used to purchase it. Nice big "add to cart" > button, > then "Proceed to Checkout"... do all the normal fill out form stuff > for > delivery, then on the last page after you purchase it there should > be a > link to download your pdf. > > Depending on your Safari membership you should be able to download > chapters for offline reading. But in general, safari is not a > download > and read service, its a read-online service. > > enjoy, > > -jeremy > > -- > ====================================================================== > == > Jeremy Hinegardner > jeremy at hinegardner.org > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From jan.svitok at gmail.com Mon Nov 6 14:44:52 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Mon, 6 Nov 2006 20:44:52 +0100 Subject: [Mongrel] Errno::EBADF (Bad file descriptor) In-Reply-To: <94a776e70611060630h53a38f14vda1db2b3b8c1b6b2@mail.gmail.com> References: <94a776e70611060630h53a38f14vda1db2b3b8c1b6b2@mail.gmail.com> Message-ID: <8d9b3d920611061144n410a20e5n4e90a1b018bb3ebe@mail.gmail.com> On 11/6/06, Justin Johnson wrote: > Does anyone have any advice on how to resolve the problem reported at > http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145 You are running a service that does not have STDIN, STDOUT nor STDERR, therefore you cannot write to them. If you want to debug, I suggest opening a file (local file, service doesn't 'see' substs or network drives) and writing to that. Maybe Logger or Log4r would be useful. Another possibility is to use OutputDebugString and DbgView[1], but I'm not sure if service is allowed to call it. require 'Win32API' module Windows module Debug OutputDebugString = Win32API.new('kernel32', 'OutputDebugStringA', 'P', 'V') def OutputDebugString(message) OutputDebugString.call(message) end end end [1] http://www.sysinternals.com/Utilities/DebugView.html From jan.svitok at gmail.com Mon Nov 6 14:57:50 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Mon, 6 Nov 2006 20:57:50 +0100 Subject: [Mongrel] Errno::EBADF (Bad file descriptor) In-Reply-To: <8d9b3d920611061144n410a20e5n4e90a1b018bb3ebe@mail.gmail.com> References: <94a776e70611060630h53a38f14vda1db2b3b8c1b6b2@mail.gmail.com> <8d9b3d920611061144n410a20e5n4e90a1b018bb3ebe@mail.gmail.com> Message-ID: <8d9b3d920611061157i42778164sdc6abac3168d2cc7@mail.gmail.com> On 11/6/06, Jan Svitok wrote: > On 11/6/06, Justin Johnson wrote: > > Does anyone have any advice on how to resolve the problem reported at > > http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145 > > You are running a service that does not have STDIN, STDOUT nor STDERR, > therefore you cannot write to them. If you want to debug, I suggest > opening a file (local file, service doesn't 'see' substs or network > drives) and writing to that. Maybe Logger or Log4r would be useful. > > Another possibility is to use OutputDebugString and DbgView[1], but > I'm not sure if service is allowed to call it. > > require 'Win32API' > > module Windows > module Debug > OutputDebugString = Win32API.new('kernel32', > 'OutputDebugStringA', 'P', 'V') > def OutputDebugString(message) > OutputDebugString.call(message) > end > end > end > > [1] http://www.sysinternals.com/Utilities/DebugView.html Yeah, and while we are at it, few more hints: - check Rails' debugging facilities, AWDWR sections 13.6 and 13.7. Basically you can do logger.warn "message", logger.info "message", logger.error "message", logger.fatal "message" anywhere in your rails code. The "message" will go into respective log (development.log,...) - see also http://api.rubyonrails.com/classes/ActionView/Helpers/DebugHelper.html - run your code without service - look around rubyonrails.com for more debugging possibilities From philippe.lachaise at gmail.com Mon Nov 6 15:26:38 2006 From: philippe.lachaise at gmail.com (philippe lachaise) Date: Mon, 6 Nov 2006 21:26:38 +0100 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <765a2c230611051947u7b12833cw389d44db7695bd31@mail.gmail.com> <466af3440611060634j335709bdpf75d949584bb6117@mail.gmail.com> Message-ID: Good to know someone's been listening :) I must admit that having to fill in all this forms about my billing and shipping address while all I wanted was to download a PDF was overtaxing my patience. Publishers must realize they can make unreasonable money with technical publication about software like Mongrel but they must handle it right. Developers are willing to pay (To pay ! Yes ! remember they are used to downloading for free !) for information. They feel good about giving money for real value. They crave for it, they would kill for it, they would give up coffee for it , they would... But for God sake don't ask them to fill in forms ! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061106/c907c9bd/attachment.html From luislavena at gmail.com Mon Nov 6 16:08:16 2006 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 6 Nov 2006 18:08:16 -0300 Subject: [Mongrel] Errno::EBADF (Bad file descriptor) In-Reply-To: <94a776e70611060630h53a38f14vda1db2b3b8c1b6b2@mail.gmail.com> References: <94a776e70611060630h53a38f14vda1db2b3b8c1b6b2@mail.gmail.com> Message-ID: <71166b3b0611061308jb7fe493xa24213265d33df6a@mail.gmail.com> On 11/6/06, Justin Johnson wrote: > I posted this to the discussion forum on rubyforge.org, but it appears that > it would have been better to post here. > As said by Jano Svitok, its mostly related to puts nature. Also, is not safe, on any webapp, use puts directly!!! Zed will agree (and he could get mad about this abuse of mongrel) ;-) Guess you should check WHY your rails application is eating your tags instead of hacking... I mean, "solving" your problem using puts, nothing good you will get from that. if you want debug information, try using logger or STDERR.puts which is redirected to service.log. > Does anyone have any advice on how to resolve the problem reported at > http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145 > ? > > Thanks, > Justin > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From matt at eastmedia.com Mon Nov 6 18:23:04 2006 From: matt at eastmedia.com (Matt Pelletier) Date: Mon, 6 Nov 2006 18:23:04 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <765a2c230611061020k5af34635r7649856ecfca8ef4@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <4DA6F254-AB85-46B2-B5D3-D51B3525E558@gmail.com> <765a2c230611061020k5af34635r7649856ecfca8ef4@mail.gmail.com> Message-ID: <0E9924F1-6698-49BB-A96F-F32C09DD74CD@eastmedia.com> On Nov 6, 2006, at 1:20 PM, James Hughes wrote: > On 11/5/06, Wayne E. Seguin wrote: >> Zed, >> >> Just so you know I also experienced some confusion with the way the >> purchasing was setup. >> Clicking on the buy now button is deceiving because it takes you to > > "Buy now"? I see no "buy now". At least not on the page linked to by > Zed. Am I crazy, or what? "Add to Cart" btw, my posts to the list were delayed by an hour or so and came in out of order... but I think they're easy to understand. > jh > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users ------------------ Matt Pelletier http://www.eastmedia.com -- EastMedia http://www.informit.com/title/0321483502 -- The Mongrel Book http://identity.eastmedia.com -- OpenID, Identity 2.0 From hughes.james at gmail.com Mon Nov 6 22:42:14 2006 From: hughes.james at gmail.com (James Hughes) Date: Mon, 6 Nov 2006 19:42:14 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <0E9924F1-6698-49BB-A96F-F32C09DD74CD@eastmedia.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <20061105163529.673e4118.zedshaw@zedshaw.com> <4DA6F254-AB85-46B2-B5D3-D51B3525E558@gmail.com> <765a2c230611061020k5af34635r7649856ecfca8ef4@mail.gmail.com> <0E9924F1-6698-49BB-A96F-F32C09DD74CD@eastmedia.com> Message-ID: <765a2c230611061942s6ca05201k194e6dee8920a11f@mail.gmail.com> On 11/6/06, Matt Pelletier wrote: > > On Nov 6, 2006, at 1:20 PM, James Hughes wrote: > > > On 11/5/06, Wayne E. Seguin wrote: > >> Zed, > >> > >> Just so you know I also experienced some confusion with the way the > >> purchasing was setup. > >> Clicking on the buy now button is deceiving because it takes you to > > > > "Buy now"? I see no "buy now". At least not on the page linked to by > > Zed. Am I crazy, or what? > > "Add to Cart" Not that it matters now, (as mentioned, I bought the pdf from one of the alternate links Zed provided) but for the record, this page: http://safari.oreilly.com/0321483502 has no "Add to Cart", no "Buy now", no "Give us money and we'll let you download the pdf immediately", or any other similarly named button that I can see. Maybe you have to have a Safari Max account to see it? Beats me. Btw, the book looks great. Looking forward to making good use of it. James From justinjohnson at gmail.com Tue Nov 7 09:21:10 2006 From: justinjohnson at gmail.com (Justin Johnson) Date: Tue, 7 Nov 2006 08:21:10 -0600 Subject: [Mongrel] Errno::EBADF (Bad file descriptor) In-Reply-To: <71166b3b0611061308jb7fe493xa24213265d33df6a@mail.gmail.com> References: <94a776e70611060630h53a38f14vda1db2b3b8c1b6b2@mail.gmail.com> <71166b3b0611061308jb7fe493xa24213265d33df6a@mail.gmail.com> Message-ID: <94a776e70611070621u3a528cc1w314adb87f08124a2@mail.gmail.com> On 11/6/06, Luis Lavena wrote: > > On 11/6/06, Justin Johnson wrote: > > I posted this to the discussion forum on rubyforge.org, but it appears > that > > it would have been better to post here. > > > > As said by Jano Svitok, its mostly related to puts nature. > > Also, is not safe, on any webapp, use puts directly!!! Zed will agree > (and he could get mad about this abuse of mongrel) ;-) > > Guess you should check WHY your rails application is eating your tags > instead of hacking... I mean, "solving" your problem using puts, > nothing good you will get from that. Thank you, this has been helpful. I will get into the habit of using logger instead of puts. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061107/9bddab3a/attachment.html From williamwgant at yahoo.com Tue Nov 7 09:30:22 2006 From: williamwgant at yahoo.com (Will Gant) Date: Tue, 7 Nov 2006 06:30:22 -0800 (PST) Subject: [Mongrel] Best Distro for Mongrel Message-ID: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Hello all, I've gone through a lot of extra effort trying to get Mongrel to place nice with Ubuntu. Since I'm at my wit's end trying to get it to work on this distro, I was wondering if anyone could suggest a distribution that makes it easy to set up. Any thoughts? Thanks, Will --------------------------------- Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2?/min with Yahoo! Messenger with Voice. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061107/07a4efd9/attachment.html From wilsonb at gmail.com Tue Nov 7 13:35:48 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Tue, 7 Nov 2006 13:35:48 -0500 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: On 11/7/06, Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place nice > with Ubuntu. Since I'm at my wit's end trying to get it to work on this > distro, I was wondering if anyone could suggest a distribution that makes it > easy to set up. Any thoughts? > Arch and Gentoo are both worth looking at. It's pretty straightforward on Ubuntu, though. How far have you gotten? I can help you get it going. From me at seebq.com Tue Nov 7 13:46:32 2006 From: me at seebq.com (Charles Brian Quinn) Date: Tue, 7 Nov 2006 13:46:32 -0500 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <3a2de0cd0611071046j2658de1axc818ebde04372d10@mail.gmail.com> I've been pretty successful with CentOS, but to be honest, I usually install the dependencies for the ruby/rails/apache/mongrel stack from source on all my boxen, just so I know what I'm getting into. My current deployment scripts live here: http://svn.highgroove.com:8080/deployment/trunk install_rails.sh will install ruby, rails, apache2.2.2, mongrel and a few other gems to get you upto speed. It then sets you up nice to use a cap recipe file like the one in that repository as well to run multiple mongrel clusters on the same box. patches/suggestions/improvements/tests welcome.... -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com On 11/7/06, Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place nice > with Ubuntu. Since I'm at my wit's end trying to get it to work on this > distro, I was wondering if anyone could suggest a distribution that makes it > easy to set up. Any thoughts? > > Thanks, > Will > > > ________________________________ > Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2?/min > with Yahoo! Messenger with Voice. > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From hughes.james at gmail.com Tue Nov 7 13:46:54 2006 From: hughes.james at gmail.com (James Hughes) Date: Tue, 7 Nov 2006 10:46:54 -0800 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <765a2c230611071046k68dd0e13h124307ef16bd5c23@mail.gmail.com> On 11/7/06, Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place nice > with Ubuntu. Since I'm at my wit's end trying to get it to work on this > distro, I was wondering if anyone could suggest a distribution that makes it > easy to set up. Any thoughts? What problems are you having? James From kevwil at gmail.com Tue Nov 7 14:22:35 2006 From: kevwil at gmail.com (Kevin Williams) Date: Tue, 7 Nov 2006 12:22:35 -0700 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <683a886f0611071122t12538502t810cac6948d8da21@mail.gmail.com> There's a 'softball' question. :) The easiest I've ever seen is Arch Linux. Of course, you'll likely get as many different opinions as replies. On 11/7/06, Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place nice > with Ubuntu. Since I'm at my wit's end trying to get it to work on this > distro, I was wondering if anyone could suggest a distribution that makes it > easy to set up. Any thoughts? > > Thanks, > Will > > > ________________________________ > Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2?/min > with Yahoo! Messenger with Voice. > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -- Cheers, Kevin Williams http://www.almostserio.us/ "Any sufficiently advanced technology is indistinguishable from Magic." - Arthur C. Clarke From wayneeseguin at gmail.com Tue Nov 7 14:25:42 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Tue, 7 Nov 2006 14:25:42 -0500 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <4EDB2DC4-AF44-4B6B-A9EF-0D69E1767A58@gmail.com> Will, I have several ubuntu servers running in production with Mongrel just fine. Where is your frustration at? I might be able to help. ~Wayne On Nov 07, 2006, at 09:30 , Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to > place nice with Ubuntu. Since I'm at my wit's end trying to get it > to work on this distro, I was wondering if anyone could suggest a > distribution that makes it easy to set up. Any thoughts? > > Thanks, > Will > > Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for > just 2?/min with Yahoo! Messenger with Voice. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From williamwgant at yahoo.com Tue Nov 7 15:18:56 2006 From: williamwgant at yahoo.com (Will Gant) Date: Tue, 7 Nov 2006 12:18:56 -0800 (PST) Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <3a2de0cd0611071046j2658de1axc818ebde04372d10@mail.gmail.com> Message-ID: <20061107201856.55818.qmail@web50401.mail.yahoo.com> I've installed Ruby, MySql, Rails, Apache, and Mongrel. I'm first trying to prove that Mongrel works by itself before attempting integration with Apache (since I don't know jack about apache). I set up a site using the directions specified in the documentation (with the config file and all that), but the site doesn't show up when I try to hit the appropriate port (8100) on that machine. Here's my last post on the Rails list regarding this issue: ------- I tried creating the config file as you suggested. I think something else may be broken: wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config -e production !!! Path to log file not valid: log/mongrel.log start reported an error. Use mongrel_rails start -h to get help. I then tried the following: wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config -e production -l /home/wgant/mongrel.log !!! Path to pid file not valid: log/mongrel.pid start reported an error. Use mongrel_rails start -h to get help. wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config -e production -l /home/wgant/mongrel.log -p /home/wgant/mongrel.pid !!! Path to pid file not valid: log/mongrel.pid start reported an error. Use mongrel_rails start -h to get help. wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config -e production -l /home/wgant/mongrel.log -P /home/wgant/mongrel.pid !!! Path to docroot not valid: public start reported an error. Use mongrel_rails start -h to get help. Charles Brian Quinn wrote: I've been pretty successful with CentOS, but to be honest, I usually install the dependencies for the ruby/rails/apache/mongrel stack from source on all my boxen, just so I know what I'm getting into. My current deployment scripts live here: http://svn.highgroove.com:8080/deployment/trunk install_rails.sh will install ruby, rails, apache2.2.2, mongrel and a few other gems to get you upto speed. It then sets you up nice to use a cap recipe file like the one in that repository as well to run multiple mongrel clusters on the same box. patches/suggestions/improvements/tests welcome.... -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com On 11/7/06, Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place nice > with Ubuntu. Since I'm at my wit's end trying to get it to work on this > distro, I was wondering if anyone could suggest a distribution that makes it > easy to set up. Any thoughts? > > Thanks, > Will > > > ________________________________ > Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2?/min > with Yahoo! Messenger with Voice. > > > _______________________________________________ > 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 --------------------------------- How low will we go? Check out Yahoo! Messenger?s low PC-to-Phone call rates. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061107/8cf3fadf/attachment.html From zedshaw at zedshaw.com Tue Nov 7 15:34:46 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 7 Nov 2006 12:34:46 -0800 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <20061107123446.309c5573.zedshaw@zedshaw.com> On Tue, 7 Nov 2006 06:30:22 -0800 (PST) Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place nice with Ubuntu. Since I'm at my wit's end trying to get it to work on this distro, I was wondering if anyone could suggest a distribution that makes it easy to set up. Any thoughts? I do my development on ArchLinux, and was doing original development on Ubuntu. Others use: * Solaris (with mkrf patch) * CentOS * FreeBSD * NetBSD * Win32 There are also Debian specific instructions on the site that should apply to Ubuntu: http://mongrel.rubyforge.org/docs/debian-sarge.html -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From _ at whats-your.name Tue Nov 7 16:05:14 2006 From: _ at whats-your.name (carmen) Date: Tue, 7 Nov 2006 16:05:14 -0500 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <20061107210514.GB4826@replic.net> On Tue Nov 07, 2006 at 06:30:22AM -0800, Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place nice with Ubuntu. Since I'm at my wit's end trying to get it to work on this distro, I was wondering if anyone could suggest a distribution that makes it easy to set up. Any thoughts? http://qualityhumans.com/images/tom_ezra_gentoo.mov From jw at innerewut.de Tue Nov 7 16:36:29 2006 From: jw at innerewut.de (Jonathan Weiss) Date: Tue, 07 Nov 2006 22:36:29 +0100 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <4550FC5D.7000208@innerewut.de> Will Gant wrote: > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place > nice with Ubuntu. Since I'm at my wit's end trying to get it to work on > this distro, I was wondering if anyone could suggest a distribution that > makes it easy to set up. Any thoughts? FreeBSD 6.X # cd /usr/ports/www/rubygem-mongrel # make install clean And you will get Mongrel + all Rails/Ruby/Gem dependencies. Regards, Jonathan -- Jonathan Weiss http://blog.innerewut.de From jamesludlow at gmail.com Tue Nov 7 16:46:34 2006 From: jamesludlow at gmail.com (JDL) Date: Tue, 7 Nov 2006 15:46:34 -0600 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107123446.309c5573.zedshaw@zedshaw.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> <20061107123446.309c5573.zedshaw@zedshaw.com> Message-ID: On 11/7/06, Zed A. Shaw wrote: > I do my development on ArchLinux, and was doing original development on Ubuntu. Others use: > > * Solaris (with mkrf patch) > * CentOS > * FreeBSD > * NetBSD > * Win32 Adding to the list, I've been running in production for 3.5 months now with no trouble on Fedora Core 5. -- James From hughes.james at gmail.com Tue Nov 7 17:56:36 2006 From: hughes.james at gmail.com (James Hughes) Date: Tue, 7 Nov 2006 14:56:36 -0800 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107201856.55818.qmail@web50401.mail.yahoo.com> References: <3a2de0cd0611071046j2658de1axc818ebde04372d10@mail.gmail.com> <20061107201856.55818.qmail@web50401.mail.yahoo.com> Message-ID: <765a2c230611071456l44ff0caakd6cfc33a63065a33@mail.gmail.com> On 11/7/06, Will Gant wrote: > I then tried the following: > > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log > !!! Path to pid file not valid: log/mongrel.pid > start reported an error. Use mongrel_rails start -h to get help. > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log -p /home/wgant/mongrel.pid > !!! Path to pid file not valid: log/mongrel.pid > start reported an error. Use mongrel_rails start -h to get help. > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log -P /home/wgant/mongrel.pid > !!! Path to docroot not valid: public > start reported an error. Use mongrel_rails start -h to get help. Hi, the paths mongrel is looking for (log and public) are generated automatically by the 'rails' command. mongrel_rails expects to be started from the root of the file structure created by this command, eg: rails myapp cd myapp mongrel_rails start James From jan.svitok at gmail.com Tue Nov 7 18:39:29 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Wed, 8 Nov 2006 00:39:29 +0100 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107201856.55818.qmail@web50401.mail.yahoo.com> References: <3a2de0cd0611071046j2658de1axc818ebde04372d10@mail.gmail.com> <20061107201856.55818.qmail@web50401.mail.yahoo.com> Message-ID: <8d9b3d920611071539i5e1ed8dfmd6d58fd8935f0cc1@mail.gmail.com> On 11/7/06, Will Gant wrote: > I've installed Ruby, MySql, Rails, Apache, and Mongrel. I'm first trying to > prove that Mongrel works by itself before attempting integration with Apache > (since I don't know jack about apache). I set up a site using the directions > specified in the documentation (with the config file and all that), but the > site doesn't show up when I try to hit the appropriate port (8100) on that > machine. > > Here's my last post on the Rails list regarding this issue: > > ------- > I tried creating the config file as you suggested. I think something else > may be broken: > > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production > !!! Path to log file not valid: log/mongrel.log > start reported an error. Use mongrel_rails start -h to get help. > > I then tried the following: > > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log > !!! Path to pid file not valid: log/mongrel.pid > start reported an error. Use mongrel_rails start -h to get help. > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log -p /home/wgant/mongrel.pid > !!! Path to pid file not valid: log/mongrel.pid > start reported an error. Use mongrel_rails start -h to get help. > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log -P /home/wgant/mongrel.pid > !!! Path to docroot not valid: public > start reported an error. Use mongrel_rails start -h to get help. Just a hint, I haven't setup mongrel on ubuntu yet, although I'm planning to. (I'm running mongrel on windows) - Your problem seems to be that mongrel doesn't find the site files. Try one of the following: Add -c /home/wgant (or wharever the path to your site's root dir is) then all other switches might be redundant. Or, go directly where you site is, and start mongrel_rails from there to generate the config and to check that mongrel runs. After you've checked it make the paths absolute and start mongrel from wherever you want. - Don't use config AND command line options (-G to generate the config is obviously fine). Choose either one but not both. - Use 'netstat -ant' to see whether the port is open for listening when mongrel starts fine and the site doesn't show up. - Read the logs to see what's happening. From mrueckert at suse.de Tue Nov 7 19:11:35 2006 From: mrueckert at suse.de (Marcus Rueckert) Date: Wed, 8 Nov 2006 01:11:35 +0100 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107143023.53767.qmail@web50401.mail.yahoo.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> Message-ID: <20061108001135.GA5135@suse.de> On 2006-11-07 06:30:22 -0800, Will Gant wrote: > Date: Tue, 7 Nov 2006 06:30:22 -0800 (PST) > From: Will Gant > Subject: [Mongrel] Best Distro for Mongrel > To: Mongrel List > > Hello all, > I've gone through a lot of extra effort trying to get Mongrel to place > nice with Ubuntu. Since I'm at my wit's end trying to get it to work > on this distro, I was wondering if anyone could suggest a distribution > that makes it easy to set up. Any thoughts? suse 10.1 mongrel + rails + others can be found as packages here: http://en.opensuse.org/Ruby http://software.opensuse.org/download/ruby/ darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org From joeat303 at yahoo.com Tue Nov 7 19:46:21 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Tue, 7 Nov 2006 16:46:21 -0800 (PST) Subject: [Mongrel] restart - `exec': Operation not supported Message-ID: <20061108004621.41481.qmail@web38609.mail.mud.yahoo.com> I played around with this some more and when I changed line 142 of /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails from "exec cmd" to "system cmd" Mongrel has successfully restarted every time I've tried ("mongrel_rails restart"). Hell if I know why exec doesn't work -- googling on "exec Operation not supported ruby" didn't turn up much. Maybe somebody on the Ruby list knows. I also copied the 'cmd = "..."' and 'exec cmd' into a new Ruby script, and THAT works fine. I'd guess for some reason Ruby can't replace the currently running Mongrel process with "exec cmd" (as exec does) -- perhaps mongrel_rails has something open? But that's just my ignorant guess. :P Also, before I restart Mongrel, its process (a la "ps axu") looks like this: /opt/local/bin/ruby /opt/local/bin/mongrel_rails start -d -p 3001 but after restarting: ruby /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails start -d -p 3001 Possible to make it the same? :) Joe Mac OS X / Powerbook MUCRAP-CE Master Apprentice --- Joe Ruby wrote: > Date: Mon, 28 Aug 2006 17:15:20 -0700 (PDT) > From: Joe Ruby > Subject: restart - `exec': Operation not supported > To: mongrel-users at rubyforge.org > > I'm using the latest Mongrel (0.3.13.4) and > restarting > causes Mongrel to die. From mongrel.log: > > ** USR2 signal received. > ** Restarting with arguments: ruby > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails > start -C config/mongrel.yml > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:142:in > `exec': Operation not supported - ruby > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails > start -C config/mongrel.yml (Errno::EOPNOTSUPP) > from > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:142:in > `run' > from > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:203:in > `run' > from > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 > from /opt/local/bin/mongrel_rails:18 > > I tried 'ruby > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails > start -C config/mongrel.yml' from the commandline > and > it started up Mongrel. > > Joe > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com ____________________________________________________________________________________ Sponsored Link Get a free Motorola Razr! Today Only! Choose Cingular, Sprint, Verizon, Alltel, or T-Mobile. http://www.letstalk.com/inlink.htm?to=592913 From luislavena at gmail.com Tue Nov 7 21:29:01 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 7 Nov 2006 23:29:01 -0300 Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <20061107123446.309c5573.zedshaw@zedshaw.com> References: <20061107143023.53767.qmail@web50401.mail.yahoo.com> <20061107123446.309c5573.zedshaw@zedshaw.com> Message-ID: <71166b3b0611071829y6a3c28dcx41c39cee3ed4d625@mail.gmail.com> On 11/7/06, Zed A. Shaw wrote: > On Tue, 7 Nov 2006 06:30:22 -0800 (PST) > Will Gant wrote: > > > Hello all, > > I've gone through a lot of extra effort trying to get Mongrel to place nice with Ubuntu. Since I'm at my wit's end trying to get it to work on this distro, I was wondering if anyone could suggest a distribution that makes it easy to set up. Any thoughts? > > I do my development on ArchLinux, and was doing original development on Ubuntu. Others use: > > * Solaris (with mkrf patch) > * CentOS > * FreeBSD > * NetBSD > * Win32 > On Win32 I can comment: I create my own "small ruby distro for deployment" on Win32. It downloads ruby mswin32 binaries, apply patches (cgi.rb for now). Download zlib dll and ruby-zlib. OpenSSL, readline and Iconv. Then I package rubygems, patch the scripts and package it as 7zip archive. I plan to extend this with ruby source recompile, when I reinstall VC6 and my fresh license Intel Compiler license, aiming to boost a bit of performance on win32 side. For deployment I use a custom InnoSetup routines (like Windows Installer) so can't comment on Apache deployment, most of my installations are intranet-ones. > There are also Debian specific instructions on the site that should apply to Ubuntu: > > http://mongrel.rubyforge.org/docs/debian-sarge.html > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://www.awprofessional.com/title/0321483502 -- The Mongrel Book > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From zedshaw at zedshaw.com Tue Nov 7 19:14:43 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 7 Nov 2006 19:14:43 -0500 Subject: [Mongrel] restart - `exec': Operation not supported In-Reply-To: <20061108004621.41481.qmail@web38609.mail.mud.yahoo.com> References: <20061108004621.41481.qmail@web38609.mail.mud.yahoo.com> Message-ID: <20061107191443.5420e83c.zedshaw@zedshaw.com> On Tue, 7 Nov 2006 16:46:21 -0800 (PST) Joe Ruby wrote: > I played around with this some more and when I changed > line 142 of > /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails > from "exec cmd" to "system cmd" Mongrel has > successfully restarted every time I've tried > ("mongrel_rails restart"). That's in the pre-release Joe. Also in the pre-release is the HUGE SECURITY FIX YOU SHOULD HAVE INSTALLED. sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases Enjoy! :-) -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From joeat303 at yahoo.com Tue Nov 7 22:27:14 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Tue, 7 Nov 2006 19:27:14 -0800 (PST) Subject: [Mongrel] restart - `exec': Operation not supported Message-ID: <20061108032714.61710.qmail@web38608.mail.mud.yahoo.com> > That's in the pre-release Joe. Also in the pre-release is the HUGE SECURITY FIX YOU SHOULD HAVE INSTALLED. AAAAAIIIIIIIEEEEEEE!!!! Hey, is there a related web page detailing it? I didn't see anything here: http://mongrel.rubyforge.org/news.html > sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases Done, restart works. :) Joe ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com From williamwgant at yahoo.com Tue Nov 7 23:15:46 2006 From: williamwgant at yahoo.com (Will Gant) Date: Tue, 7 Nov 2006 20:15:46 -0800 (PST) Subject: [Mongrel] Best Distro for Mongrel In-Reply-To: <765a2c230611071456l44ff0caakd6cfc33a63065a33@mail.gmail.com> Message-ID: <20061108041546.55605.qmail@web50404.mail.yahoo.com> HA! I wasn't invoking mongrel from the root of the site. In hindsight, I have no idea why that didn't occur to me. That fixed it. I figured I was doing something wrong. Now I guess I need to figure out how to get Apache talking to it and how to use multiple mongrels. This morning was pretty crappy, but you have totally made my day. Will James Hughes wrote: On 11/7/06, Will Gant wrote: > I then tried the following: > > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log > !!! Path to pid file not valid: log/mongrel.pid > start reported an error. Use mongrel_rails start -h to get help. > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log -p /home/wgant/mongrel.pid > !!! Path to pid file not valid: log/mongrel.pid > start reported an error. Use mongrel_rails start -h to get help. > wgant at sauron:/etc/mongrel/sites-enabled$ mongrel_rails start -G test.config > -e production -l /home/wgant/mongrel.log -P /home/wgant/mongrel.pid > !!! Path to docroot not valid: public > start reported an error. Use mongrel_rails start -h to get help. Hi, the paths mongrel is looking for (log and public) are generated automatically by the 'rails' command. mongrel_rails expects to be started from the root of the file structure created by this command, eg: rails myapp cd myapp mongrel_rails start James _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users --------------------------------- Sponsored Link Try Netflix today! With plans starting at only $5.99 a month what are you waiting for? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061107/7c59cdf3/attachment-0001.html From cbillen at warmlyyours.com Wed Nov 8 08:39:08 2006 From: cbillen at warmlyyours.com (Christian Billen) Date: Wed, 08 Nov 2006 07:39:08 -0600 Subject: [Mongrel] Apache 2.2.3 setup woes Message-ID: Good morning everyone, I am running apache 2.2.3 compiled from source and proxy load balancer as described on the mongrel site. I have a total of three sites, this setup works really well for two of them but for one of them, I keep getting "Forbidden" errors and this error in the apache logs: [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. This problem is starting to drive me nuts because I compared the setup of the other sites to this one and it is exactly the same, also if I did point the proxy to one of the other site, it works. So there's something specific about this site in rails that tips it off but my knowledge there is limited. I've also checked the permission for the www-data user that my apache runs under and all checks out and is similar there. Any other areas I could look at? Here's the virtual host config Listen 192.168.100.100 ServerName myprojects.warmlyyours.com DocumentRoot /var/www/approot/public Options FollowSymLinks AllowOverride None Order allow,deny Allow from all # Configure mongrel_cluster BalancerMember http://127.0.0.1:8000 BalancerMember http://127.0.0.1:8001 BalancerMember http://127.0.0.1:8002 BalancerMember http://127.0.0.1:8003 BalancerMember http://127.0.0.1:8004 BalancerMember http://127.0.0.1:8005 BalancerMember http://127.0.0.1:8006 BalancerMember http://127.0.0.1:8007 BalancerMember http://127.0.0.1:8008 BalancerMember http://127.0.0.1:8009 BalancerMember http://127.0.0.1:8010 BalancerMember http://127.0.0.1:8011 RewriteEngine On RewriteRule ^(.*/)?.svn/ - [F,L] RewriteRule ^/$ /index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] From ezmobius at gmail.com Wed Nov 8 20:04:40 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Wed, 8 Nov 2006 17:04:40 -0800 Subject: [Mongrel] OptimizedMutex for Mongrel Message-ID: Hey Zed- I had a user with an app that was leaking memory with mongrel but not lighty/fcgi. I have been doing anything I can to track it down. I already did the Mutex patch to use unshitf and pop instead of shift and push and it didn't really help much. The mem leak only really shows up when you use the wsess option to httperf. The other day I saw a ruby C extension that Mentalguy built called optimized_locking. It has an OptimizedMutex class that is written in C. Its actually pretty small amount of C code and fairly easy to understand. Anyway, long story short, I patch the latest mongrel trunk and added this optimized_locking.c in as another C extension that gets built when you make the gem. It has helped quite a bit with the mem leak and seems to have better performance then Sync. I'm not suggesting this is needed in core mongrel but I thought I would share with you anyway to see what you think. I am attaching a gem built from svn trunk mongrel with the new OptimizedMutex C extension built it. I only used the OptimizedMutex for the rails handler so thats all that is patched in this gem. Play around with it and let me know if you can tell the difference. I have been using the same OptimizedMutex in Merb and it hasn't caused any issues yet. In fact it is measurably faster then the normal Mutex or Sync, even if only by a little. But it has pretty flatline memory consumption Installing the gem will build the optimized_locking c extension after it builds http11. Grab it here: http://brainspl.at/mongrel-c-mutex-0.3.14.gem.zip If anyone has any leaky apps and they want to try this out then please measure before and after and let me know the results. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From luislavena at gmail.com Wed Nov 8 22:07:28 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 9 Nov 2006 00:07:28 -0300 Subject: [Mongrel] OptimizedMutex for Mongrel In-Reply-To: References: Message-ID: <71166b3b0611081907n7afe5235kb78cc7a67299b70d@mail.gmail.com> On 11/8/06, Ezra Zygmuntowicz wrote: > Hey Zed- [snip] > > The other day I saw a ruby C extension that Mentalguy built called > optimized_locking. It has an OptimizedMutex class that is written in > C. Its actually pretty small amount of C code and fairly easy to > understand. > > Anyway, long story short, I patch the latest mongrel trunk and added > this optimized_locking.c in as another C extension that gets built > when you make the gem. It has helped quite a bit with the mem leak > and seems to have better performance then Sync. I'm not suggesting > this is needed in core mongrel but I thought I would share with you > anyway to see what you think. I am attaching a gem built from svn > trunk mongrel with the new OptimizedMutex C extension built it. I > only used the OptimizedMutex for the rails handler so thats all that > is patched in this gem. Play around with it and let me know if you > can tell the difference. > That's good, checked your code but build on win32 failed miserably. > I have been using the same OptimizedMutex in Merb and it hasn't > caused any issues yet. In fact it is measurably faster then the > normal Mutex or Sync, even if only by a little. But it has pretty > flatline memory consumption > Because cannot get extension built, could you run this pastie against the new locking mechanism? http://pastie.caboo.se/10194 Thank you Ezra for your time, and thank you for pointing this info. Hope we could get it working on Win32 side too. (I'm getting illegal use of this type errors in WaitEntry *e) > > If anyone has any leaky apps and they want to try this out then > please measure before and after and let me know the results. > > Cheers- > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From ezmobius at gmail.com Thu Nov 9 00:11:52 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Wed, 8 Nov 2006 21:11:52 -0800 Subject: [Mongrel] OptimizedMutex for Mongrel In-Reply-To: <71166b3b0611081907n7afe5235kb78cc7a67299b70d@mail.gmail.com> References: <71166b3b0611081907n7afe5235kb78cc7a67299b70d@mail.gmail.com> Message-ID: <9B29A307-47A2-4361-B6FD-5EF4766BCF71@gmail.com> On Nov 8, 2006, at 7:07 PM, Luis Lavena wrote: > On 11/8/06, Ezra Zygmuntowicz wrote: >> > > That's good, checked your code but build on win32 failed miserably. Yeah at this point I hadn't even considered windows yet. I am not much of a C coder so I don't know if this optimized_locking extension will be able to work on windows. > > Because cannot get extension built, could you run this pastie against > the new locking mechanism? > > http://pastie.caboo.se/10194 > > Thank you Ezra for your time, and thank you for pointing this info. > Hope we could get it working on Win32 side too. (I'm getting illegal > use of this type errors in WaitEntry *e) > -- > Luis Lavena > Multimedia systems Hey Louis- How did you make the graph? I just ran the test and watched top while it ran. The memory fluctuated between 2Mb and 7.8Mb. And it cycled. As in it would grow to almost 8Mb and then drop back down to 2 and grow again. Thats what we are looking for in a good memory alooc/free pattern right? If you tell me how to make that graph I will run it again and make one so you can see. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From carl.lerche at gmail.com Thu Nov 9 00:38:35 2006 From: carl.lerche at gmail.com (Carl Lerche) Date: Wed, 8 Nov 2006 21:38:35 -0800 Subject: [Mongrel] Distroy to experiment with Xen? Message-ID: Hello, I would like to experiment with Xen some to see how I could integrate it in my various web application environments and hopefully make my life easier. I am currently using FreeBSD 6 but it seems that it doesn't fully support Xen. I did some searching around and also notice some posts on mailing lists mentioning some trouble with the CentOS 4 distribution (something about the default Berkley DB package not playing nicely with Xen). Anyway, I know there was some mention of Xen on the mailing list a little bit ago and was wondering if anybody had any insight as to what OS / Distro would be well coupled with Xen for an end goal of Ruby on Rails, Mongrel, Apache, Postgres, etc... Thanks, Carl From carl.lerche at gmail.com Thu Nov 9 01:04:10 2006 From: carl.lerche at gmail.com (Carl Lerche) Date: Wed, 8 Nov 2006 22:04:10 -0800 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: References: Message-ID: Umm... oops. I really should proof read better before hitting the send button. Funny typo though. Sorry, -carl On 11/8/06, Carl Lerche wrote: > Hello, > > I would like to experiment with Xen some to see how I could integrate > it in my various web application environments and hopefully make my > life easier. I am currently using FreeBSD 6 but it seems that it > doesn't fully support Xen. I did some searching around and also notice > some posts on mailing lists mentioning some trouble with the CentOS 4 > distribution (something about the default Berkley DB package not > playing nicely with Xen). Anyway, I know there was some mention of Xen > on the mailing list a little bit ago and was wondering if anybody had > any insight as to what OS / Distro would be well coupled with Xen for > an end goal of Ruby on Rails, Mongrel, Apache, Postgres, etc... > > Thanks, > Carl > From eolamey at gmail.com Thu Nov 9 04:43:48 2006 From: eolamey at gmail.com (Eric-Olivier Lamey) Date: Thu, 9 Nov 2006 10:43:48 +0100 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: References: Message-ID: On 11/9/06, Carl Lerche wrote: > Hello, Hi, > I would like to experiment with Xen some to see how I could integrate > it in my various web application environments and hopefully make my > life easier. I am currently using FreeBSD 6 but it seems that it > doesn't fully support Xen. I did some searching around and also notice > some posts on mailing lists mentioning some trouble with the CentOS 4 > distribution (something about the default Berkley DB package not > playing nicely with Xen). Anyway, I know there was some mention of Xen > on the mailing list a little bit ago and was wondering if anybody had > any insight as to what OS / Distro would be well coupled with Xen for > an end goal of Ruby on Rails, Mongrel, Apache, Postgres, etc... I'm currently using Centos4 and FC6 dom0 and RHEL3/Centos4 domUs without any problem, dom0 being the base OS from which you run domUs (the guests). With CentOS 4, you have to get xen packages from xensource.com, but they are pretty good. With FC6 and Ubuntu 6.10, xen is packaged in the distribution and therefore very well integrated. All those distributions should support the software stack needed for Rails. -- Eric-Olivier Lamey From luislavena at gmail.com Thu Nov 9 05:52:36 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 9 Nov 2006 07:52:36 -0300 Subject: [Mongrel] OptimizedMutex for Mongrel In-Reply-To: <9B29A307-47A2-4361-B6FD-5EF4766BCF71@gmail.com> References: <71166b3b0611081907n7afe5235kb78cc7a67299b70d@mail.gmail.com> <9B29A307-47A2-4361-B6FD-5EF4766BCF71@gmail.com> Message-ID: <71166b3b0611090252h661808d5hbeb267da5dd4a585@mail.gmail.com> On 11/9/06, Ezra Zygmuntowicz wrote: > > On Nov 8, 2006, at 7:07 PM, Luis Lavena wrote: > > > On 11/8/06, Ezra Zygmuntowicz wrote: > >> > > > > That's good, checked your code but build on win32 failed miserably. > > Yeah at this point I hadn't even considered windows yet. I am not > much of a C coder so I don't know if this optimized_locking extension > will be able to work on windows. Me neither, also was very tired to check the code in deep. I'll contact mentalguy, but I guess the answer will be 'what, windows?' :-P > > > > Because cannot get extension built, could you run this pastie against > > the new locking mechanism? > > > > http://pastie.caboo.se/10194 > > > > Thank you Ezra for your time, and thank you for pointing this info. > > Hope we could get it working on Win32 side too. (I'm getting illegal > > use of this type errors in WaitEntry *e) > > > -- > > Luis Lavena > > Multimedia systems > > Hey Louis- > > How did you make the graph? I just ran the test and watched top > while it ran. The memory fluctuated between 2Mb and 7.8Mb. And it > cycled. As in it would grow to almost 8Mb and then drop back down to > 2 and grow again. Thats what we are looking for in a good memory > alooc/free pattern right? If you tell me how to make that graph I > will run it again and make one so you can see. > I didn't make it, was Zed. Guess the data was collected from ps or something... right Zed? Monitoring the memory used/allocation of the processes guess will be the idea. What I did was take a few screenshots of Process Explorer on Windows to proof Sync/Mutex differences: http://rubyforge.org/pipermail/mongrel-users/2006-August/001253.html > Cheers- > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From mrueckert at suse.de Thu Nov 9 10:03:12 2006 From: mrueckert at suse.de (Marcus Rueckert) Date: Thu, 9 Nov 2006 16:03:12 +0100 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: References: Message-ID: <20061109150312.GH5135@suse.de> On 2006-11-08 21:38:35 -0800, Carl Lerche wrote: > I would like to experiment with Xen some to see how I could integrate > it in my various web application environments and hopefully make my > life easier. I am currently using FreeBSD 6 but it seems that it > doesn't fully support Xen. I did some searching around and also notice > some posts on mailing lists mentioning some trouble with the CentOS 4 > distribution (something about the default Berkley DB package not > playing nicely with Xen). Anyway, I know there was some mention of Xen > on the mailing list a little bit ago and was wondering if anybody had > any insight as to what OS / Distro would be well coupled with Xen for > an end goal of Ruby on Rails, Mongrel, Apache, Postgres, etc... opensuse 10.1 + ruby project http://software.opensuse.org/download/ruby/ darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org From wyhaines at gmail.com Thu Nov 9 11:23:23 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 9 Nov 2006 09:23:23 -0700 Subject: [Mongrel] OptimizedMutex for Mongrel In-Reply-To: <71166b3b0611090252h661808d5hbeb267da5dd4a585@mail.gmail.com> References: <71166b3b0611081907n7afe5235kb78cc7a67299b70d@mail.gmail.com> <9B29A307-47A2-4361-B6FD-5EF4766BCF71@gmail.com> <71166b3b0611090252h661808d5hbeb267da5dd4a585@mail.gmail.com> Message-ID: On 11/9/06, Luis Lavena wrote: > > Yeah at this point I hadn't even considered windows yet. I am not > > much of a C coder so I don't know if this optimized_locking extension > > will be able to work on windows. > > Me neither, also was very tired to check the code in deep. > > I'll contact mentalguy, but I guess the answer will be 'what, windows?' :-P I've been testing it with IOWA, too, and so far, so good. I do think it should be fine on Windows if built in an appropriate build environment. Kirk Haines From luislavena at gmail.com Thu Nov 9 13:35:36 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 9 Nov 2006 15:35:36 -0300 Subject: [Mongrel] OptimizedMutex for Mongrel In-Reply-To: References: <71166b3b0611081907n7afe5235kb78cc7a67299b70d@mail.gmail.com> <9B29A307-47A2-4361-B6FD-5EF4766BCF71@gmail.com> <71166b3b0611090252h661808d5hbeb267da5dd4a585@mail.gmail.com> Message-ID: <71166b3b0611091035v73e7cb94je544d085a0f52864@mail.gmail.com> On 11/9/06, Kirk Haines wrote: > On 11/9/06, Luis Lavena wrote: > > > > Yeah at this point I hadn't even considered windows yet. I am not > > > much of a C coder so I don't know if this optimized_locking extension > > > will be able to work on windows. > > > > Me neither, also was very tired to check the code in deep. > > > > I'll contact mentalguy, but I guess the answer will be 'what, windows?' :-P > > I've been testing it with IOWA, too, and so far, so good. I do think > it should be fine on Windows if built in an appropriate build > environment. > I could provide you with 2003 toolkit bundled with platform sdk headers & libs, the same env used to build mongrel on Windows. Drop me a line (off the list) and I will sent you a link (due licenses I cannot put it in public). -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From mongrel at bencurtis.com Thu Nov 9 13:46:10 2006 From: mongrel at bencurtis.com (Benjamin Curtis) Date: Thu, 9 Nov 2006 10:46:10 -0800 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: References: Message-ID: I have had good results with Debian + Xen + Mongrel/Rails/etc. All of the "servers" I have set up for my day job are Xen instances. I believe howtoforge had a nice guide for getting Xen set up with Debian. On Nov 8, 2006, at 9:38 PM, Carl Lerche wrote: > Hello, > > I would like to experiment with Xen some to see how I could integrate > it in my various web application environments and hopefully make my > life easier. I am currently using FreeBSD 6 but it seems that it > doesn't fully support Xen. I did some searching around and also notice > some posts on mailing lists mentioning some trouble with the CentOS 4 > distribution (something about the default Berkley DB package not > playing nicely with Xen). Anyway, I know there was some mention of Xen > on the mailing list a little bit ago and was wondering if anybody had > any insight as to what OS / Distro would be well coupled with Xen for > an end goal of Ruby on Rails, Mongrel, Apache, Postgres, etc... > > Thanks, > Carl -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061109/8fa7d386/attachment.html From ezmobius at gmail.com Thu Nov 9 15:42:20 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Thu, 9 Nov 2006 12:42:20 -0800 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: References: Message-ID: On Nov 8, 2006, at 9:38 PM, Carl Lerche wrote: > Hello, > > I would like to experiment with Xen some to see how I could integrate > it in my various web application environments and hopefully make my > life easier. I am currently using FreeBSD 6 but it seems that it > doesn't fully support Xen. I did some searching around and also notice > some posts on mailing lists mentioning some trouble with the CentOS 4 > distribution (something about the default Berkley DB package not > playing nicely with Xen). Anyway, I know there was some mention of Xen > on the mailing list a little bit ago and was wondering if anybody had > any insight as to what OS / Distro would be well coupled with Xen for > an end goal of Ruby on Rails, Mongrel, Apache, Postgres, etc... > > Thanks, > Carl I'll put my vote in for Gentoo linux. We are running a ton of Xen VM's on gentoo and it has been absolutely awesome to work with. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From bradley at railsmachine.com Thu Nov 9 16:37:04 2006 From: bradley at railsmachine.com (Bradley Taylor) Date: Thu, 09 Nov 2006 16:37:04 -0500 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: References: Message-ID: <45539F80.9040601@railsmachine.com> > I did some searching around and also notice > some posts on mailing lists mentioning some trouble with the CentOS 4 > distribution (something about the default Berkley DB package not > playing nicely with Xen). Rails Machine runs Centos 4.3 Dom0s and DomUs on all of our servers. I haven't seen any distro-specific conflicts although I uninstall everything but the bare minimum to run xend. Get RPMs from Xen Source and force install them to get the patched glibc. Regards, Bradley Taylor Rails Machine Ruby on Rails Solutions VPS Hosting and Deployment Consulting http://railsmachine.com From cbquinn at gmail.com Thu Nov 9 16:50:10 2006 From: cbquinn at gmail.com (Charles Brian Quinn) Date: Thu, 9 Nov 2006 16:50:10 -0500 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: References: Message-ID: <3a2de0cd0611091350s11c94995mef5b44cb93a8eba1@mail.gmail.com> Check it out, a Gentoo Xen VM running in a Gentoo VMware VM: http://www.vmware.com/vmtn/appliances/directory/617 this blows my mind a bit. but is probably your best bet for playing with Xen, as a VMware image. On 11/9/06, Ezra Zygmuntowicz wrote: > > On Nov 8, 2006, at 9:38 PM, Carl Lerche wrote: > > > Hello, > > > > I would like to experiment with Xen some to see how I could integrate > > it in my various web application environments and hopefully make my > > life easier. I am currently using FreeBSD 6 but it seems that it > > doesn't fully support Xen. I did some searching around and also notice > > some posts on mailing lists mentioning some trouble with the CentOS 4 > > distribution (something about the default Berkley DB package not > > playing nicely with Xen). Anyway, I know there was some mention of Xen > > on the mailing list a little bit ago and was wondering if anybody had > > any insight as to what OS / Distro would be well coupled with Xen for > > an end goal of Ruby on Rails, Mongrel, Apache, Postgres, etc... > > > > Thanks, > > Carl > > I'll put my vote in for Gentoo linux. We are running a ton of Xen > VM's on gentoo and it has been absolutely awesome to work with. > > > Cheers- > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com From zedshaw at zedshaw.com Thu Nov 9 15:07:51 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 9 Nov 2006 15:07:51 -0500 Subject: [Mongrel] OptimizedMutex for Mongrel In-Reply-To: References: <71166b3b0611081907n7afe5235kb78cc7a67299b70d@mail.gmail.com> <9B29A307-47A2-4361-B6FD-5EF4766BCF71@gmail.com> <71166b3b0611090252h661808d5hbeb267da5dd4a585@mail.gmail.com> Message-ID: <20061109150751.e2acc6f2.zedshaw@zedshaw.com> On Thu, 9 Nov 2006 09:23:23 -0700 "Kirk Haines" wrote: > On 11/9/06, Luis Lavena wrote: > > > > Yeah at this point I hadn't even considered windows yet. I am not > > > much of a C coder so I don't know if this optimized_locking extension > > > will be able to work on windows. > > > > Me neither, also was very tired to check the code in deep. > > > > I'll contact mentalguy, but I guess the answer will be 'what, windows?' :-P > > I've been testing it with IOWA, too, and so far, so good. I do think > it should be fine on Windows if built in an appropriate build > environment. > I've got it in the Mongrel code and it all tests out. I think part of the build problems come from mentalguy's use of k&r and c99 semantics in the same code. GCC can probably handle it but I'm guessing lame as vc2003 can't. I'll do some work to get it working on win32 and see about a release. If this works, I'd love to just make it compatible with Mutex and rip that damn thing out. What do you think Kirk? -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From ewj at ideaport.com Thu Nov 9 19:04:38 2006 From: ewj at ideaport.com (Edmund Jorgensen) Date: Thu, 09 Nov 2006 18:04:38 -0600 Subject: [Mongrel] Failure on File::Read in Mongrel called by Flash Message-ID: <4553C216.10502@ideaport.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all, I'm using Mongrel in a project and experiencing a strange failure under the following circumstances: I'm running on Debian sarge, using the ruby 1.8.5-3 packages from testing, and Mongrel 0.3.13.4. The application serves a number of flash files that are not in a directory available through the web--they are served by a ruby routine that reads them in with File::read and sets the content type / length / disposition headers. All this works just fine in the simplest case, when the dynamic url to get the flash file is embedded into an html page. But in the new version of our project we're "wrapping" the flash file in another flash file (it's the only way you can turn on / off menu items in flashpaper). The same url that loaded the flash file successfully is passed to the flash wrapper (with proper encoding / decoding), which then tries to load that flash file...and fails the instant the ruby code tries to read the flash file from disk. When it dies it doesn't raise anything...it just stops. I'm logging debug statements and they go something like: About to get file x (where x is the correct path for the file that really exists and is readable)... Then nothing! Wrapping it in a begin / rescue block has no effect either. I know the flash wrapper isn't the problem, or the flash file it's trying to load...if I make the url to the same file but from a publicly available web dir, it works just fine. The whole thing works just fine on an Ubuntu server running 1.8.4 ruby (same mongrel version). This makes me think it's not a problem in mongrel but in ruby 1.8.5, or how 1.8.5 and Mongrel get along. This is a non-rails app, by the way. So, I know this is an arcane problem, but has anybody experienced anything similar with Mongrel and ruby 1.8.5 and found any solutions / workarounds? Many thanks, Edmund -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFFU8IT8F6VCddRtcARAnPJAKCKPrBsbjvFi6K4Q/Bh3Ay9Z4qN3wCfZE5q HARyCdiq93+2JhV0XZMYoi0= =2G9t -----END PGP SIGNATURE----- From jamie at dangosaur.us Thu Nov 9 19:22:18 2006 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Thu, 9 Nov 2006 19:22:18 -0500 Subject: [Mongrel] mongrel_cluster rc.d script for FreeBSD In-Reply-To: References: Message-ID: <01CF71DE-E68D-4B1A-A012-44020F05DE16@dangosaur.us> I followed the instructions for this. I can start with mongrel_cluster_ctl no problem, but on reboot, the mongrel servers are not starting. I'm running user/group as www It wouldn't start when trying to write the pid files to /var/run, so I'm writing to the app's log dir. Nothing is written to the mongrel log on reboot, so it doesn't seem to be doing anything. tail gives: ** TERM signal received. ** TERM signal received. ** TERM signal received. for the last three lines from system restart. rc.conf: mongrel_cluster_enable="YES" mongrel_cluster_config="/usr/local/etc/mongrel_cluster" conf file is nlx.yml FreeBSD 6.1 Rails edge latest prerelease mongrel latest mongrel_cluster Looking for ideas. Thanks, Jamie On Jul 28, 2006, at 4:04 PM, Andrew Bennett wrote: > I wanted to be able to specify in my /etc/rc.conf file whether > mongrel_cluster should be enabled and the mongrel_cluster_config file > for the init script, so I wrote this simple rc.d style script. > > Just throw it in /usr/local/etc/rc.d/ and do a chmod +x > /usr/local/etc/rc.d/mongrel_cluster.sh > > To enable the script, add mongrel_cluster_enable="YES" to /etc/rc.conf > and optionally add mongrel_cluster_config="/etc/mongrel_cluster" > > The default config path is /usr/local/etc/mongrel_cluster > > Would be nice if mongrel_cluster_ctl had some sort of "status" switch > to see if the servers are actually running and what their pids are. > > Andrew Bennett > potatosaladx at gmail.com > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From todd.fisher at gmail.com Thu Nov 9 21:19:55 2006 From: todd.fisher at gmail.com (Todd Fisher) Date: Thu, 9 Nov 2006 21:19:55 -0500 Subject: [Mongrel] Apache 2.2.3 setup woes In-Reply-To: References: Message-ID: Hey there, On 11/8/06, Christian Billen wrote: > > Good morning everyone, > > I am running apache 2.2.3 compiled from source and proxy load balancer as > described on the mongrel site. > > I have a total of three sites, this setup works really well for two of > them > but for one of them, I keep getting "Forbidden" errors and this error in > the > apache logs: > > [warn] proxy: No protocol handler was valid for the URL /. If you are > using > a DSO version of mod_proxy, make sure the proxy submodules are included in > the configuration using LoadModule. > > This problem is starting to drive me nuts because I compared the setup of > the other sites to this one and it is exactly the same, also if I did > point > the proxy to one of the other site, it works. > > So there's something specific about this site in rails that tips it off > but > my knowledge there is limited. > > I've also checked the permission for the www-data user that my apache runs > under and all checks out and is similar there. > > Any other areas I could look at? > > > Here's the virtual host config > > > Listen 192.168.100.100 > > ServerName myprojects.warmlyyours.com > DocumentRoot /var/www/approot/public > > Options FollowSymLinks > AllowOverride None > Order allow,deny > Allow from all > > > # Configure mongrel_cluster > > BalancerMember http://127.0.0.1:8000 > BalancerMember http://127.0.0.1:8001 > BalancerMember http://127.0.0.1:8002 > BalancerMember http://127.0.0.1:8003 > BalancerMember http://127.0.0.1:8004 > BalancerMember http://127.0.0.1:8005 > BalancerMember http://127.0.0.1:8006 > BalancerMember http://127.0.0.1:8007 > BalancerMember http://127.0.0.1:8008 > BalancerMember http://127.0.0.1:8009 > BalancerMember http://127.0.0.1:8010 > BalancerMember http://127.0.0.1:8011 > > > RewriteEngine On > > RewriteRule ^(.*/)?.svn/ - [F,L] > > RewriteRule ^/$ /index.html [QSA] > > RewriteRule ^([^.]+)$ $1.html [QSA] > > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061109/a5a5fa47/attachment-0001.html From todd.fisher at gmail.com Thu Nov 9 21:25:14 2006 From: todd.fisher at gmail.com (Todd Fisher) Date: Thu, 9 Nov 2006 21:25:14 -0500 Subject: [Mongrel] Apache 2.2.3 setup woes In-Reply-To: References: Message-ID: crap, sorry about my first reply slipped on the keyboard.... Anyways, i was trying to say... I had a simpler issue the other day. The first thing I did was make sure the file permissions on /var/www/approot/public were read by chown -R apache:apache /var/www/approot/public The next step was to make sure I my named hosts set up correctly. This is a little tricky because apache supports different types of virtual hosts and if you don't keep things consistent it's tricky to get it working. What i first did since I run fedora core, is make sure that the configuration in my /etc/httpd/conf/httpd.conf wrapped the default document root in a virutal host and did so by name. NameVirtualHost *:80 ServerName bigbox ServerAlias bigbox Now the only part i had to make sure was correct is the rails config /etc/httpd/conf.d/rails.conf BalancerMember http://10.0.6.130:3000 BalancerMember http://10.0.6.130:3001 BalancerMember http://10.0.6.130:3002 BalancerMember http://10.0.6.130:3003 NameVirtualHost *:80 ServerName rails-dev ServerAlias rails-dev ProxyPass / balancer://rails-cluster/ ProxyPassReverse / balancer://rails-cluster/ ErrorLog /var/log/httpd/rails/error_log TransferLog /var/log/httpd/rails/access_log Again, making sure my paths were all accessible read/write for the log dirs... Hope this helps... Lots of back and forth with the configuration usually before it's working as desired... Good luck! -Todd On 11/9/06, Todd Fisher wrote: > > Hey there, > > > On 11/8/06, Christian Billen wrote: > > > > Good morning everyone, > > > > I am running apache 2.2.3 compiled from source and proxy load balancer > > as > > described on the mongrel site. > > > > I have a total of three sites, this setup works really well for two of > > them > > but for one of them, I keep getting "Forbidden" errors and this error in > > the > > apache logs: > > > > [warn] proxy: No protocol handler was valid for the URL /. If you are > > using > > a DSO version of mod_proxy, make sure the proxy submodules are included > > in > > the configuration using LoadModule. > > > > This problem is starting to drive me nuts because I compared the setup > > of > > the other sites to this one and it is exactly the same, also if I did > > point > > the proxy to one of the other site, it works. > > > > So there's something specific about this site in rails that tips it off > > but > > my knowledge there is limited. > > > > I've also checked the permission for the www-data user that my apache > > runs > > under and all checks out and is similar there. > > > > Any other areas I could look at? > > > > > > Here's the virtual host config > > > > > > Listen 192.168.100.100 > > > > ServerName myprojects.warmlyyours.com > > DocumentRoot /var/www/approot/public > > > > Options FollowSymLinks > > AllowOverride None > > Order allow,deny > > Allow from all > > > > > > # Configure mongrel_cluster > > > > BalancerMember http://127.0.0.1:8000 > > BalancerMember http://127.0.0.1:8001 > > BalancerMember http://127.0.0.1:8002 > > BalancerMember http://127.0.0.1:8003 > > BalancerMember http://127.0.0.1:8004 > > BalancerMember http://127.0.0.1:8005 > > BalancerMember http://127.0.0.1:8006 > > BalancerMember http://127.0.0.1:8007 > > BalancerMember http://127.0.0.1:8008 > > BalancerMember http://127.0.0.1:8009 > > BalancerMember http://127.0.0.1:8010 > > BalancerMember http://127.0.0.1:8011 > > > > > > RewriteEngine On > > > > RewriteRule ^(.*/)?.svn/ - [F,L] > > > > RewriteRule ^/$ /index.html [QSA] > > > > RewriteRule ^([^.]+)$ $1.html [QSA] > > > > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > > RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] > > > > > > > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061109/cfc00517/attachment.html From mi-mongrel at moensolutions.com Sun Nov 5 18:11:41 2006 From: mi-mongrel at moensolutions.com (Michael Moen) Date: Sun, 5 Nov 2006 15:11:41 -0800 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> Message-ID: <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> On Nov 5, 2006, at 12:43 PM, James Hughes wrote: > I want the pdf, but I don't want to have to get a full safari > subscription. I just want to pay the $14.99 and be on my way. Any > hints? http://www.informit.com/bookstore/product.asp?isbn=9780321483508&rl=1 From carl.lerche at gmail.com Thu Nov 9 22:46:43 2006 From: carl.lerche at gmail.com (Carl Lerche) Date: Thu, 9 Nov 2006 19:46:43 -0800 Subject: [Mongrel] Distroy to experiment with Xen? In-Reply-To: <45539F80.9040601@railsmachine.com> References: <45539F80.9040601@railsmachine.com> Message-ID: Thanks for all your suggestions, I will look into them more. > Rails Machine runs Centos 4.3 Dom0s and DomUs on all of our servers. I > haven't seen any distro-specific conflicts although I uninstall > everything but the bare minimum to run xend. Get RPMs from Xen Source > and force install them to get the patched glibc. I personally would prefer to stay with packages, but maybe I'll try this and see how it works. Thanks, -carl From g.vishnu at gmail.com Fri Nov 10 00:41:09 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Fri, 10 Nov 2006 11:11:09 +0530 Subject: [Mongrel] mongrel_cluster rc.d script for FreeBSD In-Reply-To: <01CF71DE-E68D-4B1A-A012-44020F05DE16@dangosaur.us> References: <01CF71DE-E68D-4B1A-A012-44020F05DE16@dangosaur.us> Message-ID: I had this same problem. Use monit to manage your mongrels (http://www.tildeslash.com/monit/) Vish On 11/10/06, Jamie Orchard-Hays wrote: > I followed the instructions for this. I can start with > mongrel_cluster_ctl no problem, but on reboot, the mongrel servers > are not starting. > > I'm running user/group as www > It wouldn't start when trying to write the pid files to /var/run, so > I'm writing to the app's log dir. > Nothing is written to the mongrel log on reboot, so it doesn't seem > to be doing anything. tail gives: > ** TERM signal received. > ** TERM signal received. > ** TERM signal received. > > for the last three lines from system restart. > > rc.conf: > mongrel_cluster_enable="YES" > mongrel_cluster_config="/usr/local/etc/mongrel_cluster" > > conf file is > nlx.yml > > FreeBSD 6.1 > Rails edge > latest prerelease mongrel > latest mongrel_cluster > > Looking for ideas. > > Thanks, > Jamie > > On Jul 28, 2006, at 4:04 PM, Andrew Bennett wrote: > > > I wanted to be able to specify in my /etc/rc.conf file whether > > mongrel_cluster should be enabled and the mongrel_cluster_config file > > for the init script, so I wrote this simple rc.d style script. > > > > Just throw it in /usr/local/etc/rc.d/ and do a chmod +x > > /usr/local/etc/rc.d/mongrel_cluster.sh > > > > To enable the script, add mongrel_cluster_enable="YES" to /etc/rc.conf > > and optionally add mongrel_cluster_config="/etc/mongrel_cluster" > > > > The default config path is /usr/local/etc/mongrel_cluster > > > > Would be nice if mongrel_cluster_ctl had some sort of "status" switch > > to see if the servers are actually running and what their pids are. > > > > Andrew Bennett > > potatosaladx at gmail.com > > > > _______________________________________________ > > 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 patcito at gmail.com Sun Nov 12 21:29:46 2006 From: patcito at gmail.com (Patrick Aljord) Date: Mon, 13 Nov 2006 03:29:46 +0100 Subject: [Mongrel] rails+apache2+mongrel_cluster Message-ID: <6b6419750611121829t55c34951qddedb771b89c1f6a@mail.gmail.com> hey all, I managed to configure a mongrel+apache2 but now I would like to do a mongrel_cluster. For now I have a sites-available/myapp but when it comes to mongrel_cluster I need to set up myapp.common, myapp.proxy_cluster.conf and myapp.proxy_frontend.conf and I couldn't find a tutorial that explain where should those file go. is it in conf.d or sites-available/ or else? thanx in advance. Pat From cbquinn at gmail.com Sun Nov 12 22:53:13 2006 From: cbquinn at gmail.com (Charles Brian Quinn) Date: Sun, 12 Nov 2006 22:53:13 -0500 Subject: [Mongrel] rails+apache2+mongrel_cluster In-Reply-To: <6b6419750611121829t55c34951qddedb771b89c1f6a@mail.gmail.com> References: <6b6419750611121829t55c34951qddedb771b89c1f6a@mail.gmail.com> Message-ID: <3a2de0cd0611121953y3b28ad60xb7f253bf62399933@mail.gmail.com> Patrick, have you seen: http://mongrel.rubyforge.org/docs/apache.html if you put in your apache2 conf somewhere to load a .conf file, and inside that file, if it says to include myapp.common, then it will load up all your directives. I always drop a line in my httpd.conf that looks like this: Include /etc/*.conf That way, any file that ends in .conf inside the /etc/ directory gets loaded by apache. A capistrano script like this one: http://svn.highgroove.com:8080/deployment/trunk/apache2_2_mongrel_deploy.rb will help you setup all those files. Simply run cap setup and point it at a box and it will do all the work for you. cheers On 11/12/06, Patrick Aljord wrote: > hey all, > I managed to configure a mongrel+apache2 but now I would like to do a > mongrel_cluster. For now I have a sites-available/myapp but when it > comes to mongrel_cluster I need to set up myapp.common, > myapp.proxy_cluster.conf and > myapp.proxy_frontend.conf and I couldn't find a tutorial that explain > where should those file go. is it in conf.d or sites-available/ or > else? > > thanx in advance. > > Pat > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com From stockliasteroid at gmail.com Mon Nov 13 02:57:48 2006 From: stockliasteroid at gmail.com (Matt White) Date: Mon, 13 Nov 2006 20:57:48 +1300 Subject: [Mongrel] mongrel_upload_progress question/possible suggestion Message-ID: <85f2e53f0611122357g2ff9080fv35171eeb16141993@mail.gmail.com> Hey all, First off, thanks to Rick Olson and whoever else was involved with this plugin... It's been amazingly easy to implement. I've got a question about the path_info parameter, though... It seems that unless the request PATH_INFO exactly matches the path_info passed in to the plugin at inclusion, it won't actually trigger Add and add the upload to the list of running transfers. I'm assuming that this is for performance reasons, and makes good sense. However, I'm in a situation where I don't know the exact path that I will b e uploading from, because of various routing info in my app. Thus, the ability for path_info to be a regex instead of just a string, thus allowing for: return unless params['PATH_INFO'] =~ @path_info && params[Mongrel::Const::REQUEST_METHOD] == 'POST' && upload_id = Mongrel::HttpRequest.query_parse (params['QUERY_STRING'])['upload_id'] Then I just update my handler like so: uri "/", :handler => plugin("/handlers/upload", :path_info => %r{/account/\d/\d/media/upload}), :in_front => true And everything works fine... It's a super-small tweak, obviously, but I found that it made it a lot easier for me to use the plugin. Thoughts? Is there a better way to do this? Matt -- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/7a62f41e/attachment-0001.html From brad at bradediger.com Mon Nov 13 10:58:30 2006 From: brad at bradediger.com (Brad Ediger) Date: Mon, 13 Nov 2006 09:58:30 -0600 Subject: [Mongrel] mongrel_upload_progress question/possible suggestion In-Reply-To: <85f2e53f0611122357g2ff9080fv35171eeb16141993@mail.gmail.com> References: <85f2e53f0611122357g2ff9080fv35171eeb16141993@mail.gmail.com> Message-ID: <1B8DF65B-F681-4E85-8CD6-0D5F29B00CEB@bradediger.com> I'm pretty sure that decision was made for performance reasons... nontrivial regexes take significantly more processing than string matching. If you have actual concerns about performance, you should always benchmark (http://mongrel.rubyforge.org/docs/ how_many_mongrels.html). I used an array for this purpose... you can say :path_info => ['one path', 'another path' ... ]. I think Zed checked my patch for that in to svn, and I'm pretty sure it's available in the 0.3.13.4 prerelease. Brad On Nov 13, 2006, at 1:57 AM, Matt White wrote: > Hey all, > > First off, thanks to Rick Olson and whoever else was involved with > this plugin... It's been amazingly easy to implement. > > I've got a question about the path_info parameter, though... It > seems that unless the request PATH_INFO exactly matches the > path_info passed in to the plugin at inclusion, it won't actually > trigger Add and add the upload to the list of running transfers. > I'm assuming that this is for performance reasons, and makes good > sense. However, I'm in a situation where I don't know the exact > path that I will b e uploading from, because of various routing > info in my app. > > Thus, the ability for path_info to be a regex instead of just a > string, thus allowing for: > > return unless params['PATH_INFO'] =~ @path_info && > params[Mongrel::Const::REQUEST_METHOD] == 'POST' && > upload_id = Mongrel::HttpRequest.query_parse(params > ['QUERY_STRING'])['upload_id'] > > Then I just update my handler like so: > > uri "/", > :handler => plugin("/handlers/upload", :path_info => %r{/account/ > \d/\d/media/upload}), > :in_front => true > > And everything works fine... It's a super-small tweak, obviously, > but I found that it made it a lot easier for me to use the plugin. > > Thoughts? Is there a better way to do this? > > Matt > > -- > Thermal Creative > http://blog.thermalcreative.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: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/bb6e0f84/attachment.html From sambient at gmail.com Mon Nov 13 13:16:39 2006 From: sambient at gmail.com (Dark Ambient) Date: Mon, 13 Nov 2006 11:16:39 -0700 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed Message-ID: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> I have a site that is PHP on Apache / RedHat , but will send requests to a subdomain (running Rails) for database operations. I believe the set up should be to have ROR using Mongrel, and an Apache virtual host passing requests from apache to mongrel. Does this sound correct ? I believe the Virtual Host is set up in Apache. One of my problems is I can't find the httpd.conf file for apache. Sounds strange. Currently Rails is in a folder under /var/www/html/railsapp However I see that the Rails app is configured to this path /home/virtual/site8/fst/var/www/html/railsapp. Any one know what I should be looking for on the Apache side ? TIA Stuart -- http://en.wikipedia.org/wiki/Dark_ambient -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/568f3986/attachment.html From runner at berkeley.edu Mon Nov 13 13:32:50 2006 From: runner at berkeley.edu (Steven Hansen) Date: Mon, 13 Nov 2006 10:32:50 -0800 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> Message-ID: <4558BA52.5070300@berkeley.edu> Sorry but it's not clear what you need help with. Do you just need to find the httpd.conf file? if you're on *nix machine, use the find command: find . -name httpd.conf Regards, Steven Dark Ambient wrote: > I have a site that is PHP on Apache / RedHat , but will send requests > to a subdomain (running Rails) for database operations. > I believe the set up should be to have ROR using Mongrel, and an > Apache virtual host passing requests from apache to mongrel. > Does this sound correct ? > I believe the Virtual Host is set up in Apache. > One of my problems is I can't find the httpd.conf file for apache. > Sounds strange. > Currently Rails is in a folder under /var/www/html/railsapp > > However I see that the Rails app is configured to this path > |/home/virtual/site8/fst/var/www/html/railsapp. > > Any one know what I should be looking for on the Apache side ? > > TIA > Stuart > | > > -- > http://en.wikipedia.org/wiki/Dark_ambient > ------------------------------------------------------------------------ > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From sambient at gmail.com Mon Nov 13 14:02:04 2006 From: sambient at gmail.com (Dark Ambient) Date: Mon, 13 Nov 2006 12:02:04 -0700 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> Message-ID: <8bd5d6760611131102s44a2be27n53dacd45d7e30fd2@mail.gmail.com> I just ran into one glitch , found out we're running Apache 2.0.54, so no mod_proxy_balance. Any workarounds for that ? Stuart On 11/13/06, Dark Ambient wrote: > > I have a site that is PHP on Apache / RedHat , but will send requests to a > subdomain (running Rails) for database operations. > I believe the set up should be to have ROR using Mongrel, and an Apache > virtual host passing requests from apache to mongrel. > Does this sound correct ? > I believe the Virtual Host is set up in Apache. > One of my problems is I can't find the httpd.conf file for apache. Sounds > strange. > Currently Rails is in a folder under /var/www/html/railsapp > > However I see that the Rails app is configured to this path > /home/virtual/site8/fst/var/www/html/railsapp. > > Any one know what I should be looking for on the Apache side ? > > TIA > Stuart > > > -- > http://en.wikipedia.org/wiki/Dark_ambient -- http://en.wikipedia.org/wiki/Dark_ambient -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/ad993431/attachment.html From david at vrensk.com Mon Nov 13 14:17:49 2006 From: david at vrensk.com (David Vrensk) Date: Mon, 13 Nov 2006 20:17:49 +0100 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> Message-ID: <81b453920611131117t17cfad04o6f71e8e371bcdc93@mail.gmail.com> On 11/13/06, Dark Ambient wrote: > > One of my problems is I can't find the httpd.conf file for apache. Sounds > strange. I assume then that the init.d or rc.d script that starts apache on boot does not specifiy a config file, but that apache uses the path that is compiled in. The only way I know to find that is to use strings(1). When I run strings /usr/sbin/httpd | grep '^/' I get -------- ... /home/buildcentos/rpmbuild/BUILD/httpd-2.0.52/server/config.c /dev/null /etc/httpd /home/buildcentos/rpmbuild/BUILD/httpd-2.0.52/server/vhost.c ... -------- The line "/etc/httpd" is the only line that even looks like a candidate, and it's correct for me. HTH, /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/dac9a968/attachment.html From stockliasteroid at gmail.com Mon Nov 13 14:33:51 2006 From: stockliasteroid at gmail.com (Matt White) Date: Tue, 14 Nov 2006 08:33:51 +1300 Subject: [Mongrel] mongrel_upload_progress question/possible suggestion In-Reply-To: <85f2e53f0611131125x421e82ffy3b6d3430bf5d369a@mail.gmail.com> References: <85f2e53f0611131125x421e82ffy3b6d3430bf5d369a@mail.gmail.com> Message-ID: <85f2e53f0611131133u5a8c1320x836286013b86e188@mail.gmail.com> Brad, Thanks for the reply... I'm going to do a bit of benchmarking to see how bad it is. My problem is that in my quest to stay DRY I have a few id's in my path, and so there really isn't any way to create an array of paths that has all of the possible combinations (at least, not before it's WAY worse than using regexes ;). I suppose I could create a controller that does nothing but handle uploads, though that wouldn't be as DRY. I didn't see your array testing code in the mongrel_upload_progress 0.2. That's the bit of code I updated, and I think that's in a different tree than Mongrel. Am I missing it? If I switch to a different routing layout, your method may be better, esp if it's faster. Thanks, Matt I'm pretty sure that decision was made for performance reasons... nontrivial > regexes take significantly more processing than string matching. If you have > actual concerns about performance, you should always benchmark ( > http://mongrel.rubyforge.org/docs/how_many_mongrels.html). > > I used an array for this purpose... you can say :path_info => ['one > path', 'another path' ... ]. I think Zed checked my patch for that in to > svn, and I'm pretty sure it's available in the 0.3.13.4 prerelease. > > Brad > > On Nov 13, 2006, at 1:57 AM, Matt White wrote: > > Hey all, > > First off, thanks to Rick Olson and whoever else was involved with this > plugin... It's been amazingly easy to implement. > > I've got a question about the path_info parameter, though... It seems that > unless the request PATH_INFO exactly matches the path_info passed in to the > plugin at inclusion, it won't actually trigger Add and add the upload to the > list of running transfers. I'm assuming that this is for performance > reasons, and makes good sense. However, I'm in a situation where I don't > know the exact path that I will b e uploading from, because of various > routing info in my app. > > Thus, the ability for path_info to be a regex instead of just a string, > thus allowing for: > > return unless params['PATH_INFO'] =~ path_info && > params[Mongrel::Const::REQUEST_METHOD] == 'POST' && > upload_id = Mongrel::HttpRequest.query_parse > (params['QUERY_STRING'])['upload_id'] > > Then I just update my handler like so: > > uri "/", > :handler => plugin("/handlers/upload", :path_info => > %r{/account/\d/\d/media/upload}), > :in_front => true > > And everything works fine... It's a super-small tweak, obviously, but I > found that it made it a lot easier for me to use the plugin. > > Thoughts? Is there a better way to do this? > > Matt > > -- > Thermal Creative > http://blog.thermalcreative.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users-GrnCvJ7WPxnNLxjTenLetw at public.gmane.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/594d7f4e/attachment-0001.html From eastmedianyc at gmail.com Mon Nov 13 14:46:24 2006 From: eastmedianyc at gmail.com (Matt Pelletier) Date: Mon, 13 Nov 2006 14:46:24 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> Message-ID: <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> Good news: I have been told by our publisher that the purchase process has now been simplified so that you no longer need to A) fill out a survey form or B) fill out a shipping address. These were the two most annoying aspects of the purchase process, so it should be smoother sailing now. If anyone hasn't bought the book yet but is planning to, please try out the purchase process now, and let me know whatever issues or annoyances you run into. You can start at the link below (I've pasted this one before): http://www.informit.com/title/0321483502 Matt On 11/5/06, Michael Moen wrote: > > > On Nov 5, 2006, at 12:43 PM, James Hughes wrote: > > I want the pdf, but I don't want to have to get a full safari > > subscription. I just want to pay the $14.99 and be on my way. Any > > hints? > > http://www.informit.com/bookstore/product.asp?isbn=9780321483508&rl=1 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/df337b54/attachment.html From sambient at gmail.com Mon Nov 13 14:55:06 2006 From: sambient at gmail.com (Dark Ambient) Date: Mon, 13 Nov 2006 12:55:06 -0700 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <81b453920611131117t17cfad04o6f71e8e371bcdc93@mail.gmail.com> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> <81b453920611131117t17cfad04o6f71e8e371bcdc93@mail.gmail.com> Message-ID: <8bd5d6760611131155o4fac2023m5a91a55a75b4f250@mail.gmail.com> On 11/13/06, David Vrensk wrote: > > On 11/13/06, Dark Ambient wrote: > > > > One of my problems is I can't find the httpd.conf file for apache. > > Sounds strange. > > > I assume then that the init.d or rc.d script that starts apache on boot > does not specifiy a config file, but that apache uses the path that is > compiled in. The only way I know to find that is to use strings(1). When I > run > > strings /usr/sbin/httpd | grep '^/' > > I get > -------- > ... > /home/buildcentos/rpmbuild/BUILD/httpd-2.0.52/server/config.c > /dev/null > /etc/httpd > /home/buildcentos/rpmbuild/BUILD/httpd-2.0.52/server/vhost.c > ... > -------- > > The line "/etc/httpd" is the only line that even looks like a candidate, > and it's correct for me. > > HTH, > > /David > Right, I found it , each virtual site has it's own conf file. Stuart -- http://en.wikipedia.org/wiki/Dark_ambient -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/f47a22c7/attachment.html From sambient at gmail.com Mon Nov 13 15:13:35 2006 From: sambient at gmail.com (Dark Ambient) Date: Mon, 13 Nov 2006 13:13:35 -0700 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <4558BA52.5070300@berkeley.edu> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> <4558BA52.5070300@berkeley.edu> Message-ID: <8bd5d6760611131213q5ca94a25v5ee5461bf7970581@mail.gmail.com> On 11/13/06, Steven Hansen wrote: > > > Sorry but it's not clear what you need help with. Do you just need to > find the httpd.conf file? > > if you're on *nix machine, use the find command: find . -name httpd.conf > > > Regards, > Steven Sorry, yes I did find the httpd.conf file and the include statement as to where the site's virtualhost file is. However the problem I'm facing now is Apache is at version 2.0.54. My understanding is that without mod_proxy_balancer I'll be at a loss of concurrent requests. Wanting to know if there is any workaround without upgrading Apache ? Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/4af4f90b/attachment.html From stockliasteroid at gmail.com Mon Nov 13 15:18:25 2006 From: stockliasteroid at gmail.com (Matt White) Date: Tue, 14 Nov 2006 09:18:25 +1300 Subject: [Mongrel] mongrel_upload_progress question/possible suggestion In-Reply-To: <1B8DF65B-F681-4E85-8CD6-0D5F29B00CEB@bradediger.com> References: <85f2e53f0611122357g2ff9080fv35171eeb16141993@mail.gmail.com> <1B8DF65B-F681-4E85-8CD6-0D5F29B00CEB@bradediger.com> Message-ID: <85f2e53f0611131218t5d6b6390x4d48cf2083c21891@mail.gmail.com> First off, sorry if this is a dupe. Having some mail issues... Anyway, Brad, Thanks for the reply... I'm going to do a bit of benchmarking to see how bad it is. My problem is that in my quest to stay DRY I have a few id's in my path, and so there really isn't any way to create an array of paths that has all of the possible combinations (at least, not before it's WAY worse than using regexes ;). I suppose I could create a controller that does nothing but handle uploads, though that wouldn't be as DRY. I didn't see your array testing code in the mongrel_upload_progress 0.2. That's the bit of code I updated, and I think that's in a different tree than Mongrel. Am I missing it? If I switch to a different routing layout, your method may be better, esp if it's faster. Thanks, Matt On 11/14/06, Brad Ediger wrote: > > I'm pretty sure that decision was made for performance reasons... > nontrivial regexes take significantly more processing than string matching. > If you have actual concerns about performance, you should always benchmark ( > http://mongrel.rubyforge.org/docs/how_many_mongrels.html). > > I used an array for this purpose... you can say :path_info => ['one path', > 'another path' ... ]. I think Zed checked my patch for that in to svn, and > I'm pretty sure it's available in the 0.3.13.4 prerelease. > > Brad > > On Nov 13, 2006, at 1:57 AM, Matt White wrote: > > Hey all, > > First off, thanks to Rick Olson and whoever else was involved with this > plugin... It's been amazingly easy to implement. > > I've got a question about the path_info parameter, though... It seems that > unless the request PATH_INFO exactly matches the path_info passed in to the > plugin at inclusion, it won't actually trigger Add and add the upload to the > list of running transfers. I'm assuming that this is for performance > reasons, and makes good sense. However, I'm in a situation where I don't > know the exact path that I will b e uploading from, because of various > routing info in my app. > > Thus, the ability for path_info to be a regex instead of just a string, > thus allowing for: > > return unless params['PATH_INFO'] =~ @path_info && > params[Mongrel::Const::REQUEST_METHOD] == 'POST' && > upload_id = Mongrel::HttpRequest.query_parse > (params['QUERY_STRING'])['upload_id'] > > Then I just update my handler like so: > > uri "/", > :handler => plugin("/handlers/upload", :path_info => > %r{/account/\d/\d/media/upload}), > :in_front => true > > And everything works fine... It's a super-small tweak, obviously, but I > found that it made it a lot easier for me to use the plugin. > > Thoughts? Is there a better way to do this? > > Matt > > -- > Thermal Creative > http://blog.thermalcreative.com > _______________________________________________ > 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 > > -- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/ce16d900/attachment.html From sambient at gmail.com Mon Nov 13 15:22:52 2006 From: sambient at gmail.com (Dark Ambient) Date: Mon, 13 Nov 2006 13:22:52 -0700 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> Message-ID: <8bd5d6760611131222n36c53a7ax40edfd6a711e2bf@mail.gmail.com> I actually added it to my safari.informit bookshelp this morning. It's part of the shortcuts line. Stuart On 11/13/06, Matt Pelletier wrote: > > Good news: I have been told by our publisher that the purchase process has > now been simplified so that you no longer need to A) fill out a survey form > or B) fill out a shipping address. These were the two most annoying aspects > of the purchase process, so it should be smoother sailing now. If anyone > hasn't bought the book yet but is planning to, please try out the purchase > process now, and let me know whatever issues or annoyances you run into. You > can start at the link below (I've pasted this one before): > > http://www.informit.com/title/0321483502 > > Matt > > On 11/5/06, Michael Moen < mi-mongrel at moensolutions.com> wrote: > > > > > > On Nov 5, 2006, at 12:43 PM, James Hughes wrote: > > > I want the pdf, but I don't want to have to get a full safari > > > subscription. I just want to pay the $14.99 and be on my way. Any > > > hints? > > > > http://www.informit.com/bookstore/product.asp?isbn=9780321483508&rl=1 > > _______________________________________________ > > 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 > > -- http://en.wikipedia.org/wiki/Dark_ambient -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/fe95e883/attachment-0001.html From brad at bradediger.com Mon Nov 13 15:54:24 2006 From: brad at bradediger.com (Brad Ediger) Date: Mon, 13 Nov 2006 14:54:24 -0600 Subject: [Mongrel] mongrel_upload_progress question/possible suggestion In-Reply-To: <85f2e53f0611131218t5d6b6390x4d48cf2083c21891@mail.gmail.com> References: <85f2e53f0611122357g2ff9080fv35171eeb16141993@mail.gmail.com> <1B8DF65B-F681-4E85-8CD6-0D5F29B00CEB@bradediger.com> <85f2e53f0611131218t5d6b6390x4d48cf2083c21891@mail.gmail.com> Message-ID: My mistake; I forgot that this was in the m_u_p gem, and I don't think it's been pushed to the gem servers yet. Try installing from this: http://mongrel.rubyforge.org/releases/gems/ mongrel_upload_progress-0.2.1.gem Brad On Nov 13, 2006, at 2:18 PM, Matt White wrote: > First off, sorry if this is a dupe. Having some mail issues... > > Anyway, > > Brad, > > Thanks for the reply... I'm going to do a bit of benchmarking to > see how bad it is. My problem is that in my quest to stay DRY I > have a few id's in my path, and so there really isn't any way to > create an array of paths that has all of the possible combinations > (at least, not before it's WAY worse than using regexes ;). I > suppose I could create a controller that does nothing but handle > uploads, though that wouldn't be as DRY. > > I didn't see your array testing code in the mongrel_upload_progress > 0.2. That's the bit of code I updated, and I think that's in a > different tree than Mongrel. Am I missing it? If I switch to a > different routing layout, your method may be better, esp if it's > faster. > > Thanks, > > Matt > > On 11/14/06, Brad Ediger wrote: > I'm pretty sure that decision was made for performance reasons... > nontrivial regexes take significantly more processing than string > matching. If you have actual concerns about performance, you should > always benchmark ( http://mongrel.rubyforge.org/docs/ > how_many_mongrels.html). > > I used an array for this purpose... you can say :path_info => ['one > path', 'another path' ... ]. I think Zed checked my patch for that > in to svn, and I'm pretty sure it's available in the 0.3.13.4 > prerelease. > > Brad > > On Nov 13, 2006, at 1:57 AM, Matt White wrote: > >> Hey all, >> >> First off, thanks to Rick Olson and whoever else was involved with >> this plugin... It's been amazingly easy to implement. >> >> I've got a question about the path_info parameter, though... It >> seems that unless the request PATH_INFO exactly matches the >> path_info passed in to the plugin at inclusion, it won't actually >> trigger Add and add the upload to the list of running transfers. >> I'm assuming that this is for performance reasons, and makes good >> sense. However, I'm in a situation where I don't know the exact >> path that I will b e uploading from, because of various routing >> info in my app. >> >> Thus, the ability for path_info to be a regex instead of just a >> string, thus allowing for: >> >> return unless params['PATH_INFO'] =~ @path_info && >> params[Mongrel::Const::REQUEST_METHOD] == 'POST' && >> upload_id = Mongrel::HttpRequest.query_parse(params >> ['QUERY_STRING'])['upload_id'] >> >> Then I just update my handler like so: >> >> uri "/", >> :handler => plugin("/handlers/upload", :path_info => %r{/account/ >> \d/\d/media/upload}), >> :in_front => true >> >> And everything works fine... It's a super-small tweak, obviously, >> but I found that it made it a lot easier for me to use the plugin. >> >> Thoughts? Is there a better way to do this? >> >> Matt >> >> -- >> Thermal Creative >> http://blog.thermalcreative.com >> _______________________________________________ >> 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 > > > > > -- > Thermal Creative > http://blog.thermalcreative.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: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/030ac87d/attachment.html From philippe.lachaise at gmail.com Mon Nov 13 16:14:49 2006 From: philippe.lachaise at gmail.com (philippe lachaise) Date: Mon, 13 Nov 2006 22:14:49 +0100 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> Message-ID: I just tried : couldn't avoid the forms barrage. Probably it is only in the process of being simplified at this point ... Anyway, thanks for keeping us informed, I'll try again promised :) Philippe. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/edec4a74/attachment.html From mmmaui at gmail.com Mon Nov 13 17:14:46 2006 From: mmmaui at gmail.com (Mark Uhrmacher) Date: Mon, 13 Nov 2006 17:14:46 -0500 Subject: [Mongrel] apache -> pen -> mongrel cluster Message-ID: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> Hi everyone, Recently, I've been reading about different deployment environments for rails and mongrel. One configuration I've started seeing is apache -> pen -> mongrel cluster. See http://errtheblog.com/post/35 as an example. Can someone explain to me the benefit of using Apache and Pen as opposed to either using apache as a load balancer or pen by itself? Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/c1b15a59/attachment.html From runner at berkeley.edu Mon Nov 13 17:36:10 2006 From: runner at berkeley.edu (Steven Hansen) Date: Mon, 13 Nov 2006 14:36:10 -0800 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <8bd5d6760611131102s44a2be27n53dacd45d7e30fd2@mail.gmail.com> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> <8bd5d6760611131102s44a2be27n53dacd45d7e30fd2@mail.gmail.com> Message-ID: <4558F35A.1010504@berkeley.edu> Sorry Stuart, I'm using 2.2.3 and don't know of any workaround for 2.0.x -Steven Dark Ambient wrote: > I just ran into one glitch , found out we're running Apache 2.0.54, so > no mod_proxy_balance. Any workarounds for that ? > > Stuart > > On 11/13/06, *Dark Ambient * > wrote: > > I have a site that is PHP on Apache / RedHat , but will send > requests to a subdomain (running Rails) for database operations. > I believe the set up should be to have ROR using Mongrel, and an > Apache virtual host passing requests from apache to mongrel. > Does this sound correct ? > I believe the Virtual Host is set up in Apache. > One of my problems is I can't find the httpd.conf file for > apache. Sounds strange. > Currently Rails is in a folder under /var/www/html/railsapp > > However I see that the Rails app is configured to this path > |/home/virtual/site8/fst/var/www/html/railsapp. > > Any one know what I should be looking for on the Apache side ? > > TIA > Stuart > | > > -- > http://en.wikipedia.org/wiki/Dark_ambient > > > > > -- > http://en.wikipedia.org/wiki/Dark_ambient > ------------------------------------------------------------------------ > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From wmacfarl at gmail.com Mon Nov 13 17:52:16 2006 From: wmacfarl at gmail.com (William Macfarlane) Date: Mon, 13 Nov 2006 17:52:16 -0500 Subject: [Mongrel] mongrel upload progress and nginx In-Reply-To: <4514535e0611131300o426ac54cvbf7b18de4389fe17@mail.gmail.com> References: <4514535e0611131300o426ac54cvbf7b18de4389fe17@mail.gmail.com> Message-ID: <4514535e0611131452j26d31b9ei42da36483c446b5@mail.gmail.com> Does anyone know whether the mongrel upload progress plugin works with nginx? It works fine for my app under pound, but not with nginx. I am using DRb to handle the uploads as detailed at http://mongrel.rubyforge.org/docs/upload_progress.html . If I am using pound I can see the uploads with irb -r lib/upload_client.rb , but cannot if I am using nginx. Does anyone know anything more about this behavior or a possible solution? thanks, From patcito at gmail.com Mon Nov 13 18:17:19 2006 From: patcito at gmail.com (Patrick Aljord) Date: Tue, 14 Nov 2006 00:17:19 +0100 Subject: [Mongrel] Service Temporarily Unavailable when using apache Message-ID: <6b6419750611131517x6cd5048sde19bde7847edcec@mail.gmail.com> hey all, I'm trying to do a mongrel_cluster+apache2 config. this is my testapp.conf: Include /etc/apache2/conf.d/testapp.common # ErrorLog logs/testapp_errors_log # CustomLog logs/testapp_log combined this is my testapp.common: ServerName myapp.com DocumentRoot /home/patcito/testapp/public/ Options FollowSymLinks AllowOverride None Order allow,deny Allow from all RewriteEngine On # Make sure people go to www.myapp.com, not myapp.com RewriteCond %{HTTP_HOST} ^myapp.com$ [NC] RewriteRule ^(.*)$ http://www.myapp.com$1 [R=301,L] # Yes, I've read no-www.com, but my site already has much Google-Fu on # www.blah.com. Feel free to comment this out. # Uncomment for rewrite debugging #RewriteLog logs/myapp_rewrite_log #RewriteLogLevel 9 # Check for maintenance file and redirect all requests RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Rewrite index to check for static RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached page RewriteRule ^([^.]+)$ $1.html [QSA] # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] and this is my testapp.proxy_cluster.conf: BalancerMember http://127.0.0.1:8000 BalancerMember http://127.0.0.1:8001 BalancerMember http://127.0.0.1:8002 now when I start my mongrel_cluster I get the index page but I get a Service Temporarily Unavailable when I click on the pink box to check my environment. Looking at my mongrel log I get that: /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- /etc/mongrel_cluster/config/environment (LoadError) this is what my testapp.yml contains: --- log_file: /home/patcito/testapp/log/mongrel.log port: "8000" environment: development address: xx.yy.zz.tt pid_file: /home/patcito/testapp/log/mongrel.pid servers: 3 docroot: /home/patcito/testapp/public any idea what I did wrong? thanx in advance Pat From stockliasteroid at gmail.com Mon Nov 13 19:22:58 2006 From: stockliasteroid at gmail.com (Matt White) Date: Tue, 14 Nov 2006 13:22:58 +1300 Subject: [Mongrel] apache -> pen -> mongrel cluster In-Reply-To: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> References: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> Message-ID: <85f2e53f0611131622u7a1bf955ja8aa349c3edfe54e@mail.gmail.com> Mark, In my case, I did that because I don't have Apache 2.2 installed, but I wanted to use Apache for vhosting. So, I use the mod_proxy built into Apache to route among my various apps and static sites on the machine, and in the case of an app with mongrel_cluster I front it with Pen and route the requests to Pen and on to mongrel_cluster. Pen is just so easy to use... I was using Pound previously, but I haven't been very impressed with Pound's configuration options. And when it goes wrong it's hard to tell why. In the future I might chuck Pen in favor of _balancer, but I've been avoiding dealing with installing Apache2.2 from Debian Experimental or compiling from source. So far the setup seems to work fine, but it would be nice to have the extra layer out of there just for ease of management. Once Lighty goes 1.5 I might go back to that, as well. Matt On 11/14/06, Mark Uhrmacher wrote: > > Hi everyone, > > Recently, I've been reading about different deployment environments for > rails and mongrel. One configuration I've started seeing is apache -> pen > -> mongrel cluster. See http://errtheblog.com/post/35 as an example. > > Can someone explain to me the benefit of using Apache and Pen as opposed > to either using apache as a load balancer or pen by itself? > > Thanks, > > Mark > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/1681a92c/attachment.html From stockliasteroid at gmail.com Mon Nov 13 20:23:22 2006 From: stockliasteroid at gmail.com (Matt White) Date: Tue, 14 Nov 2006 14:23:22 +1300 Subject: [Mongrel] mongrel_upload_progress question/possible suggestion In-Reply-To: References: <85f2e53f0611122357g2ff9080fv35171eeb16141993@mail.gmail.com> <1B8DF65B-F681-4E85-8CD6-0D5F29B00CEB@bradediger.com> <85f2e53f0611131218t5d6b6390x4d48cf2083c21891@mail.gmail.com> Message-ID: <85f2e53f0611131723o63f5a14ct9c140f6da58382f6@mail.gmail.com> Brad (and anyone else), This is what I finally came up with: def upload_notify(action, params, *args) return unless @path_info.any? { |ptrn| ptrn.is_a?(Regexp) ? params['PATH_INFO'] =~ ptrn : params['PATH_INFO'] == ptrn } && params[Mongrel::Const::REQUEST_METHOD] == 'POST' && upload_id = Mongrel::HttpRequest.query_parse (params['QUERY_STRING'])['upload_id'] if action == :mark last_checked_time = Mongrel:: Uploads.last_checked(upload_id) return unless last_checked_time && Time.now - last_checked_time > @frequency end Mongrel::Uploads.send(action, upload_id, *args) Mongrel::Uploads.update_checked_time (upload_id) unless action == :finish end Basically, if it finds a Regexp in the path array it will do a pattern match. Otherwise it will just do the original string equality check. This should have the least performance impact possible while still allowing you to do regex if you so desire. I tested it with httperf and it seemed to have no effect on performance compared to 0.2 and 0.2.1. Thoughts? Matt On 11/14/06, Brad Ediger wrote: > > My mistake; I forgot that this was in the m_u_p gem, and I don't think > it's been pushed to the gem servers yet. Try installing from this: > > http://mongrel.rubyforge.org/releases/gems/mongrel_upload_progress-0.2.1.gem > > Brad > > On Nov 13, 2006, at 2:18 PM, Matt White wrote: > > First off, sorry if this is a dupe. Having some mail issues... > > Anyway, > > Brad, > > Thanks for the reply... I'm going to do a bit of benchmarking to see how > bad it is. My problem is that in my quest to stay DRY I have a few id's in > my path, and so there really isn't any way to create an array of paths that > has all of the possible combinations (at least, not before it's WAY worse > than using regexes ;). I suppose I could create a controller that does > nothing but handle uploads, though that wouldn't be as DRY. > > I didn't see your array testing code in the mongrel_upload_progress 0.2. > That's the bit of code I updated, and I think that's in a different tree > than Mongrel. Am I missing it? If I switch to a different routing layout, > your method may be better, esp if it's faster. > > Thanks, > > Matt > > On 11/14/06, Brad Ediger wrote: > > > > I'm pretty sure that decision was made for performance reasons... > > nontrivial regexes take significantly more processing than string matching. > > If you have actual concerns about performance, you should always benchmark (http://mongrel.rubyforge.org/docs/how_many_mongrels.html > > ). > > > > I used an array for this purpose... you can say :path_info => ['one > > path', 'another path' ... ]. I think Zed checked my patch for that in to > > svn, and I'm pretty sure it's available in the 0.3.13.4 prerelease. > > > > Brad > > > > On Nov 13, 2006, at 1:57 AM, Matt White wrote: > > > > Hey all, > > > > First off, thanks to Rick Olson and whoever else was involved with this > > plugin... It's been amazingly easy to implement. > > > > I've got a question about the path_info parameter, though... It seems > > that unless the request PATH_INFO exactly matches the path_info passed in to > > the plugin at inclusion, it won't actually trigger Add and add the upload to > > the list of running transfers. I'm assuming that this is for performance > > reasons, and makes good sense. However, I'm in a situation where I don't > > know the exact path that I will b e uploading from, because of various > > routing info in my app. > > > > Thus, the ability for path_info to be a regex instead of just a string, > > thus allowing for: > > > > return unless params['PATH_INFO'] =~ @path_info && > > params[Mongrel::Const::REQUEST_METHOD] == 'POST' && > > upload_id = Mongrel::HttpRequest.query_parse > > (params['QUERY_STRING'])['upload_id'] > > > > Then I just update my handler like so: > > > > uri "/", > > :handler => plugin("/handlers/upload", :path_info => > > %r{/account/\d/\d/media/upload}), > > :in_front => true > > > > And everything works fine... It's a super-small tweak, obviously, but I > > found that it made it a lot easier for me to use the plugin. > > > > Thoughts? Is there a better way to do this? > > > > Matt > > > > -- > > Thermal Creative > > http://blog.thermalcreative.com > > _______________________________________________ > > 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 > > > > > > > -- > Thermal Creative > http://blog.thermalcreative.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > > -- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/900c7e15/attachment.html From brad at bradediger.com Mon Nov 13 21:17:47 2006 From: brad at bradediger.com (Brad Ediger) Date: Mon, 13 Nov 2006 20:17:47 -0600 Subject: [Mongrel] mongrel_upload_progress question/possible suggestion In-Reply-To: <85f2e53f0611131723o63f5a14ct9c140f6da58382f6@mail.gmail.com> References: <85f2e53f0611122357g2ff9080fv35171eeb16141993@mail.gmail.com> <1B8DF65B-F681-4E85-8CD6-0D5F29B00CEB@bradediger.com> <85f2e53f0611131218t5d6b6390x4d48cf2083c21891@mail.gmail.com> <85f2e53f0611131723o63f5a14ct9c140f6da58382f6@mail.gmail.com> Message-ID: <74BF51F5-D916-4B1B-9A04-20BD70A9EC14@bradediger.com> Looks nice. Glad to hear it's working well. On Nov 13, 2006, at 7:23 PM, Matt White wrote: > Brad (and anyone else), > > This is what I finally came up with: > > def upload_notify(action, params, *args) > return unless @path_info.any? { |ptrn| ptrn.is_a?(Regexp) ? > params['PATH_INFO'] =~ ptrn : params['PATH_INFO'] == ptrn } && > params[Mongrel::Const::REQUEST_METHOD] == 'POST' && > upload_id = Mongrel::HttpRequest.query_parse(params > ['QUERY_STRING'])['upload_id'] > if action == :mark > last_checked_time = Mongrel:: Uploads.last_checked(upload_id) > return unless last_checked_time && Time.now - > last_checked_time > @frequency > end > Mongrel::Uploads.send(action, upload_id, *args) > Mongrel:: Uploads.update_checked_time (upload_id) unless > action == :finish > end > > Basically, if it finds a Regexp in the path array it will do a > pattern match. Otherwise it will just do the original string > equality check. This should have the least performance impact > possible while still allowing you to do regex if you so desire. > > I tested it with httperf and it seemed to have no effect on > performance compared to 0.2 and 0.2.1. > > Thoughts? > > Matt > > On 11/14/06, Brad Ediger wrote: > My mistake; I forgot that this was in the m_u_p gem, and I don't > think it's been pushed to the gem servers yet. Try installing from > this: > > http://mongrel.rubyforge.org/releases/gems/ > mongrel_upload_progress-0.2.1.gem > > Brad > > On Nov 13, 2006, at 2:18 PM, Matt White wrote: > >> First off, sorry if this is a dupe. Having some mail issues... >> >> Anyway, >> >> Brad, >> >> Thanks for the reply... I'm going to do a bit of benchmarking to >> see how bad it is. My problem is that in my quest to stay DRY I >> have a few id's in my path, and so there really isn't any way to >> create an array of paths that has all of the possible combinations >> (at least, not before it's WAY worse than using regexes ;). I >> suppose I could create a controller that does nothing but handle >> uploads, though that wouldn't be as DRY. >> >> I didn't see your array testing code in the >> mongrel_upload_progress 0.2. That's the bit of code I updated, and >> I think that's in a different tree than Mongrel. Am I missing it? >> If I switch to a different routing layout, your method may be >> better, esp if it's faster. >> >> Thanks, >> >> Matt >> >> On 11/14/06, Brad Ediger < brad at bradediger.com> wrote: >> I'm pretty sure that decision was made for performance reasons... >> nontrivial regexes take significantly more processing than string >> matching. If you have actual concerns about performance, you >> should always benchmark ( http://mongrel.rubyforge.org/docs/ >> how_many_mongrels.html). >> >> I used an array for this purpose... you can say :path_info => >> ['one path', 'another path' ... ]. I think Zed checked my patch >> for that in to svn, and I'm pretty sure it's available in the >> 0.3.13.4 prerelease. >> >> Brad >> >> On Nov 13, 2006, at 1:57 AM, Matt White wrote: >> >>> Hey all, >>> >>> First off, thanks to Rick Olson and whoever else was involved >>> with this plugin... It's been amazingly easy to implement. >>> >>> I've got a question about the path_info parameter, though... It >>> seems that unless the request PATH_INFO exactly matches the >>> path_info passed in to the plugin at inclusion, it won't actually >>> trigger Add and add the upload to the list of running transfers. >>> I'm assuming that this is for performance reasons, and makes good >>> sense. However, I'm in a situation where I don't know the exact >>> path that I will b e uploading from, because of various routing >>> info in my app. >>> >>> Thus, the ability for path_info to be a regex instead of just a >>> string, thus allowing for: >>> >>> return unless params['PATH_INFO'] =~ @path_info && >>> params[Mongrel::Const::REQUEST_METHOD] == 'POST' && >>> upload_id = Mongrel::HttpRequest.query_parse(params >>> ['QUERY_STRING'])['upload_id'] >>> >>> Then I just update my handler like so: >>> >>> uri "/", >>> :handler => plugin("/handlers/upload", :path_info => %r{/ >>> account/\d/\d/media/upload}), >>> :in_front => true >>> >>> And everything works fine... It's a super-small tweak, obviously, >>> but I found that it made it a lot easier for me to use the plugin. >>> >>> Thoughts? Is there a better way to do this? >>> >>> Matt >>> >>> -- >>> Thermal Creative >>> http://blog.thermalcreative.com >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> Thermal Creative >> http://blog.thermalcreative.com >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > -- > Thermal Creative > http://blog.thermalcreative.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: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/062dd7f0/attachment-0001.html From coda.hale at gmail.com Mon Nov 13 21:20:25 2006 From: coda.hale at gmail.com (Coda Hale) Date: Mon, 13 Nov 2006 18:20:25 -0800 Subject: [Mongrel] apache -> pen -> mongrel cluster In-Reply-To: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> References: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> Message-ID: On 11/13/06, Mark Uhrmacher wrote: > Can someone explain to me the benefit of using Apache and Pen as opposed to > either using apache as a load balancer or pen by itself? I'm on the Apache 2.0 + Pen + Mongrel bandwagon, mainly because Debian Sarge doesn't have Apache 2.2 yet, and I seriously don't feel like trying to manage a mess of hand-compiled applications across a server cluster. Instead, I watch the Debian Security RSS feed and run a Capistrano task if I see anything I recognize. The main benefit for running a proper web server like Apache up front is that you can configure it with mod_rewrite to serve up static files and only proxy dynamic requests. Mongrel is awesome, but Apache's much better at serving static files. Also, Apache has mod_security, well-developed SSL capabilities, and there's a wealth of information available on configuration and management. I'd love to use Lighty, but until it gets better proxying and rewrite modules (I heart disable_web), I'm sticking with Apache. Pound and Pen are very similar, and the main difference in when to use them is on what side of the web server they go on. Pound works best in front of web servers, mainly because you cannot disable the X_FORWARDED_FOR header. If you use it behind Apache, then Rails all requests to be requests from localhost, and so on an unhandled exception Rails farts out a full debug message to all and sundry. Pen, by default, doesn't add this header (optionally it can), and so it makes for a wonderful intermediary between Apache and your Mongrel cluster. I had to switch from Pound to Pen because of the local request problem, and Pen's handled all of the load testing just fine. It even allows you to specify a maximum concurrent connection limit for each server, so you don't get a bunch of requests queued up in Mongrel and mess your load balancing up. The one down side to Pen is that the version in Debian stable doesn't read from any kind of config file, nor does it come with a service script. So I had to write my own. You can get it at http://blog.codahale.com/2006/11/07/pound-vs-pen-because-you-need-a-load-balancing-proxy/ Right now Apache 2.0 + Pen + Mongrel is working like a charm, and I would only consider switching for four reasons: 1. Mongrel becomes stupid-fast with static files. 2. Apache 2.2 makes it into Debian Unstable. 3. Lighty's proxy and rewrite module stop sucking and it makes it into Debian Unstable. 4. I get a hardware load balancer and a couple of Lighty-based asset hosts. Until then, I'm doin' fine. -- Coda Hale http://www.wesabe.com http://blog.wesabe.com http://blog.codahale.com From chris at octopod.info Mon Nov 13 17:30:34 2006 From: chris at octopod.info (Chris McGrath) Date: Mon, 13 Nov 2006 22:30:34 +0000 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> Message-ID: On 13 Nov 2006, at 19:46, Matt Pelletier wrote: > Good news: I have been told by our publisher that the purchase > process has now been simplified so that you no longer need to A) > fill out a survey form or B) fill out a shipping address. These > were the two most annoying aspects of the purchase process, so it > should be smoother sailing now. If anyone hasn't bought the book > yet but is planning to, please try out the purchase process now, > and let me know whatever issues or annoyances you run into. You can > start at the link below (I've pasted this one before): > > http://www.informit.com/title/0321483502 > Just bought it, took all of two minutes. Looking forward to reading it now :) Cheers, Chris The shop fonts are very small in Camino ... sorry! :) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/1ac2e1df/attachment.html From zedshaw at zedshaw.com Tue Nov 14 01:51:45 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 14 Nov 2006 01:51:45 -0500 Subject: [Mongrel] mongrel upload progress and nginx In-Reply-To: <4514535e0611131452j26d31b9ei42da36483c446b5@mail.gmail.com> References: <4514535e0611131300o426ac54cvbf7b18de4389fe17@mail.gmail.com> <4514535e0611131452j26d31b9ei42da36483c446b5@mail.gmail.com> Message-ID: <20061114015145.378720a6.zedshaw@zedshaw.com> On Mon, 13 Nov 2006 17:52:16 -0500 "William Macfarlane" wrote: > Does anyone know whether the mongrel upload progress plugin works with > nginx? It works fine for my app under pound, but not with nginx. > > I am using DRb to handle the uploads as detailed at > http://mongrel.rubyforge.org/docs/upload_progress.html . > > If I am using pound I can see the uploads with irb -r > lib/upload_client.rb , but cannot if I am using nginx. > > Does anyone know anything more about this behavior or a possible solution? nginx does buffer the whole request body before sending it to the backends. This is why pound, pen, or balance works but nginx doesn't when you do upload progress. Pretty much the only solution is to put the uploading part on a different box or port and run it directly or behind pound. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From al-mongrelusers at none.at Tue Nov 14 03:11:14 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Tue, 14 Nov 2006 09:11:14 +0100 Subject: [Mongrel] mongrel upload progress and nginx In-Reply-To: <20061114015145.378720a6.zedshaw@zedshaw.com> References: <4514535e0611131300o426ac54cvbf7b18de4389fe17@mail.gmail.com> <4514535e0611131452j26d31b9ei42da36483c446b5@mail.gmail.com> <20061114015145.378720a6.zedshaw@zedshaw.com> Message-ID: <20061114081114.GA13218@none.at> On Die 14.11.2006 01:51, Zed A. Shaw wrote: >On Mon, 13 Nov 2006 17:52:16 -0500 >"William Macfarlane" wrote: > >> Does anyone know whether the mongrel upload progress plugin works with >> nginx? It works fine for my app under pound, but not with nginx. [snipp] >> Does anyone know anything more about this behavior or a possible solution? > >nginx does buffer the whole request body before sending it to the >backends. This is why pound, pen, or balance works but nginx doesn't >when you do upload progress. Pretty much the only solution is to put >the uploading part on a different box or port and run it directly or >behind pound. Yep, maybe in the future this feature could be deactivated. Please stay tuned, I will say if this will be changed. Regards Aleks From kraemer at webit.de Tue Nov 14 03:42:16 2006 From: kraemer at webit.de (Jens Kraemer) Date: Tue, 14 Nov 2006 09:42:16 +0100 Subject: [Mongrel] apache -> pen -> mongrel cluster In-Reply-To: <85f2e53f0611131622u7a1bf955ja8aa349c3edfe54e@mail.gmail.com> References: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> <85f2e53f0611131622u7a1bf955ja8aa349c3edfe54e@mail.gmail.com> Message-ID: <20061114084216.GD639@cordoba.webit.de> On Tue, Nov 14, 2006 at 01:22:58PM +1300, Matt White wrote: > Mark, > > In my case, I did that because I don't have Apache 2.2 installed, but I > wanted to use Apache for vhosting. So, I use the mod_proxy built into Apache > to route among my various apps and static sites on the machine, and in the > case of an app with mongrel_cluster I front it with Pen and route the > requests to Pen and on to mongrel_cluster. Pen is just so easy to use... I same here, I use Debian stable, Apache 2.0 (because there's no 2.2 in stable) and Pen as a mod_proxy_balancer replacement. works great, and I think I'll keep it untill next stable comes out. If Apache 2.2 would be available in Debian Sarge, I'd use it's mod_proxy_balancer instead, no question ;-) Jens -- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66 From eastmedianyc at gmail.com Tue Nov 14 03:42:38 2006 From: eastmedianyc at gmail.com (Matt Pelletier) Date: Tue, 14 Nov 2006 03:42:38 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> Message-ID: <96af85420611140042p3a363a8bo3938ee1767feef46@mail.gmail.com> On 11/13/06, philippe lachaise wrote: > > I just tried : couldn't avoid the forms barrage. > Probably it is only in the process of being simplified at this point ... Philippe, Can you be specific about which forms you're seeing? Are you entering through the InformIT link? The more detail you can provide the better so we can make sure we're addressing the issues properly. Thanks! Matt Anyway, thanks for keeping us informed, > I'll try again promised :) > > Philippe. > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/b024fba4/attachment.html From ms at pccl.info Tue Nov 14 05:41:18 2006 From: ms at pccl.info (Mark Somerville) Date: Tue, 14 Nov 2006 10:41:18 +0000 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <8bd5d6760611131102s44a2be27n53dacd45d7e30fd2@mail.gmail.com> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> <8bd5d6760611131102s44a2be27n53dacd45d7e30fd2@mail.gmail.com> Message-ID: <200611141041.18346.ms@pccl.info> Hi Stuart, On Monday 13 November 2006 19:02, Dark Ambient wrote: > I just ran into one glitch , found out we're running Apache 2.0.54, so no > mod_proxy_balance. Any workarounds for that ? Since we're using RHEL 4 (and cannot install things from source, for various reasons), I recently setup Apache 2.0.x to use a mongrel cluster just by using mod_proxy to randomise requests between the various mongrels. It's not as good as real load balancing (and, we haven't really tested it properly yet - comments very welcome!), but it certainly seems like the best option so far if you're not able to install Pen/Pound/Apache 2.2... For example, start three mongrels on 8000-8002, then something like this in your vhost should sort you out, but definitely read the manual: ProxyRequests Off ProxyPreserveHost On RewriteMap servers rnd:///path/to/rewrite_map.conf RewriteRule ^/(images|stylesheets|javascripts)/?(.*) $0 [L] RewriteRule ^/(.*)$ http://localhost:${servers:ports}/$1 [P,L] rewrite_map.conf: ports 8000|8001|8002 Mark > > Stuart > > On 11/13/06, Dark Ambient wrote: > > I have a site that is PHP on Apache / RedHat , but will send requests to > > a subdomain (running Rails) for database operations. > > I believe the set up should be to have ROR using Mongrel, and an Apache > > virtual host passing requests from apache to mongrel. > > Does this sound correct ? > > I believe the Virtual Host is set up in Apache. > > One of my problems is I can't find the httpd.conf file for apache. > > Sounds strange. > > Currently Rails is in a folder under /var/www/html/railsapp > > > > However I see that the Rails app is configured to this path > > /home/virtual/site8/fst/var/www/html/railsapp. > > > > Any one know what I should be looking for on the Apache side ? > > > > TIA > > Stuart > > > > > > -- > > http://en.wikipedia.org/wiki/Dark_ambient From philippe.lachaise at gmail.com Tue Nov 14 08:21:31 2006 From: philippe.lachaise at gmail.com (philippe lachaise) Date: Tue, 14 Nov 2006 14:21:31 +0100 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <96af85420611140042p3a363a8bo3938ee1767feef46@mail.gmail.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> <765a2c230611051243t519f7438hfe4957c64eb81476@mail.gmail.com> <757AA06C-DFB2-4176-AE98-FCF394A1EEF7@moensolutions.com> <96af85420611131146h4ce3df23k8aa54b51b503b97@mail.gmail.com> <96af85420611140042p3a363a8bo3938ee1767feef46@mail.gmail.com> Message-ID: Following http://www.informit.com/title/0321483502 brings me there : http://www.informit.com/bookstore/product.asp?isbn=0321483502&rl=1 >From where I can see no other option than "Add to Cart" (my cart contains 3 copies by now) "Proceed to Checkout" takes me to "Billing & Shipping Address" (1/4) Am I missing something ? Regards, Philippe. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/1ba6f3f8/attachment.html From sl at killefiz.de Tue Nov 14 08:35:59 2006 From: sl at killefiz.de (Sven Lankes) Date: Tue, 14 Nov 2006 14:35:59 +0100 Subject: [Mongrel] apache -> pen -> mongrel cluster In-Reply-To: <85f2e53f0611131622u7a1bf955ja8aa349c3edfe54e@mail.gmail.com> References: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> <85f2e53f0611131622u7a1bf955ja8aa349c3edfe54e@mail.gmail.com> Message-ID: <20061114133559.GC17381@yuio.de> On Tue, Nov 14, 2006 at 01:22:58PM +1300, Matt White wrote: > In the future I might chuck Pen in favor of _balancer, but I've been > avoiding dealing with installing Apache2.2 from Debian Experimental or > compiling from source. Apache 2.2 is in Debian etch now. I'm running etch with apache2.2 on one machine with _balancer and mongrel and it works well for two rails-apps. -- sven From clint at ctro.net Tue Nov 14 14:08:29 2006 From: clint at ctro.net (Clint Troxel) Date: Tue, 14 Nov 2006 12:08:29 -0700 Subject: [Mongrel] memory issues -- mongrel part of the problem? Message-ID: Hi. I'm a fairly new mongrel user and have a scenario that I wanted to run by you all, see if anyone's synapses connect -- mine def. aren't! I'm running a fairly simple rails app through a mongrel cluster (2 mongrels). This site is consistently sloooow -- memory on the server is regularly paging (and shouldn't be). ssh-ing in and running top shows these two mongrel processes taking up about 80% of the 1 gig of system memory. the only interesting thing the application is doing is storing photos in the database and resizing the photos on the way out using mini_magick. Once the photos are delivered once they are cached using rails page caching (i'm positive the caching is working, production.log says so). So, at this point the site should only be delivering images from the cache (which is currently on disk) apache isn't serving the images, mongrel is. -- but, things are slow. Does this ring any bells for anyone? you can check the site out (don't pound too hard please! ;) ) http://prughrealestate.com click on the "developments" tab to see what i mean -- those thumbnail images are coming from the cache. Also: Server : Fedora Core 5 Mongrel: 0.3.13.3 mongrel_cluster: 0.2.0 I'm eternally grateful to anyone who can help me out with this! Sort of at the end of my rope. Thanks in advance, & hope your Tuesday is good. Clint -- clint troxel _ Open End Studios _ 307.413.0366 http://openendstudios.com From andre.lewis at gmail.com Tue Nov 14 14:50:57 2006 From: andre.lewis at gmail.com (Andre Lewis) Date: Tue, 14 Nov 2006 11:50:57 -0800 Subject: [Mongrel] apache -> pen -> mongrel cluster In-Reply-To: <20061114133559.GC17381@yuio.de> References: <00c101c70771$214afd50$6a01a8c0@MauiLaptop> <85f2e53f0611131622u7a1bf955ja8aa349c3edfe54e@mail.gmail.com> <20061114133559.GC17381@yuio.de> Message-ID: <3007ac150611141150h373abb22x70716082ef6b50fb@mail.gmail.com> > > Recently, I've been reading about different deployment environments for > rails and mongrel. One configuration I've started seeing is apache -> pen > -> mongrel cluster. See http://errtheblog.com/post/35 as an example. > > Can someone explain to me the benefit of using Apache and Pen as opposed > to either using apache as a load balancer or pen by itself? > I have production environments with both apache2->pen->mongrel and apache2.2w/proxy_balancer->mongrel. I prefer the latter, for two reasons: 1) I like having fewer moving parts. That said, Pen has never, ever had a problem in my environment. 2) For the 2.2 w/mod_proxey_balancer setup, I'm using Charles Quinn's customized deploy.rb to manage vhost setup and app deployment. I highly recommend it: http://svn.highgroove.com:8080/deployment/trunk/apache2_2_mongrel_deploy.rb. You can setup a new vhost and Rails app with a single command. Also, the server layout it utilizes (where it puts your apps, the vhost configs, etc) just makes sense. Andre -- andre.lewis at gmail.com My tech blog: http://earthcode.com WiFi cafes: http://hotspotr.com/wifi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/3a52ece0/attachment.html From jan.svitok at gmail.com Tue Nov 14 19:24:29 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Wed, 15 Nov 2006 01:24:29 +0100 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: Message-ID: <8d9b3d920611141624t4ebc07a1jdb0c98a000532c5e@mail.gmail.com> On 11/14/06, Clint Troxel wrote: > Hi. I'm a fairly new mongrel user and have a scenario that I wanted > to run by you all, see if anyone's synapses connect -- mine def. > aren't! > > I'm running a fairly simple rails app through a mongrel cluster (2 > mongrels). This site is consistently sloooow -- memory on the server > is regularly paging (and shouldn't be). ssh-ing in and running top > shows these two mongrel processes taking up about 80% of the 1 gig of > system memory. > > the only interesting thing the application is doing is storing photos > in the database and resizing the photos on the way out using > mini_magick. Once the photos are delivered once they are cached using > rails page caching (i'm positive the caching is working, > production.log says so). > > So, at this point the site should only be delivering images from the > cache (which is currently on disk) apache isn't serving the images, > mongrel is. -- but, things are slow. Does this ring any bells for > anyone? > > you can check the site out (don't pound too hard please! ;) ) > http://prughrealestate.com > click on the "developments" tab to see what i mean -- those thumbnail > images are coming from the cache. > > Also: > Server : Fedora Core 5 > Mongrel: 0.3.13.3 > mongrel_cluster: 0.2.0 > > I'm eternally grateful to anyone who can help me out with this! Sort > of at the end of my rope. > Thanks in advance, & hope your Tuesday is good. Hi, from what I've heard, it's better to have apache serve the files - it's faster and doesn't interfere with ruby's garbage collector. Then, I'd suspect the resizing eats the memory and slows down. To know the precise number, try profiling it, both outside and inside mongrel and rails. Look for some forgotten reference to the image. Also look for the trends - whether memory consumption grows (you have a leak or hanging reference somewhere) or oscillates. From rgkaufman at gmail.com Tue Nov 14 20:05:32 2006 From: rgkaufman at gmail.com (Rob Kaufman) Date: Tue, 14 Nov 2006 17:05:32 -0800 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: Message-ID: <17112e2f0611141705t250eada4t2acdf7e55592fdf5@mail.gmail.com> Hi Clint, Yes Mongrel did have memory issues back at 0.13.3 Please upgrade and keep an eye on each mongrel to see if it develops a memory growth trend. If you search this forum there are posts by Zed and others as to how to do said monitoring. Good Luck, Rob Kaufman On 11/14/06, Clint Troxel wrote: > Hi. I'm a fairly new mongrel user and have a scenario that I wanted > to run by you all, see if anyone's synapses connect -- mine def. > aren't! > > I'm running a fairly simple rails app through a mongrel cluster (2 > mongrels). This site is consistently sloooow -- memory on the server > is regularly paging (and shouldn't be). ssh-ing in and running top > shows these two mongrel processes taking up about 80% of the 1 gig of > system memory. > > the only interesting thing the application is doing is storing photos > in the database and resizing the photos on the way out using > mini_magick. Once the photos are delivered once they are cached using > rails page caching (i'm positive the caching is working, > production.log says so). > > So, at this point the site should only be delivering images from the > cache (which is currently on disk) apache isn't serving the images, > mongrel is. -- but, things are slow. Does this ring any bells for > anyone? > > you can check the site out (don't pound too hard please! ;) ) > http://prughrealestate.com > click on the "developments" tab to see what i mean -- those thumbnail > images are coming from the cache. > > Also: > Server : Fedora Core 5 > Mongrel: 0.3.13.3 > mongrel_cluster: 0.2.0 > > I'm eternally grateful to anyone who can help me out with this! Sort > of at the end of my rope. > Thanks in advance, & hope your Tuesday is good. > > Clint > > -- > clint troxel _ Open End Studios _ > 307.413.0366 > http://openendstudios.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From zedshaw at zedshaw.com Tue Nov 14 23:11:02 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 14 Nov 2006 23:11:02 -0500 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: Message-ID: <20061114231102.5722ca5a.zedshaw@zedshaw.com> On Tue, 14 Nov 2006 12:08:29 -0700 "Clint Troxel" wrote: > the only interesting thing the application is doing is storing photos > in the database and resizing the photos on the way out using > mini_magick. Once the photos are delivered once they are cached using > rails page caching (i'm positive the caching is working, > production.log says so). The #1 cause of problems when running Mongrel seems to be "I'm just doing with ." I'd look at a way to move that outside of rails with BackgrounDRb. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From technoweenie at gmail.com Tue Nov 14 23:53:31 2006 From: technoweenie at gmail.com (Rick Olson) Date: Tue, 14 Nov 2006 22:53:31 -0600 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: <20061114231102.5722ca5a.zedshaw@zedshaw.com> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> Message-ID: <48fe25b0611142053j290ab441r803fbb4df684ae91@mail.gmail.com> > The #1 cause of problems when running Mongrel seems to be "I'm just doing with ." I'd look at a way to move that outside of rails with BackgrounDRb. To his credit he is using mini magick instead. It just issues system commands against the image magick command if I'm not mistaken. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From g.vishnu at gmail.com Wed Nov 15 00:45:40 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Wed, 15 Nov 2006 11:15:40 +0530 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: <20061114231102.5722ca5a.zedshaw@zedshaw.com> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> Message-ID: A quick question (since answers to all such threads is to offload tasks to backgroundrb): If I set load_rails to true in backgroundrb configuration, does that hurt things? [are some mongrel threads involved & blocking then?] Vish On 11/15/06, Zed A. Shaw wrote: > On Tue, 14 Nov 2006 12:08:29 -0700 > "Clint Troxel" wrote: > > > the only interesting thing the application is doing is storing photos > > in the database and resizing the photos on the way out using > > mini_magick. Once the photos are delivered once they are cached using > > rails page caching (i'm positive the caching is working, > > production.log says so). > > The #1 cause of problems when running Mongrel seems to be "I'm just doing with ." I'd look at a way to move that outside of rails with BackgrounDRb. > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://www.awprofessional.com/title/0321483502 -- The Mongrel Book > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From clint at ctro.net Wed Nov 15 01:17:45 2006 From: clint at ctro.net (Clint Troxel) Date: Tue, 14 Nov 2006 23:17:45 -0700 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> Message-ID: So, I realize that all answers point to offloading to backgroundrb -- but... 1) RMagick isn't being used.... or loaded into the mongrel memory space -- using mini_magick. 2) These images are being served from the cache -- at this point there isn't any mini_magick (or RMagick!) being excecuted -- just files served from the rails cache. Is the recommendation still to use backgroundrb? Seems that serving a static file from the cache shouldn't be a time intensive op. happy to be informed, Clint On 11/14/06, Vishnu Gopal wrote: > A quick question (since answers to all such threads is to offload > tasks to backgroundrb): If I set load_rails to true in backgroundrb > configuration, does that hurt things? [are some mongrel threads > involved & blocking then?] > > Vish > > On 11/15/06, Zed A. Shaw wrote: > > On Tue, 14 Nov 2006 12:08:29 -0700 > > "Clint Troxel" wrote: > > > > > the only interesting thing the application is doing is storing photos > > > in the database and resizing the photos on the way out using > > > mini_magick. Once the photos are delivered once they are cached using > > > rails page caching (i'm positive the caching is working, > > > production.log says so). > > > > The #1 cause of problems when running Mongrel seems to be "I'm just doing with ." I'd look at a way to move that outside of rails with BackgrounDRb. > > > > -- > > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > > http://www.zedshaw.com/ > > http://www.awprofessional.com/title/0321483502 -- The Mongrel Book > > http://mongrel.rubyforge.org/ > > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > > _______________________________________________ > > 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 > -- clint troxel _ Open End Studios _ 307.413.0366 http://openendstudios.com From carl.lerche at gmail.com Wed Nov 15 11:15:09 2006 From: carl.lerche at gmail.com (Carl Lerche) Date: Wed, 15 Nov 2006 08:15:09 -0800 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> Message-ID: I've been using RMagick within my rails apps for all my image manipulation needs so far. I have been wondering about how the image stuff was handled memory wise. Everything has been running smoothly so far so I didn't really worry about it. In the future though, what would be the better approach? 1) Using mini_magick within my rails apps 2) Using RMagick in a BackgroundRB process - 1+2 I'm guessing that if mini_magick doesn't load anything into memory, running it inside the rails app should be fine? Thanks, -carl On 11/14/06, Clint Troxel wrote: > So, I realize that all answers point to offloading to backgroundrb -- but... > > 1) RMagick isn't being used.... or loaded into the mongrel memory > space -- using mini_magick. > 2) These images are being served from the cache -- at this point > there isn't any mini_magick (or RMagick!) being excecuted -- just > files served from the rails cache. > > Is the recommendation still to use backgroundrb? Seems that serving a > static file from the cache shouldn't be a time intensive op. > > happy to be informed, > Clint > > On 11/14/06, Vishnu Gopal wrote: > > A quick question (since answers to all such threads is to offload > > tasks to backgroundrb): If I set load_rails to true in backgroundrb > > configuration, does that hurt things? [are some mongrel threads > > involved & blocking then?] > > > > Vish > > > > On 11/15/06, Zed A. Shaw wrote: > > > On Tue, 14 Nov 2006 12:08:29 -0700 > > > "Clint Troxel" wrote: > > > > > > > the only interesting thing the application is doing is storing photos > > > > in the database and resizing the photos on the way out using > > > > mini_magick. Once the photos are delivered once they are cached using > > > > rails page caching (i'm positive the caching is working, > > > > production.log says so). > > > > > > The #1 cause of problems when running Mongrel seems to be "I'm just doing with ." I'd look at a way to move that outside of rails with BackgrounDRb. > > > > > > -- > > > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > > > http://www.zedshaw.com/ > > > http://www.awprofessional.com/title/0321483502 -- The Mongrel Book > > > http://mongrel.rubyforge.org/ > > > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > > > _______________________________________________ > > > 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 > > > > > -- > clint troxel _ Open End Studios _ > 307.413.0366 > http://openendstudios.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- EPA Rating: 3000 Lines of Code / Gallon (of coffee) From kigsteronline at mac.com Wed Nov 15 16:38:49 2006 From: kigsteronline at mac.com (kigsteronline at mac.com) Date: Wed, 15 Nov 2006 13:38:49 -0800 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> Message-ID: We are using RMagick / mongrel / apache, and recently had to run a migration that had to process approximately 7000 images, by generating a thumbnail and a JPEG out of a large PNG. The migration took about 5 minutes to complete, and while it was running I was watching the RAM/CPU of the rake process that was running it. The process RSS was fluctuating between 200Mb and 500Mb... It seems like once the garbage collection kicked in, the RSS went down by up to 300Mb, and then slowly climb back up. Clearly, this is a very high memory footprint for a web server process, but should be acceptable for a dedicated background process. Thanks Konstantin On Nov 15, 2006, at 8:15 AM, Carl Lerche wrote: > I've been using RMagick within my rails apps for all my image > manipulation needs so far. I have been wondering about how the image > stuff was handled memory wise. Everything has been running smoothly so > far so I didn't really worry about it. In the future though, what > would be the better approach? > > 1) Using mini_magick within my rails apps > 2) Using RMagick in a BackgroundRB process > - 1+2 > > I'm guessing that if mini_magick doesn't load anything into memory, > running it inside the rails app should be fine? From riley.ross at gmail.com Wed Nov 15 18:19:35 2006 From: riley.ross at gmail.com (Ross Riley) Date: Wed, 15 Nov 2006 23:19:35 +0000 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> Message-ID: <15365f130611151519i192f598w228a523d787e0117@mail.gmail.com> I'll jump in on this one too. We've found about the same when using RMagick with mongrel. We've got sites on a dedicated server with a stack of RAM and 3 mongrel servers per app and they seem to cope ok. However I ran another site on a VPS with 128mb of RAM and a single mongrel server and often, depending on the uploaded image, the server will completely lock up. I have monit running on this server, but if it goes, it needs a root login to force quit all processes and then a restart of the server to cure, monit won't restart it. I don't know what everyone else has found, but I'd say that if you're going to use RMagick, you need plenty of spare RAM capacity. On 11/15/06, kigsteronline at mac.com wrote: > > We are using RMagick / mongrel / apache, and recently had to run a > migration that had to process approximately 7000 images, by > generating a thumbnail and a JPEG out of a large PNG. > > The migration took about 5 minutes to complete, and while it was > running I was watching the RAM/CPU of the rake process that was > running it. The process RSS was fluctuating between 200Mb and > 500Mb... It seems like once the garbage collection kicked in, the RSS > went down by up to 300Mb, and then slowly climb back up. Clearly, > this is a very high memory footprint for a web server process, but > should be acceptable for a dedicated background process. > > Thanks > Konstantin > > > On Nov 15, 2006, at 8:15 AM, Carl Lerche wrote: > > > I've been using RMagick within my rails apps for all my image > > manipulation needs so far. I have been wondering about how the image > > stuff was handled memory wise. Everything has been running smoothly so > > far so I didn't really worry about it. In the future though, what > > would be the better approach? > > > > 1) Using mini_magick within my rails apps > > 2) Using RMagick in a BackgroundRB process > > - 1+2 > > > > I'm guessing that if mini_magick doesn't load anything into memory, > > running it inside the rails app should be fine? > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Ross Riley www.sorrylies.com From zedshaw at zedshaw.com Wed Nov 15 18:20:37 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 15 Nov 2006 18:20:37 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.15 PR -- All The Fixes Good For You Message-ID: <20061115182037.d71d7dfd.zedshaw@zedshaw.com> Hi folks, Getting much much much closer to the 1.0 release. I have some documentation to work on tonight, and I need to go through the patch queue one more time, but I've put up another pre-release for people to test. What this pre-release does is pull together the various patches, monkey patching, and alternatives that make Mongrel either faster or more stable. It is also the start of an effort to get Mongrel's CGIWrapper to handle the mime type decoding as well. Full (lame ass svk style) ChangeLog is at http://mongrel.rubyforge.org/releases/ChangeLog It's also tagged as 0.3.15 in svn for people who need that. The better explanation of the changes is: * Uses Mentalguy's Optimized Sync for locking rather than Mutex or Sync. ***THIS BREAKS WINDOWS*** * Includes a monkey patched version of Mutex. If you see memory leaks, throw: require 'mutex_fix' and see if they magically go away. * Still depends on the cgi multipart fix. I'll be just putting this into Mongrel directly when I work on the new CGIWrapper functionality. CGI WRAPPER PLANS When you get this new version (and read the ChangeLog) you'll see mention of a BMH implementation. This is the Boyer-Moore-Horspool algorithm for finding one string in another: http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm I took the above code (which I guess is alright) and modified the hell out of it so that you can pass successive chunks of the haystack and it'll find all the needles ultra fast even across chunk boundaries. My initial performance measurements puts it at about 3.84G/second. Yes, as in 26 seconds to process 100G of data with 99000 mime boundaries in it. Commence the arguing. Why all the fuss? The plan is to finally put the last nail in cgi.rb's coffin with this tasty bit of C code. It is implemented in 0.3.15 mongrel as the Mongrel::BMHSearch class (feel free to play with it and break it). With this class, Mongrel can now stream out multipart mime uploads *and* record the locations of the boundary string as it's streams. When the file is fully uploaded it can then go back through and carve the result without further scanning. This is coming from my work at http://www.travelistic.com/ where I'm doing a specialized upload server, and from Ezra's work at Engineyard, where we're finding that the main bottleneck for large file uploads is now just waiting around for cgi.rb to do it's lame find mime boundaries thing on giant files. This is all CPU bound, so a new algorithm was in order. This is also where the current cgi.rb security hole is, so I'm hoping to just eliminate that and improve cgi multipart performance dramatically. So, stay tuned. Mongrel may soon get another boost in this particular domain, and then doing uploads will be very nice and fast without using much ram (like fastcgi). If people think this little class is handy outside of Mongrel then I'll consider breaking it out. THE 1.0 PLAN Still don't have the 1.0 plan formalized, but my big list is: 1) Update the docs (apache needs an update, etc.) 2) Get this last change to CGIWrapper so that multipart mime is fast and cgi.rb is no longer needed. 3) Final extensive testing and little bug fixes for all. 4) Any other requests? Keep in mind that the only core functionality change will be to CGIWrapper. This is really the last thing I feel will make Mongrel 1.0 ready. Test away and let me know if anything bad happens. BUT DON'T TEST ON PRODUCTION. Yes, some dumbasses do that. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From phil at unimedia.org Wed Nov 15 19:04:07 2006 From: phil at unimedia.org (Phillip Kast) Date: Wed, 15 Nov 2006 16:04:07 -0800 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> Message-ID: <455BAAF7.2050209@unimedia.org> So what's going on here is that RMagick allocates memory in a way that isn't visible to the ruby garbage collector. If you don't have 500Mb to burn, you can manually start garbage collection more often (as long as your RMagick objects are passing out of scope, not still referenced somewhere). Tim said it way better: http://rubyforge.org/forum/forum.php?thread_id=1374&forum_id=1618 phil kigsteronline at mac.com wrote: > We are using RMagick / mongrel / apache, and recently had to run a > migration that had to process approximately 7000 images, by > generating a thumbnail and a JPEG out of a large PNG. > > The migration took about 5 minutes to complete, and while it was > running I was watching the RAM/CPU of the rake process that was > running it. The process RSS was fluctuating between 200Mb and > 500Mb... It seems like once the garbage collection kicked in, the RSS > went down by up to 300Mb, and then slowly climb back up. Clearly, > this is a very high memory footprint for a web server process, but > should be acceptable for a dedicated background process. > > Thanks > Konstantin > > > On Nov 15, 2006, at 8:15 AM, Carl Lerche wrote: > > >> I've been using RMagick within my rails apps for all my image >> manipulation needs so far. I have been wondering about how the image >> stuff was handled memory wise. Everything has been running smoothly so >> far so I didn't really worry about it. In the future though, what >> would be the better approach? >> >> 1) Using mini_magick within my rails apps >> 2) Using RMagick in a BackgroundRB process >> - 1+2 >> >> I'm guessing that if mini_magick doesn't load anything into memory, >> running it inside the rails app should be fine? >> > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -- Phillip Kast (909)630-9562 phil at unimedia.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061115/70310e26/attachment.html From will at hotgazpacho.com Wed Nov 15 20:40:18 2006 From: will at hotgazpacho.com (Will Green) Date: Wed, 15 Nov 2006 20:40:18 -0500 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: <15365f130611151519i192f598w228a523d787e0117@mail.gmail.com> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> <15365f130611151519i192f598w228a523d787e0117@mail.gmail.com> Message-ID: <455BC182.4040306@hotgazpacho.com> I don't know where people get the idea that image processing is not a memory-intensive process. Most image formats are compressed, heavily in some cases. magicked needs to uncompress the image, apply the transforms, and re-compress it back to disk... all in-memory. Throw in some concurrency, and your memory usage will spiral. Just as a point of reference, I have been working on a set of comps at work. The photoshop file is 32 Mb on disk. In memory, before doing anything, photoshop's memory usage climbs to 1.2 Gb(!). Sure, a bit extreme, but it illustrates my point. == Will Green From jgeiger at gmail.com Wed Nov 15 21:57:16 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Wed, 15 Nov 2006 20:57:16 -0600 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: <15365f130611151519i192f598w228a523d787e0117@mail.gmail.com> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> <15365f130611151519i192f598w228a523d787e0117@mail.gmail.com> Message-ID: <466af3440611151857x3bf5e98dr9a18c803f8c23463@mail.gmail.com> Just put an app into production, and I've got monit watching the mongrel cluster. If an instance gets above 75mb for more than 2.5 minutes, that mongrel is restarted. I've actually had them restart a few times now. It's something that I'll be looking into over the next couple of weeks though. On 11/15/06, Ross Riley wrote: > I'll jump in on this one too. > We've found about the same when using RMagick with mongrel. We've got > sites on a dedicated server with a stack of RAM and 3 mongrel servers > per app and they seem to cope ok. However I ran another site on a VPS > with 128mb of RAM and a single mongrel server and often, depending on > the uploaded image, the server will completely lock up. > > I have monit running on this server, but if it goes, it needs a root > login to force quit all processes and then a restart of the server to > cure, monit won't restart it. I don't know what everyone else has > found, but I'd say that if you're going to use RMagick, you need > plenty of spare RAM capacity. > > > > On 11/15/06, kigsteronline at mac.com wrote: > > > > We are using RMagick / mongrel / apache, and recently had to run a > > migration that had to process approximately 7000 images, by > > generating a thumbnail and a JPEG out of a large PNG. > > > > The migration took about 5 minutes to complete, and while it was > > running I was watching the RAM/CPU of the rake process that was > > running it. The process RSS was fluctuating between 200Mb and > > 500Mb... It seems like once the garbage collection kicked in, the RSS > > went down by up to 300Mb, and then slowly climb back up. Clearly, > > this is a very high memory footprint for a web server process, but > > should be acceptable for a dedicated background process. > > > > Thanks > > Konstantin > > > > > > On Nov 15, 2006, at 8:15 AM, Carl Lerche wrote: > > > > > I've been using RMagick within my rails apps for all my image > > > manipulation needs so far. I have been wondering about how the image > > > stuff was handled memory wise. Everything has been running smoothly so > > > far so I didn't really worry about it. In the future though, what > > > would be the better approach? > > > > > > 1) Using mini_magick within my rails apps > > > 2) Using RMagick in a BackgroundRB process > > > - 1+2 > > > > > > I'm guessing that if mini_magick doesn't load anything into memory, > > > running it inside the rails app should be fine? > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > -- > Ross Riley > www.sorrylies.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From me at seebq.com Wed Nov 15 22:29:15 2006 From: me at seebq.com (Charles Brian Quinn) Date: Wed, 15 Nov 2006 22:29:15 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.15 PR -- All The Fixes Good For You In-Reply-To: <20061115182037.d71d7dfd.zedshaw@zedshaw.com> References: <20061115182037.d71d7dfd.zedshaw@zedshaw.com> Message-ID: <3a2de0cd0611151929q7024c095lb3826d5eca8bc15c@mail.gmail.com> On 11/15/06, Zed A. Shaw wrote: > > 1) Update the docs (apache needs an update, etc.) Hiya Zed, thanks for the release, awesome stuff. What do the apache docs need? Anyone have any suggestions? I've incorporated a lot of the list and our clients usages. Let me know if you think they should be paired down or stripped or just added to.... > 4) Any other requests? How about a certificate program for the MUDCRAP-CE for Apache Server Setup (ASS) ? couldn't resist. -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com From al-mongrelusers at none.at Thu Nov 16 03:57:27 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Thu, 16 Nov 2006 09:57:27 +0100 Subject: [Mongrel] [ANN] Mongrel 0.3.15 PR -- All The Fixes Good For You In-Reply-To: <20061115182037.d71d7dfd.zedshaw@zedshaw.com> References: <20061115182037.d71d7dfd.zedshaw@zedshaw.com> Message-ID: <20061116085727.GA9030@none.at> Hi, On Mit 15.11.2006 18:20, Zed A. Shaw wrote: [snipp] >CGI WRAPPER PLANS > >When you get this new version (and read the ChangeLog) you'll see >mention of a BMH implementation. This is the Boyer-Moore-Horspool >algorithm for finding one string in another: > >http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm > >I took the above code (which I guess is alright) and modified the hell >out of it so that you can pass successive chunks of the haystack and >it'll find all the needles ultra fast even across chunk boundaries. My >initial performance measurements puts it at about 3.84G/second. Yes, as >in 26 seconds to process 100G of data with 99000 mime boundaries in it. >Commence the arguing. Cool, we have used also the BMH for awffull[1] and was also impressed how fast this algo work ;-) I have compared it whith FJS (http://cgjennings.ca/fjs) and it looks for our issue not so fast, but it could also be a implemention problem ;-) Regards Aleks [1] http://www.stedee.id.au/awffull From zedshaw at zedshaw.com Thu Nov 16 08:55:31 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 16 Nov 2006 08:55:31 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.15 PR -- All The Fixes Good For You In-Reply-To: <20061116085727.GA9030@none.at> References: <20061115182037.d71d7dfd.zedshaw@zedshaw.com> <20061116085727.GA9030@none.at> Message-ID: <20061116085531.fd9a1f56.zedshaw@zedshaw.com> On Thu, 16 Nov 2006 09:57:27 +0100 Aleksandar Lazic wrote: > Hi, > > On Mit 15.11.2006 18:20, Zed A. Shaw wrote: > [snipp] > > Cool, we have used also the BMH for awffull[1] and was also impressed how > fast this algo work ;-) > > I have compared it whith FJS (http://cgjennings.ca/fjs) and it looks for > our issue not so fast, but it could also be a implemention problem ;-) Hadn't heard of FJS, but the BMH main property I was interested in was the ability to feed it sequential chunks and with a slight change still find the search string across chunk boundaries. For example, if two packets came in chopped like this: ....----asdfas|adfasfd...... Where the | is the break, then most implementations can't detect the search string. That being said, I'm pretty sure the code can be improved on. If anyone can make it faster or better feel free to go ahead. Just keep the properties in the current implementation of being able to feed chunks and still find the search string in them arbitrarily. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From jan.svitok at gmail.com Thu Nov 16 10:03:24 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Thu, 16 Nov 2006 16:03:24 +0100 Subject: [Mongrel] Running mongrel globally In-Reply-To: <20061030175348.086506@YOUR-B5B06FA76B> References: <20061030175348.086506@YOUR-B5B06FA76B> Message-ID: <8d9b3d920611160703tebd68e7o5dbdcb91c36d54c4@mail.gmail.com> On 10/30/06, Chris Collins wrote: > Hi, > > I would like to run Mongrel as a proxy to apache globally. With no > input needed, all the customer > has to do is install there app, and put the proxy commands, in there > .htaccess. Is there a way I can > do this. I am having great luck running them as a single account. Hi, I have found your message in my gmails' spam folder. So, if you haven't received any replies, it might be because your message was classified as a spam. You may want to repost your message in plain ASCII format (i.e. do not use HTML). Then, it's not really clear (at least to me) what are you trying to achieve: put mongrel in front of apache or the other way round? Jano From eastmedianyc at gmail.com Thu Nov 16 12:37:16 2006 From: eastmedianyc at gmail.com (Matt Pelletier) Date: Thu, 16 Nov 2006 12:37:16 -0500 Subject: [Mongrel] OSX requires sudo for using ports < 1024 Message-ID: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> I assume some of you have run into this error before when trying to run mongrel on port 80 (or another port < 1024) in OSX: $ mongrel_rails start -p 80 ** Starting Mongrel listening at 0.0.0.0:80 /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/tcphack.rb:12:in `initialize_without_backlog': Permission denied - bind(2) (Errno::EACCES) from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/tcphack.rb:12:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel.rb:536:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:128:in `listener' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:96:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:51:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:83:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/command.rb:211:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14 /bin/mongrel_rails:235 from /usr/local/bin/mongrel_rails:18 Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have the reason that these ports require sudo? Matt -- ------------------ Matt Pelletier http://www.eastmedia.com -- EastMedia http://www.informit.com/title/0321483502 -- The Mongrel Book http://identity.eastmedia.com -- OpenID, Identity 2.0 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061116/410598e4/attachment.html From jarkko at jlaine.net Thu Nov 16 15:01:35 2006 From: jarkko at jlaine.net (Jarkko Laine) Date: Thu, 16 Nov 2006 22:01:35 +0200 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: On 16.11.2006, at 19.37, Matt Pelletier wrote: > Mongrel runs without sudo on all other ports > 1024 otherwise. > Anyone have the reason that these ports require sudo? I think it is pretty common to require sudo to run on privileged ports. I guess it might be because otherwise any user could start acting as the web server in the internet (assuming the port is not blocked by a firewall). //jarkko -- Jarkko Laine http://jlaine.net http://dotherightthing.com http://www.railsecommerce.com http://odesign.fi -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061116/74e5471d/attachment.bin From brad at bradediger.com Thu Nov 16 15:32:51 2006 From: brad at bradediger.com (Brad Ediger) Date: Thu, 16 Nov 2006 14:32:51 -0600 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: On UNIX-derived systems, ports below 1024 are privileged and can only be accessed as root. On Nov 16, 2006, at 11:37 AM, Matt Pelletier wrote: > I assume some of you have run into this error before when trying to > run mongrel on port 80 (or another port < 1024) in OSX: > > $ mongrel_rails start -p 80 > ** Starting Mongrel listening at 0.0.0.0:80 > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/ > tcphack.rb:12:in `initialize_without_backlog': Permission denied - > bind(2) (Errno::EACCES) > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- 0.3.14/lib/ > mongrel/tcphack.rb:12:in `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel.rb:536:in `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel/configurator.rb:128:in `listener' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/ > mongrel_rails:96:in `cloaker_' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel/configurator.rb:51:in `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- 0.3.14/bin/ > mongrel_rails:83:in `run' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel/command.rb:211:in `run' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/ > mongrel_rails:235 > from /usr/local/bin/mongrel_rails:18 > > Mongrel runs without sudo on all other ports > 1024 otherwise. > Anyone have the reason that these ports require sudo? > > Matt > > -- > ------------------ > Matt Pelletier > http://www.eastmedia.com -- EastMedia > http://www.informit.com/title/0321483502 -- The Mongrel Book > http://identity.eastmedia.com -- OpenID, Identity 2.0 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061116/b48c0634/attachment.html From zackchandler at gmail.com Thu Nov 16 15:37:51 2006 From: zackchandler at gmail.com (Zack Chandler) Date: Thu, 16 Nov 2006 12:37:51 -0800 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <33841ac70611161237g61374022j44fd067125eee769@mail.gmail.com> On 11/16/06, Matt Pelletier wrote: > I assume some of you have run into this error before when trying to run > mongrel on port 80 (or another port < 1024) in OSX: > > $ mongrel_rails start -p 80 > ** Starting Mongrel listening at 0.0.0.0:80 > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/tcphack.rb:12:in > `initialize_without_backlog': Permission denied - bind(2) (Errno::EACCES) > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- > 0.3.14/lib/mongrel/tcphack.rb:12:in `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel.rb:536:in > `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:128:in > `listener' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:96:in > `cloaker_' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:51:in > `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- > 0.3.14/bin/mongrel_rails:83:in `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/command.rb:211:in > `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:235 > from /usr/local/bin/mongrel_rails:18 > > Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have > the reason that these ports require sudo? > > Matt > > -- > ------------------ > Matt Pelletier > http://www.eastmedia.com -- EastMedia > http://www.informit.com/title/0321483502 -- The Mongrel > Book > http://identity.eastmedia.com -- OpenID, Identity 2.0 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > Matt, Port numbers 0 to 1024 are reserved for privileged services and designated as well-known ports. Here is a list: http://www.webopedia.com/quick_ref/portnumbers.asp sudo is required to protect against interference with core services like ssh, http, example. Hope this helps. -- Zack Chandler http://depixelate.com From wyhaines at gmail.com Thu Nov 16 15:37:56 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 16 Nov 2006 13:37:56 -0700 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: On 11/16/06, Matt Pelletier wrote: > I assume some of you have run into this error before when trying to run > mongrel on port 80 (or another port < 1024) in OSX: [snip] > Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have > the reason that these ports require sudo? Because the first 1024 ports are priveledged ports on unix-like operating systems. Regular users can't use them. It's not a Mongrel issue. Kirk Haines From ezmobius at gmail.com Thu Nov 16 15:42:11 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Thu, 16 Nov 2006 12:42:11 -0800 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: Matt- All unix style operating systems require root access to use any port less than 1024. Its just a fact of life on any linux, bsd or osx system. Cheers- -Ezra On Nov 16, 2006, at 9:37 AM, Matt Pelletier wrote: > I assume some of you have run into this error before when trying to > run mongrel on port 80 (or another port < 1024) in OSX: > > $ mongrel_rails start -p 80 > ** Starting Mongrel listening at 0.0.0.0:80 > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/ > tcphack.rb:12:in `initialize_without_backlog': Permission denied - > bind(2) (Errno::EACCES) > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- 0.3.14/lib/ > mongrel/tcphack.rb:12:in `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel.rb:536:in `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel/configurator.rb:128:in `listener' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/ > mongrel_rails:96:in `cloaker_' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel/configurator.rb:51:in `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- 0.3.14/bin/ > mongrel_rails:83:in `run' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/ > mongrel/command.rb:211:in `run' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/ > mongrel_rails:235 > from /usr/local/bin/mongrel_rails:18 > > Mongrel runs without sudo on all other ports > 1024 otherwise. > Anyone have the reason that these ports require sudo? > > Matt > > -- > ------------------ > Matt Pelletier > http://www.eastmedia.com -- EastMedia > http://www.informit.com/title/0321483502 -- The Mongrel Book > http://identity.eastmedia.com -- OpenID, Identity 2.0 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From zedshaw at zedshaw.com Thu Nov 16 16:08:11 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 16 Nov 2006 16:08:11 -0500 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <20061116160811.62fb6433.zedshaw@zedshaw.com> On Thu, 16 Nov 2006 12:37:16 -0500 "Matt Pelletier" wrote: > I assume some of you have run into this error before when trying to run > mongrel on port 80 (or another port < 1024) in OSX: > Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have > the reason that these ports require sudo? That's from the old days where everyone liked everyone on the internet and only trusted people ran the computers. Back then, if a service was running below 1024 it could only be run by root, and since only trusted professionals could become root it meant the service was more likely to be safe. Of course we now know that's all a bunch of horseshit, but that's the way it is. The "fix" is to run it with sudo, but tell mongrel to become you afterwards: sudo mongrel_rails start -p 80 --user mattp --group users Then, it'll bind to port 80, but still run as you so your file permissions aren't all screwed up later. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From runner at berkeley.edu Thu Nov 16 16:11:01 2006 From: runner at berkeley.edu (Steven Hansen) Date: Thu, 16 Nov 2006 13:11:01 -0800 Subject: [Mongrel] Monrel Woes on Solaris x86 Message-ID: <455CD3E5.7040503@berkeley.edu> Greetings, I need some help... please be gentle :-) MY SETUP: Solaris-X86, ruby-1.8.4, Apache-2.2.0, Mongrel-0.3.13.4, MySql-4.1.10a I am using the typical setup with apache proxying request to mongrel with mod_proxy_balancer. Currently, I am only running a single instance of mongrel behind the proxy. I am also using the following gems with this app: capistrano (1.2.0) daemons (1.0.2) gem_plugin (0.2.1) mongrel (0.3.13.4, 0.3.13.3) mysql (2.7) needle (1.3.0) rails (1.1.6) ruby-net-ldap (0.0.4) NOTE: My MySql server is running on a different machine than Mongrel. THE PROBLEM The problem, is that after a period of inactivity Mongrel just stops responding. I believe the problem has to do with MySql as mentioned in the FAQ. I've confirmed this--I think--by creating a dummy app that doesn't use MySql for any of the page requests. In this instance, after long periods of inactivity Mongrel works without any problems. WHAT I'VE TRIED: 1) After 20 minutes of inactivity, I try to load the page in the browser. The browser just hangs and eventually times out. I then ssh'd to the machine and did a (curl localhost:50042), mongrel does not respond. I can see that mongrel is still running if I to a (ps -A). Running (top) shows that mongrel is consuming around 34M of memory and using no .01% CPU. I'm running mongrel in development mode, yet no entries are making it to (deveopment.log). I'm also running mongrel in debug_mode and no entries are being added to any of the log files in the mongrel_debug directory. BTW, I am running mongrel on port 50042 because this is the port I've been given permission to run Mongrel on. 2) After hitting mongrel with a bunch of (curl locahost:50042) calls, I did (lsof -i -P | grep CLOSE_WAIT) and here is the output: mongrel_r 5522 agile 6u IPv4 0xffffffffa02b8e00 0t617 TCP localhost:50042->localhost:51299 (CLOSE_WAIT) curl 20784 agile 4u IPv4 0xffffffffb1083200 0t0 TCP webfarm-dev.Berkeley.EDU:51330->webfarm-dev.Berkeley.EDU:80 (CLOSE_WAIT) curl 20785 agile 4u IPv4 0xffffffffb9477a00 0t0 TCP webfarm-dev.Berkeley.EDU:51333->webfarm-dev.Berkeley.EDU:80 (CLOSE_WAIT) curl 20788 agile 4u IPv4 0xffffffffb1025c00 0t0 TCP webfarm-dev.Berkeley.EDU:51339->webfarm-dev.Berkeley.EDU:80 (CLOSE_WAIT) curl 20798 agile 4u IPv4 0xffffffffa02b9a00 0t0 TCP webfarm-dev.Berkeley.EDU:51345->webfarm-dev.Berkeley.EDU:80 (CLOSE_WAIT) curl 20799 agile 4u IPv4 0xffffffffb945be00 0t0 TCP webfarm-dev.Berkeley.EDU:51348->webfarm-dev.Berkeley.EDU:80 (CLOSE_WAIT) curl 20805 agile 4u IPv4 0xffffffffb0d7ae00 0t0 TCP webfarm-dev.Berkeley.EDU:51357->webfarm-dev.Berkeley.EDU:80 (CLOSE_WAIT) NOTE: I do not have access to the root account, my user name is "agile". I'm not even sure what (lsof) is telling me here, so if someone could give me a hint, or point me to a url with a good overview, that would be killer. 3) After checking the logs (which show nothing) and running (lsof) I tried to shut mongrel down with (mongrel_rails mongrel::stop -p pids/mongrel.pid I get the response "Sending TERM to Mongrel at PID 5522...Done." However, when I check the log directory the mongrel.pid file is still there and (ps -A) verifies that mongrel is still running. I called the shutdown method 4 more times and on the 4th try mongrel finally stops. I then checked the monrel.log file and found the following: "Thu Nov 16 09:21:00 PST 2006: Reaping 1 threads for slow workers because of 'shutdown' Thread # is too old, killing. Waiting for 1 requests to finish, could take 60 seconds." 4) I tried adding "ActiveRecord::Base.verification_timeout = "14400" to my rails environment.rb file, as per the FAQ, this had no effect. MOVING FORWARD I'm not really sure where to go from here. Like I said, I have a strong suspicion that MySql is the culprit, but I'm not sure how to fix the problem. If anyone could give me some advice on what to try next, I would really appreciate it. Regards, Steven From kevwil at gmail.com Thu Nov 16 16:11:21 2006 From: kevwil at gmail.com (Kevin Williams) Date: Thu, 16 Nov 2006 14:11:21 -0700 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <683a886f0611161311o390e79c8wcd1909ee81fa9f32@mail.gmail.com> That's standard UNIX rules. You should find the same behavior on *BSD or Linux. On 11/16/06, Matt Pelletier wrote: > I assume some of you have run into this error before when trying to run > mongrel on port 80 (or another port < 1024) in OSX: > > $ mongrel_rails start -p 80 > ** Starting Mongrel listening at 0.0.0.0:80 > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/tcphack.rb:12:in > `initialize_without_backlog': Permission denied - bind(2) (Errno::EACCES) > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- > 0.3.14/lib/mongrel/tcphack.rb:12:in `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel.rb:536:in > `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:128:in > `listener' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:96:in > `cloaker_' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:51:in > `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- > 0.3.14/bin/mongrel_rails:83:in `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/command.rb:211:in > `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:235 > from /usr/local/bin/mongrel_rails:18 > > Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have > the reason that these ports require sudo? > > Matt > > -- > ------------------ > Matt Pelletier > http://www.eastmedia.com -- EastMedia > http://www.informit.com/title/0321483502 -- The Mongrel > Book > http://identity.eastmedia.com -- OpenID, Identity 2.0 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > -- Cheers, Kevin Williams http://www.almostserio.us/ "Any sufficiently advanced technology is indistinguishable from Magic." - Arthur C. Clarke From mongrel at philip.pjkh.com Thu Nov 16 16:25:16 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Thu, 16 Nov 2006 15:25:16 -0600 (CST) Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <20061116152424.I58809@bravo.pjkh.com> > I assume some of you have run into this error before when trying to run > mongrel on port 80 (or another port < 1024) in OSX: > > $ mongrel_rails start -p 80 > ** Starting Mongrel listening at 0.0.0.0:80 > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/tcphack.rb:12:in > `initialize_without_backlog': Permission denied - bind(2) (Errno::EACCES) > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/tcphack.rb:12:in > `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel.rb:536:in > `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:128:in > `listener' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:96:in > `cloaker_' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:51:in > `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:83:in > `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/command.rb:211:in > `run' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14 > /bin/mongrel_rails:235 > from /usr/local/bin/mongrel_rails:18 > > Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have > the reason that these ports require sudo? This is the way it is on all unixes... ports under 1024 tend to be "well known". 25 for smtp, 80 for http. So the OS won't let you use that port unless you are root so that joe-random-user can't start up some subversive web server on that port... -philip From jan.svitok at gmail.com Thu Nov 16 16:46:28 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Thu, 16 Nov 2006 22:46:28 +0100 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <8d9b3d920611161346w12f04ee9j88de0c36c0055aed@mail.gmail.com> On 11/16/06, Matt Pelletier wrote: > I assume some of you have run into this error before when trying to run > mongrel on port 80 (or another port < 1024) in OSX: > > $ mongrel_rails start -p 80 > ** Starting Mongrel listening at 0.0.0.0:80 > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/tcphack.rb:12:in > `initialize_without_backlog': Permission denied - bind(2) (Errno::EACCES) > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- > 0.3.14/lib/mongrel/tcphack.rb:12:in `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel.rb:536:in > `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:128:in > `listener' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:96:in > `cloaker_' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/configurator.rb:51:in > `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/mongrel- > 0.3.14/bin/mongrel_rails:83:in `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/lib/mongrel/command.rb:211:in > `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.14/bin/mongrel_rails:235 > from /usr/local/bin/mongrel_rails:18 > > Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have > the reason that these ports require sudo? This is standard unix behaviour - only root can bind ports < 1024 - they are called "privileged". The reason is because these ports are reserved for servers -HTTP, FTP, etc. and therefore it is desirable that only trusted users (=root) can run them. From david at vrensk.com Thu Nov 16 17:11:58 2006 From: david at vrensk.com (David Vrensk) Date: Thu, 16 Nov 2006 23:11:58 +0100 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <81b453920611161411m34da2ea7wc06e2328f25c3030@mail.gmail.com> On 11/16/06, Matt Pelletier wrote: > > Mongrel runs without sudo on all other ports > 1024 otherwise. Anyone have > the reason that these ports require sudo? I suppose you could say that there is a historical reason. Un*x machines used to be multiuser computers with lots of users logged in over terminals or phone lines, and not all users could be perfectly trusted. Some of them would have loved to overload the telnet service (port 23) to make it crash, and then replace it with their own hacked version that would snoop on people's passwords. By protecting certain ports (< 1024), everyone could safely assume that if they contacted a trusted host (e.g. one operated by their university) on those ports, whatever process answered would be owned by root. This extended trust was used for other services too, like rlogin, which allows a user to login on a remote host without a password if the two hosts trust each other. This security model is generally frowned upon today, but it does ensure that on a UN*X-based web hotell, the web server is run by the management and not by a random user. /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061116/4322bfa5/attachment-0001.html From eastmedianyc at gmail.com Thu Nov 16 17:15:20 2006 From: eastmedianyc at gmail.com (Matt Pelletier) Date: Thu, 16 Nov 2006 17:15:20 -0500 Subject: [Mongrel] OSX requires sudo for using ports < 1024 In-Reply-To: References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <96af85420611161415x282c6030y3227fbd00c6aabe4@mail.gmail.com> On 11/16/06, Jarkko Laine wrote: > > > On 16.11.2006, at 19.37, Matt Pelletier wrote: > > Mongrel runs without sudo on all other ports > 1024 otherwise. > > Anyone have the reason that these ports require sudo? > > I think it is pretty common to require sudo to run on privileged > ports. I guess it might be because otherwise any user could start > acting as the web server in the internet (assuming the port is not > blocked by a firewall). Yeah, one of those 'look before asking' situations. Thanks. //jarkko > > -- > Jarkko Laine > http://jlaine.net > http://dotherightthing.com > http://www.railsecommerce.com > http://odesign.fi > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > > -- ------------------ Matt Pelletier http://www.eastmedia.com -- EastMedia http://www.informit.com/title/0321483502 -- The Mongrel Book http://identity.eastmedia.com -- OpenID, Identity 2.0 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061116/5a435b13/attachment.html From baka.rob at gmail.com Thu Nov 16 18:16:46 2006 From: baka.rob at gmail.com (Parker Anderson) Date: Thu, 16 Nov 2006 17:16:46 -0600 Subject: [Mongrel] Monrel Woes on Solaris x86 In-Reply-To: <455CD3E5.7040503@berkeley.edu> References: <455CD3E5.7040503@berkeley.edu> Message-ID: On 11/16/06, Steven Hansen wrote: > > Greetings, > > I need some help... please be gentle :-) Hello Steven, and thanks for the good collection of info ;) > NOTE: My MySql server is running on a different machine than Mongrel. Do you have access to any of the MySql server's configuration data? Which settings (if any) have been altered from the defaults? I ask due to this bit: > 4) I tried adding "ActiveRecord::Base.verification_timeout = "14400" to > my rails > environment.rb file, as per the FAQ, this had no effect. If the settings have been altered per the "Decrease the value of connect_timeout" section of the following document: http://mysqldatabaseadministration.blogspot.com/2005/11/mysql-5-optimization-and-tuning-guide.html I know its suggestions are for MySql 5 (vs. your version), but if changes similar to these have been made on your MySql server, you would need to change the "14400" value in your Rails environment to a lower value than the one set for interactive_timeout on the MySql end of things (assuming the Mongrel FAQ is accurate and current in that regard; I'm new to Mongrel, myself). > MOVING FORWARD > I'm not really sure where to go from here. Like I said, I have a strong > suspicion that MySql > is the culprit, but I'm not sure how to fix the problem. If anyone > could give me some advice > on what to try next, I would really appreciate it. If you could check (with someone, or otherwise) the MySql server-in-question's configuration to make sure Rails is using a low enough verification_timeout, that would be another positive step, IMO. Maybe it'll turn up something, as it sounds like the 'timeout' is happening at approximately 20 minutes for you, vs. documentation I have seen suggests that the default is 480 minutes. Good Luck. > Regards, > Steven Sincerely, -Parker From al-mongrelusers at none.at Fri Nov 17 10:05:59 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Fri, 17 Nov 2006 16:05:59 +0100 Subject: [Mongrel] [ANN] Mongrel 0.3.15 PR -- All The Fixes Good For You Message-ID: <20061117150559.GA1175@none.at> On Don 16.11.2006 08:55, Zed A. Shaw wrote: >On Thu, 16 Nov 2006 09:57:27 +0100 >Aleksandar Lazic wrote: >> >>I have compared it whith FJS (http://cgjennings.ca/fjs) and it looks >>for our issue not so fast, but it could also be a implemention >>problem ;-) > >Hadn't heard of FJS, but the BMH main property I was interested in was >the ability to feed it sequential chunks and with a slight change still >find the search string across chunk boundaries. For example, if two >packets came in chopped like this: > >....----asdfas|adfasfd...... > >Where the | is the break, then most implementations can't detect the >search string. If I have understand you right howabout to look into Grouse Grep => http://www.grouse.com.au/ggrep/ he use the Tuned Boyer-Moore, also a very fast fork() off BM, and a *extension* method Self-Tuning Boyer-Moore => http://www.grouse.com.au/ggrep/string.html If you interesting into the whole *magic* of string matching there are some links on bottom of the page of FJS with a nice ps ;-) >That being said, I'm pretty sure the code can be improved on. If >anyone can make it faster or better feel free to go ahead. Just keep >the properties in the current implementation of being able to feed >chunks and still find the search string in them arbitrarily. May be I will look and if I have some comments/questions/... I will contact you offlist ;-) It will be take some time because I change my employer. Regards Aleks From wes at sheldahlconsulting.com Fri Nov 17 11:54:17 2006 From: wes at sheldahlconsulting.com (Wes Sheldahl) Date: Fri, 17 Nov 2006 11:54:17 -0500 Subject: [Mongrel] Running mongrel globally In-Reply-To: <8d9b3d920611160703tebd68e7o5dbdcb91c36d54c4@mail.gmail.com> References: <20061030175348.086506@YOUR-B5B06FA76B> <8d9b3d920611160703tebd68e7o5dbdcb91c36d54c4@mail.gmail.com> Message-ID: On 11/16/06, Jan Svitok wrote: > > On 10/30/06, Chris Collins wrote: > > Hi, > > > > I would like to run Mongrel as a proxy to apache globally. With no > > input needed, all the customer > > has to do is install there app, and put the proxy commands, in there > > .htaccess. Is there a way I can > > do this. I am having great luck running them as a single account. > > Hi, > > I have found your message in my gmails' spam folder. So, if you > haven't received any replies, it might be because your message was > classified as a spam. > > You may want to repost your message in plain ASCII format (i.e. do not > use HTML). > > Then, it's not really clear (at least to me) what are you trying to > achieve: put mongrel in front of apache or the other way round? > > Jano > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > I think Chris was looking for a way to run mongrel for multiple sites, without having to create a new set of mongrel configuration files for each site the way the mongrel-apache docs seem to advocate. -- Wes Sheldahl Sheldahl Consulting LLC http://www.sheldahlconsulting.com Phone: 859-338-3349 Fax: 866-387-4484 wes at sheldahlconsulting.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061117/c2eb79bd/attachment.html From steven at lumos.us Fri Nov 17 15:42:09 2006 From: steven at lumos.us (Steven Lumos) Date: Fri, 17 Nov 2006 12:42:09 -0800 Subject: [Mongrel] [OT] Re: OSX requires sudo for using ports < 1024 References: <96af85420611160937t7856ea6cwae8f1b0a944c0e3e@mail.gmail.com> Message-ID: <868xi9u7oe.fsf_-_@bitty.lumos.us> Ezra Zygmuntowicz writes: > Matt- > > All unix style operating systems require root access to use any port > less than 1024. Its just a fact of life on any linux, bsd or osx system. > > Cheers- > -Ezra In Solaris you can give a non-root process privilege to bind a reserved port, revoke the privilege after the bind, and even take away it's privilege to fork and exec while you're at it. Steve From chriscodes at gmail.com Sat Nov 18 10:03:26 2006 From: chriscodes at gmail.com (Chris Martin) Date: Sat, 18 Nov 2006 07:03:26 -0800 Subject: [Mongrel] Setting up Mongrel and Apache , some direction needed In-Reply-To: <200611141041.18346.ms@pccl.info> References: <8bd5d6760611131016r63c5dc3cxd711ff0d614e49f3@mail.gmail.com> <8bd5d6760611131102s44a2be27n53dacd45d7e30fd2@mail.gmail.com> <200611141041.18346.ms@pccl.info> Message-ID: <93334f200611180703m6e3d396cm83de6c00386f763c@mail.gmail.com> how's this working for you? have you tried pounding it yet? you might try the rails_analyzer_tools gem to see how evenly that distributes requests. the show numb3rs has taught me that random is not always as even as we believe. ;) -- Chris Martin Web Developer Open Source & Web Standards Advocate http://www.chriscodes.com/ From me at seebq.com Sat Nov 18 11:45:30 2006 From: me at seebq.com (Charles Brian Quinn) Date: Sat, 18 Nov 2006 11:45:30 -0500 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: <455BAAF7.2050209@unimedia.org> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> <455BAAF7.2050209@unimedia.org> Message-ID: <3a2de0cd0611180845w12ee8bbcm959e35150c646b79@mail.gmail.com> Phillip, thanks for this tip, We had a customer (www.curbly.com) that made lifehacker and the front page of digg yesterday and had some Rmagick resizing on account signup (and other places). We re-deployed with the GC.start fixes during the on-slaught (the box hit 30.0+ load) and after that, she performed a lot better (normally -- load well under 1.0). The box was running apache 2.2.2 (mpm-prefork) with mod_proxy_balancer and 3 mongrel instances (!) Thanks! -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com On 11/15/06, Phillip Kast wrote: > > So what's going on here is that RMagick allocates memory in a way that > isn't visible to the ruby garbage collector. If you don't have 500Mb to > burn, you can manually start garbage collection more often (as long as your > RMagick objects are passing out of scope, not still referenced somewhere). > > Tim said it way better: > http://rubyforge.org/forum/forum.php?thread_id=1374&forum_id=1618 > > phil > > > > kigsteronline at mac.com wrote: > We are using RMagick / mongrel / apache, and recently had to run a > migration that had to process approximately 7000 images, by > generating a thumbnail and a JPEG out of a large PNG. > > The migration took about 5 minutes to complete, and while it was > running I was watching the RAM/CPU of the rake process that was > running it. The process RSS was fluctuating between 200Mb and > 500Mb... It seems like once the garbage collection kicked in, the RSS > went down by up to 300Mb, and then slowly climb back up. Clearly, > this is a very high memory footprint for a web server process, but > should be acceptable for a dedicated background process. > > Thanks > Konstantin > > > On Nov 15, 2006, at 8:15 AM, Carl Lerche wrote: > > > > I've been using RMagick within my rails apps for all my image > manipulation needs so far. I have been wondering about how the image > stuff was handled memory wise. Everything has been running smoothly so > far so I didn't really worry about it. In the future though, what > would be the better approach? > > 1) Using mini_magick within my rails apps > 2) Using RMagick in a BackgroundRB process > - 1+2 > > I'm guessing that if mini_magick doesn't load anything into memory, > running it inside the rails app should be fine? > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > -- > Phillip Kast > (909)630-9562 > phil at unimedia.org > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From runner at berkeley.edu Sun Nov 19 12:50:53 2006 From: runner at berkeley.edu (Steven Hansen) Date: Sun, 19 Nov 2006 09:50:53 -0800 Subject: [Mongrel] Monrel Woes on Solaris x86 In-Reply-To: <455CD3E5.7040503@berkeley.edu> References: <455CD3E5.7040503@berkeley.edu> Message-ID: <4560997D.8010503@berkeley.edu> On 11/16/06, Steven Hansen wrote: > > Greetings, > > I need some help... please be gentle :-) Hello Steven, and thanks for the good collection of info ;) > NOTE: My MySql server is running on a different machine than Mongrel. Do you have access to any of the MySql server's configuration data? Which settings (if any) have been altered from the defaults? I ask due to this bit: > 4) I tried adding "ActiveRecord::Base.verification_timeout = "14400" to > my rails > environment.rb file, as per the FAQ, this had no effect. If the settings have been altered per the "Decrease the value of connect_timeout" section of the following document: http://mysqldatabaseadministration.blogspot.com/2005/11/mysql-5-optimization-and-tuning-guide.html I know its suggestions are for MySql 5 (vs. your version), but if changes similar to these have been made on your MySql server, you would need to change the "14400" value in your Rails environment to a lower value than the one set for interactive_timeout on the MySql end of things (assuming the Mongrel FAQ is accurate and current in that regard; I'm new to Mongrel, myself). > MOVING FORWARD > I'm not really sure where to go from here. Like I said, I have a strong > suspicion that MySql > is the culprit, but I'm not sure how to fix the problem. If anyone > could give me some advice > on what to try next, I would really appreciate it. If you could check (with someone, or otherwise) the MySql server-in-question's configuration to make sure Rails is using a low enough verification_timeout, that would be another positive step, IMO. Maybe it'll turn up something, as it sounds like the 'timeout' is happening at approximately 20 minutes for you, vs. documentation I have seen suggests that the default is 480 minutes. Good Luck. > Regards, > Steven Sincerely, -Parker Hi Parker, Thanks for your suggestions. Sorry for the late reply, it looks like my over zealous spam filter snagged your reply, I stumbled on your email while browsing the mailing list archives :-P I am--for now--administering the machine that the database is running on and I will try your suggestions. FWIW, I fired up good old webrick to see if the same problem would occur. Sure enough, after 20 minutes of inactivity the app would no longer respond through the browser or by doing (curl localhost:50042) while logged on to the machine. Regards, Steven From runner at berkeley.edu Sun Nov 19 22:14:36 2006 From: runner at berkeley.edu (Steven Hansen) Date: Sun, 19 Nov 2006 19:14:36 -0800 Subject: [Mongrel] Monrel Woes on Solaris x86 In-Reply-To: <4560997D.8010503@berkeley.edu> References: <455CD3E5.7040503@berkeley.edu> <4560997D.8010503@berkeley.edu> Message-ID: <45611D9C.3060606@berkeley.edu> Steven Hansen wrote: > > > On 11/16/06, Steven Hansen wrote: > > > > Greetings, > > > > I need some help... please be gentle :-) > > Hello Steven, and thanks for the good collection of info ;) > > > NOTE: My MySql server is running on a different machine than Mongrel. > > Do you have access to any of the MySql server's configuration data? > Which settings (if any) have been altered from the defaults? I ask > due to this bit: > > > 4) I tried adding "ActiveRecord::Base.verification_timeout = "14400" to > > my rails > > environment.rb file, as per the FAQ, this had no effect. > > If the settings have been altered per the "Decrease the value of > connect_timeout" section of the following document: > > http://mysqldatabaseadministration.blogspot.com/2005/11/mysql-5-optimization-and-tuning-guide.html > > > I know its suggestions are for MySql 5 (vs. your version), but if > changes similar to these have been made on your MySql server, you > would need to change the "14400" value in your Rails environment to a > lower value than the one set for interactive_timeout on the MySql end > of things (assuming the Mongrel FAQ is accurate and current in that > regard; I'm new to Mongrel, myself). > > > MOVING FORWARD > > I'm not really sure where to go from here. Like I said, I have a > strong > > suspicion that MySql > > is the culprit, but I'm not sure how to fix the problem. If anyone > > could give me some advice > > on what to try next, I would really appreciate it. > > If you could check (with someone, or otherwise) the MySql > server-in-question's configuration to make sure Rails is using a low > enough verification_timeout, that would be another positive step, IMO. > Maybe it'll turn up something, as it sounds like the 'timeout' is > happening at approximately 20 minutes for you, vs. documentation I > have seen suggests that the default is 480 minutes. Good Luck. > > > Regards, > > Steven > > Sincerely, > -Parker > > > > Hi Parker, > > Thanks for your suggestions. Sorry for the late reply, it looks like > my over zealous spam > filter snagged your reply, I stumbled on your email while browsing the > mailing list > archives :-P > > I am--for now--administering the machine that the database is running > on and I will > try your suggestions. > > FWIW, I fired up good old webrick to see if the same problem would > occur. Sure enough, > after 20 minutes of inactivity the app would no longer respond through > the browser or by > doing (curl localhost:50042) while logged on to the machine. > > Regards, > Steven > > > Well it looks like I've resolved the problem. Hooray! My mysql server's (mysqld) wait_timeout was set as follows (wait_timeout=28800). Which as Parker mentioned is 480 minutes or 8hrs! Here is a link to the mysql docs that has a description of what the wait_timeout var controls, as well as many other mysqld variables: http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html And for anyone who stumbles on an archive of this message, here is the mysql docs description of "wait_timeout" "The number of seconds the server waits for activity on a non-interactive connection before closing it. This timeout applies only to TCP/IP connections, not to connections made via Unix socket files, named pipes, or shared memory. On thread startup, the session |wait_timeout| value is initialized from the global |wait_timeout| value or from the global |interactive_timeout| value, depending on the type of client (as defined by the |CLIENT_INTERACTIVE| connect option to |mysql_real_connect()|). See also |interactive_timeout|." Interestingly enough, the mongrel FAQ says that all you need to do is to set (ActiveRecord::Base.verification_timeout = 14400) or a value lower than the server's wait_timeout value. Before altering my server's wait_timeout setting, I tried setting ActiveRecord::Base.verification_timeout to 60, 30 and 5. None of these settings made any difference as far as preventing Mongrel from locking up. Perhaps I added the setting in the wrong location in my rails environment? The FAQ doesn't mention where this setting should be added, I just assumed it should be added to config/enviroment.rb if this is wrong, let me know. -Steven From jchris at mfdz.com Mon Nov 20 13:52:06 2006 From: jchris at mfdz.com (Chris Anderson) Date: Mon, 20 Nov 2006 10:52:06 -0800 Subject: [Mongrel] Announcing Monrel Raw Output Message-ID: Mongrelians, I've just posted a GemPlugin for Mongrel, which allows you to skip all header and status-code generation, effectively hijacking the socket for whatever your needs are, from inside the depths of any Rails, Camping, Merb etc application. http://mongrel-raw-out.rubyforge.org/ or gem install mongrel_raw_output I use the plugin at work, where the client insists that testing network processes actually go over a wire. So for testing remote APIs we specify a mock server enpoint URL instead of the actual location. That mock server is a Rails app which basically dispatches URLs to chunks of data we saved using wget on the remote API. So our mock server effectively mirrors the remote server. This doesn't work with Mongrel putting its own headers onto the response, because the responses we're saving with wget already have headers. Enter mongrel_raw_output. I know it's sort of and edge case that led me to write the plugin, but I'm hoping it will come in handy for some of you. And please let me know if you have any issues or questions when using it. -- Chris Anderson http://jchris.mfdz.com From jacob at jacobatzen.dk Mon Nov 20 16:08:11 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Mon, 20 Nov 2006 22:08:11 +0100 Subject: [Mongrel] memory issues -- mongrel part of the problem? In-Reply-To: <3a2de0cd0611180845w12ee8bbcm959e35150c646b79@mail.gmail.com> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> <455BAAF7.2050209@unimedia.org> <3a2de0cd0611180845w12ee8bbcm959e35150c646b79@mail.gmail.com> Message-ID: <20061120210811.GA12971@apoc.jacobatzen.dk> On Sat, Nov 18, 2006 at 11:45:30AM -0500, Charles Brian Quinn wrote: > Phillip, thanks for this tip, > > We had a customer (www.curbly.com) that made lifehacker and the front > page of digg yesterday and had some Rmagick resizing on account signup > (and other places). We re-deployed with the GC.start fixes during the > on-slaught (the box hit 30.0+ load) and after that, she performed a > lot better (normally -- load well under 1.0). The box was running > apache 2.2.2 (mpm-prefork) with mod_proxy_balancer and 3 mongrel > instances (!) Just curious, what OS are you running on? How many hits/second were you taking? -- Cheers, - Jacob Atzen From kigsteronline at mac.com Mon Nov 20 18:04:33 2006 From: kigsteronline at mac.com (kigsteronline at mac.com) Date: Mon, 20 Nov 2006 15:04:33 -0800 Subject: [Mongrel] Mongrel / rails cheap hosting? In-Reply-To: <20061120210811.GA12971@apoc.jacobatzen.dk> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> <455BAAF7.2050209@unimedia.org> <3a2de0cd0611180845w12ee8bbcm959e35150c646b79@mail.gmail.com> <20061120210811.GA12971@apoc.jacobatzen.dk> Message-ID: <7EA1B796-3D0C-4D21-BADD-999D356C9395@mac.com> I apologize if this is email is out of place on this list, but I was wondering if anyone here can suggest a good / reliable Rails / Mongrel hosting solutions? I need something where I can host multiple applications (preferebly with PostgreSQL) for no more than $10/ month. I need fast SSH access and ideally capistrano. So far I found site5, dreamhost, hostingrails and a2hosting that fall into this price point, so if anyone has any suggestions or opinions on the above please email me directly. Thank you, Konstantin From riley.ross at gmail.com Tue Nov 21 03:55:29 2006 From: riley.ross at gmail.com (Ross Riley) Date: Tue, 21 Nov 2006 08:55:29 +0000 Subject: [Mongrel] Mongrel / rails cheap hosting? In-Reply-To: <7EA1B796-3D0C-4D21-BADD-999D356C9395@mac.com> References: <20061114231102.5722ca5a.zedshaw@zedshaw.com> <455BAAF7.2050209@unimedia.org> <3a2de0cd0611180845w12ee8bbcm959e35150c646b79@mail.gmail.com> <20061120210811.GA12971@apoc.jacobatzen.dk> <7EA1B796-3D0C-4D21-BADD-999D356C9395@mac.com> Message-ID: <15365f130611210055i3fe85bc7p9796efd5e0fed43a@mail.gmail.com> If you're ok running on a shared server then the ones you said + textdrive would probably be ok. I would say that if you're going to be doing anything commercial you should probably consider a VPS, I personally use Rimuhosting and their basic VPS is $20 per month. Shared servers are fine for smaller projects but are vulnerable to performance fluctuations, in the past I've had mongrel instances running out of memory completely. At least with a VPS you always have a stable performance guarantee, which if you've got clients constantly ringing you is worth paying the extra for peace of mind. Ross On 11/20/06, kigsteronline at mac.com wrote: > I apologize if this is email is out of place on this list, but I was > wondering if anyone here can suggest a good / reliable Rails / > Mongrel hosting solutions? I need something where I can host > multiple applications (preferebly with PostgreSQL) for no more than > $10/ month. I need fast SSH access and ideally capistrano. > > So far I found site5, dreamhost, hostingrails and a2hosting that fall > into this price point, so if anyone has any suggestions or opinions > on the above please email me directly. > > Thank you, > Konstantin > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Ross Riley www.sorrylies.com From rmdf at stimble.net Tue Nov 21 05:08:57 2006 From: rmdf at stimble.net (Michael Fairchild) Date: Tue, 21 Nov 2006 02:08:57 -0800 Subject: [Mongrel] production Message-ID: <2ef9bb620611210208y30f4ce66ld749c2574991161d@mail.gmail.com> I am unable to run mongrel in production mode on my server. On my macbook, i can run in development and production mode just fine, however on my gentoo linux server i get a segfault: > mongrel_rails start -e production -p 3007 ** Starting Mongrel listening at 0.0.0.0:3007 ** Starting Rails with production environment... /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:99: [BUG] Segmentation fault ruby 1.8.4 (2006-02-24) [x86_64-linux] Aborted I have other apps that are running ok in productioin mode on the same server. Anybody have any idea where I might look for some clues how to get it working? Thanks, ~Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061121/d5cdeab8/attachment.html From wayneeseguin at gmail.com Wed Nov 22 08:29:25 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 22 Nov 2006 08:29:25 -0500 Subject: [Mongrel] Service Temporarily Unavailable when using apache In-Reply-To: <6b6419750611131517x6cd5048sde19bde7847edcec@mail.gmail.com> References: <6b6419750611131517x6cd5048sde19bde7847edcec@mail.gmail.com> Message-ID: Pat, To me this says that you're missing a gem that is being required in your environment files. Try running "mongrel_rails start" from the rails root on the server alone and if it crashes with this message then this is most likely the case. ~Wayne On Nov 13, 2006, at 18:17 , Patrick Aljord wrote: > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- > /etc/mongrel_cluster/config/environment (LoadError) From mental at rydia.net Thu Nov 23 15:46:30 2006 From: mental at rydia.net (MenTaLguY) Date: Thu, 23 Nov 2006 15:46:30 -0500 Subject: [Mongrel] [ANN] fastthread 0.4 Message-ID: <1164314790.10272.4.camel@localhost.localdomain> fastthread is a library which replaces the synchronization primitives defined in stdlib?s thread.rb (Mutex, ConditionVariable, Queue, and SizedQueue) with optimized versions which: * are much faster (in the non-contention case, speed comparable to direct use of Thread.critical or Thread.exclusive) * don?t leak memory (the stdlib implementation of Mutex manages to trigger worst-case behavior of a memory leak in Array) To use it, simply require 'fastthread' before you require 'thread'. Provided you don?t muck with thread.rb?s internals, your code should work with no additional modification. 0.4 is primarily a robustness/bugfix release. There is both a gem and a tarball available: * http://moonbase.rydia.net/software/optimized-locking/fastthread-0.4.gem * http://moonbase.rydia.net/software/optimized-locking/fastthread-0.4.tgz -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061123/e29f12ff/attachment.bin From luislavena at gmail.com Thu Nov 23 22:22:46 2006 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 24 Nov 2006 00:22:46 -0300 Subject: [Mongrel] [ANN] Mongrel Service 0.3.0, native services for you! Message-ID: <71166b3b0611231922y5ffe6fbcvfce292c44c173655@mail.gmail.com> Hi folks, For the past weeks I have been working in solve the problems with mongrel_service and its *crazy* behavior related to standard mongrel_rails. Job made this more slow than usual, but here we are: a beta release. * What's New? - This version of mongrel_service replaces mongrel_service ruby script with a binary, pre-built executable coded using ServiceFB framework [1] in FreeBASIC. - The "change" will be transparent for you, you only need to remove/install the service again and you're done. The binary will be copied/updated automatically for you. This works with any mongrel_rails version installed. - With this we are trying to solve: a) weird problems when starting/stopping the service, say goodbye to that. b) unique codebase for fix things (mongrel_rails) instead of bunch of scripts. c) provide a simulation environment to report bugs or problems, something not easy when running as service. * How to install and use? - Download the gem file from this url: http://mmediasys.com/releases/mongrel_service-0.3.0-mswin32.gem (62KB) - Install it > gem install mongrel_service-0.3.0-mswin32.gem - Create a new service as usual: > mongrel_rails service::install -N myservice - Start it using "net" > net start myservice VERY IMPORTANT: don't use this in production. * What's planned? - Add clustering functionality. Provide from the same service code, launch N child ruby process to be balanced. Magical processor affinity for each member of the cluster (cpu affinity is disabled right now). - Add process monitoring. This functionality will relaunch the ruby process for the service in case it crash due segmentation faults or non recoverable errors in your rails application. - Complete removal of win32-service dependency - we still use this for install/remove procedures, but will be removed in following days. * How to test and report issues? This new version works encapsulating mongrel_rails script, so if your applications fails I'm almost 100% sure that will crash no matter if it run as service or a normal script. Please remember that when installing the service, its set to run using LocalService account. Use Service Control Manager from Administrative Tools to change that. 1) Try starting your application using plain mongrel_rails command. 2) If that works, use mongrel service console simulation: (example) > c:\ruby\bin\mongrel_service.exe console single -c "c:\path to my app" -p 4000 -e production - This will start the ruby process in the same way as the service. 3) If still doesn't work, report the problem in the tracker and attach servicefb.log and mongrel_service.log files located in your ruby\bin folder including details of OS, Service Pack, and the command line used by the service. Please excuse the length of this mail but wanted to be detailed as possible. [1] ServiceFB : http://opensvn.csie.org/servicefb/trunk/README -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From zedshaw at zedshaw.com Thu Nov 23 22:42:11 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 23 Nov 2006 22:42:11 -0500 Subject: [Mongrel] [OT] I Finally Got an Atom Feed Message-ID: <20061123224211.1c924841.zedshaw@zedshaw.com> Hi folks, I took a break from Mongrel today and instead whipped up an Atom feed generator for my site. People who love or utterly hate my essays will lover or utterly hate to subscribe to it. http://www.zedshaw.com/feed.atom Let me know if it isn't working well in your favorite feed reader. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From jan.svitok at gmail.com Fri Nov 24 05:39:54 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Fri, 24 Nov 2006 11:39:54 +0100 Subject: [Mongrel] [ANN] Mongrel Service 0.3.0, native services for you! In-Reply-To: <71166b3b0611231922y5ffe6fbcvfce292c44c173655@mail.gmail.com> References: <71166b3b0611231922y5ffe6fbcvfce292c44c173655@mail.gmail.com> Message-ID: <8d9b3d920611240239v4176ad3av2a96bb818dc99a3f@mail.gmail.com> On 11/24/06, Luis Lavena wrote: > Hi folks, > > For the past weeks I have been working in solve the problems with > mongrel_service and its *crazy* behavior related to standard > mongrel_rails. > > Job made this more slow than usual, but here we are: a beta release. > > * What's New? > > - This version of mongrel_service replaces mongrel_service ruby script > with a binary, pre-built executable coded using ServiceFB framework > [1] in FreeBASIC. > > - The "change" will be transparent for you, you only need to > remove/install the service again and you're done. The binary will be > copied/updated automatically for you. This works with any > mongrel_rails version installed. > > - With this we are trying to solve: > a) weird problems when starting/stopping the service, say goodbye to that. > b) unique codebase for fix things (mongrel_rails) instead of bunch of scripts. > c) provide a simulation environment to report bugs or problems, > something not easy when running as service. > > > * How to install and use? > > - Download the gem file from this url: > http://mmediasys.com/releases/mongrel_service-0.3.0-mswin32.gem (62KB) > > - Install it > > gem install mongrel_service-0.3.0-mswin32.gem > > - Create a new service as usual: > > mongrel_rails service::install -N myservice > > - Start it using "net" > > net start myservice > > VERY IMPORTANT: don't use this in production. > > > * What's planned? > > - Add clustering functionality. Provide from the same service code, > launch N child ruby process to be balanced. Magical processor affinity > for each member of the cluster (cpu affinity is disabled right now). > > - Add process monitoring. This functionality will relaunch the ruby > process for the service in case it crash due segmentation faults or > non recoverable errors in your rails application. > > - Complete removal of win32-service dependency - we still use this for > install/remove procedures, but will be removed in following days. > > > * How to test and report issues? > > This new version works encapsulating mongrel_rails script, so if your > applications fails I'm almost 100% sure that will crash no matter if > it run as service or a normal script. > > Please remember that when installing the service, its set to run using > LocalService account. Use Service Control Manager from Administrative > Tools to change that. > > 1) Try starting your application using plain mongrel_rails command. > > 2) If that works, use mongrel service console simulation: (example) > > c:\ruby\bin\mongrel_service.exe console single -c "c:\path to my > app" -p 4000 -e production > > - This will start the ruby process in the same way as the service. > > 3) If still doesn't work, report the problem in the tracker and attach > servicefb.log and mongrel_service.log files located in your ruby\bin > folder including details of OS, Service Pack, and the command line > used by the service. > > > Please excuse the length of this mail but wanted to be detailed as possible. > > [1] ServiceFB : http://opensvn.csie.org/servicefb/trunk/README I tried to download the gem, it says ERROR installing gem: blabla: string contains null byte. I suspected the problem is that you serve the gem as text/plain, but the md5sum is the same whether I downloaded it on unix or on windows (c275f1c0480161458490187b8bcf7c68). From jerome.loyet at woa.hu Fri Nov 24 05:23:33 2006 From: jerome.loyet at woa.hu (=?ISO-8859-1?Q?J=E9r=F4me?= Loyet) Date: Fri, 24 Nov 2006 11:23:33 +0100 Subject: [Mongrel] Mongrel + Apache 1.3 + OpenBSD Message-ID: <1164363813.26932.1.camel@woa-desktop> Hello, I want to install a bunch mongrel servers with an apache in fronthead, all that on OpenBSD. But OpenBSD is released with a homemade Apache 1.3.29 patched by the OpenBSD team. I really want to keep this version of apache and I don't want to change it to Apache 2.x (because of the security and the license but it's not the point here). But for having mongrel, it has to be with a Apache 2.x because the mod_proxy with balancer is not compatible with Apache 1.3. Is there a solution to this ? Have I to use fastcgi on openbsd with apache ? What solution should I use in my specific case ? Thanks you for your answers. ++ J?r?me From luislavena at gmail.com Fri Nov 24 06:58:11 2006 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 24 Nov 2006 08:58:11 -0300 Subject: [Mongrel] [ANN] Mongrel Service 0.3.0, native services for you! In-Reply-To: <8d9b3d920611240239v4176ad3av2a96bb818dc99a3f@mail.gmail.com> References: <71166b3b0611231922y5ffe6fbcvfce292c44c173655@mail.gmail.com> <8d9b3d920611240239v4176ad3av2a96bb818dc99a3f@mail.gmail.com> Message-ID: <71166b3b0611240358t658b6cf3t86377aa876531a24@mail.gmail.com> On 11/24/06, Jan Svitok wrote: > On 11/24/06, Luis Lavena wrote: [snip] > > I tried to download the gem, it says ERROR installing gem: blabla: > string contains null byte. > > I suspected the problem is that you serve the gem as text/plain, but > the md5sum is the same whether I downloaded it on unix or on windows > (c275f1c0480161458490187b8bcf7c68). Fixed, was a bad upload. Tested at home but firefox served me the cached download instead. Please excuse the problems and try downloading it again. -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From al-mongrelusers at none.at Fri Nov 24 07:03:07 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Fri, 24 Nov 2006 13:03:07 +0100 Subject: [Mongrel] Mongrel + Apache 1.3 + OpenBSD In-Reply-To: <1164363813.26932.1.camel@woa-desktop> References: <1164363813.26932.1.camel@woa-desktop> Message-ID: <20061124120307.GA32687@none.at> Hi, On Fre 24.11.2006 11:23, J?r?me Loyet wrote: > >Is there a solution to this ? Have I to use fastcgi on openbsd with >apache ? What solution should I use in my specific case ? Personally I see 2: 1.) + --> mongrel Apache1 -> SW-LB (e.g.: haproxy, pen, pound, ...) | --> mongrel . . + --> mongrel 2.) +--> Apache1 --> mongrel SW-LB (e.g.: haproxy, pen, pound, ...) |--> Apache1 --> mongrel . . +--> Apache1 --> mongrel I would prefer 1.) with haproxy (http://haproxy.1wt.eu/) and you don't need the apache2 *monster ;-) With haproxy you can make the balancing on http level or, simplier, on tcp level ;-) Jm2c && hth Aleks From jw at innerewut.de Fri Nov 24 07:18:45 2006 From: jw at innerewut.de (Jonathan Weiss) Date: Fri, 24 Nov 2006 13:18:45 +0100 Subject: [Mongrel] Mongrel + Apache 1.3 + OpenBSD In-Reply-To: <1164363813.26932.1.camel@woa-desktop> References: <1164363813.26932.1.camel@woa-desktop> Message-ID: <4566E325.2090105@innerewut.de> > Is there a solution to this ? Have I to use fastcgi on openbsd with > apache ? What solution should I use in my specific case ? You need to use another balancer liken pen, ngix & co between Apache and Mongrel. Apache's mod_proxy forwards the request to the pen&co and this middleman ditributes the request between the several Mongrels. See the mongrel homepage for docs on pen&co. > > Thanks you for your answers. > ++ J?r?me > Jonathan -- Jonathan Weiss http://blog.innerewut.de From jan.svitok at gmail.com Fri Nov 24 07:44:31 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Fri, 24 Nov 2006 13:44:31 +0100 Subject: [Mongrel] [ANN] Mongrel Service 0.3.0, native services for you! In-Reply-To: <71166b3b0611240358t658b6cf3t86377aa876531a24@mail.gmail.com> References: <71166b3b0611231922y5ffe6fbcvfce292c44c173655@mail.gmail.com> <8d9b3d920611240239v4176ad3av2a96bb818dc99a3f@mail.gmail.com> <71166b3b0611240358t658b6cf3t86377aa876531a24@mail.gmail.com> Message-ID: <8d9b3d920611240444t67190841l877abcb169ac28ce@mail.gmail.com> On 11/24/06, Luis Lavena wrote: > On 11/24/06, Jan Svitok wrote: > > On 11/24/06, Luis Lavena wrote: > [snip] > > > > I tried to download the gem, it says ERROR installing gem: blabla: > > string contains null byte. > > > > I suspected the problem is that you serve the gem as text/plain, but > > the md5sum is the same whether I downloaded it on unix or on windows > > (c275f1c0480161458490187b8bcf7c68). > > Fixed, was a bad upload. Tested at home but firefox served me the > cached download instead. > > Please excuse the problems and try downloading it again. Thanks, it works now (it's installed, not started yet). From rmdf at stimble.net Fri Nov 24 20:17:45 2006 From: rmdf at stimble.net (Michael Fairchild) Date: Fri, 24 Nov 2006 17:17:45 -0800 Subject: [Mongrel] [OT] I Finally Got an Atom Feed In-Reply-To: <20061123224211.1c924841.zedshaw@zedshaw.com> References: <20061123224211.1c924841.zedshaw@zedshaw.com> Message-ID: <2ef9bb620611241717s15f02d1ft4c259191e182d458@mail.gmail.com> Thats great you've got an atom feed. Just so you know, I use flock and when I click on the link, it tries ot download, not dispaly. M Thanks for the great work. ~Michael On 11/23/06, Zed A. Shaw wrote: > > Hi folks, > > I took a break from Mongrel today and instead whipped up an Atom feed > generator for my site. People who love or utterly hate my essays will lover > or utterly hate to subscribe to it. It works in opera tho. http://www.zedshaw.com/feed.atom > > Let me know if it isn't working well in your favorite feed reader. > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://www.awprofessional.com/title/0321483502 -- The Mongrel Book > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061124/ccad303c/attachment.html From zedshaw at zedshaw.com Fri Nov 24 21:12:39 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 24 Nov 2006 21:12:39 -0500 Subject: [Mongrel] [OT] I Finally Got an Atom Feed In-Reply-To: <2ef9bb620611241717s15f02d1ft4c259191e182d458@mail.gmail.com> References: <20061123224211.1c924841.zedshaw@zedshaw.com> <2ef9bb620611241717s15f02d1ft4c259191e182d458@mail.gmail.com> Message-ID: <20061124211239.c510905d.zedshaw@zedshaw.com> On Fri, 24 Nov 2006 17:17:45 -0800 "Michael Fairchild" wrote: > Thats great you've got an atom feed. Just so you know, I use flock and when > I click on the link, it tries ot download, not dispaly. M > Thanks for the great work. Interesting. I'm planning on using this same code to do an atom feed for the Mongrel site as well. Do you know if it's the mime type that's confusing flock? What type does flock expect? -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From technoweenie at gmail.com Fri Nov 24 22:24:35 2006 From: technoweenie at gmail.com (Rick Olson) Date: Fri, 24 Nov 2006 21:24:35 -0600 Subject: [Mongrel] [OT] I Finally Got an Atom Feed In-Reply-To: <20061124211239.c510905d.zedshaw@zedshaw.com> References: <20061123224211.1c924841.zedshaw@zedshaw.com> <2ef9bb620611241717s15f02d1ft4c259191e182d458@mail.gmail.com> <20061124211239.c510905d.zedshaw@zedshaw.com> Message-ID: <48fe25b0611241924k64e96c40v1f0db2263776c479@mail.gmail.com> > Interesting. I'm planning on using this same code to do an atom feed for the Mongrel site as well. Do you know if it's the mime type that's confusing flock? What type does flock expect? It's coming back as application/atom+xml, which is the correct content type. This just means your browser isn't set up for that mime type. Safari opens the feed up in Vienna, and Firefox opens it up in Bloglines. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From zedshaw at zedshaw.com Sat Nov 25 00:25:43 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sat, 25 Nov 2006 00:25:43 -0500 Subject: [Mongrel] Updated Apache Best Practices Doc fixes In-Reply-To: <3a2de0cd0610231147q7c1d64b7u9fda2113ff1289a4@mail.gmail.com> References: <3a2de0cd0610231147q7c1d64b7u9fda2113ff1289a4@mail.gmail.com> Message-ID: <20061125002543.b2c78ba0.zedshaw@zedshaw.com> On Mon, 23 Oct 2006 14:47:00 -0400 "Charles Brian Quinn" wrote: > Hi guys, > > Thanks to several members I've updated the apache best practices docs > to include several fixes including the bug reported (by Zed and > someone else I believe, sorry for the non-attribution) with IE's \b > instead of b rule for deflate. Charles, I *finally* got this applied and into svn. It'll be on the site shortly. Sorry it took me so long. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Sat Nov 25 01:11:30 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sat, 25 Nov 2006 01:11:30 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.17 PR -- Big Work Day, 1.0 RC1 Very Close Message-ID: <20061125011130.ee055a7a.zedshaw@zedshaw.com> Hello Everyone, We're hard at work getting the hot new win32 service Luis wrote out and ready for production. We're hoping to have that included in the 1.0 RC1 release we make very soon. This pre-release is just to make sure that we didn't step on any toes. Install it with: $ gem install fastthread --source=http://mongrel.rubyforge.org/releases $ gem install mongrel --source=http://mongrel.rubyforge.org/releases The fastthread gem implements mentalguy's fastthread set of Thread locking alternatives. It is optional, so if it causes you problems, remove it from your gems: $ gem uninstall fastthread Restart Mongrel and all will be as it was before. The fastthread stuff will hopefully make Mongrel a little quicker and also reduce it's memory leakage potential. CHANGES This release features preliminary support for fastthread, the fixing of all the bugs reported that could be fixed, and a small change to how headers go out so Rails 1.2 RC1 is good. This change makes it so that headers only go out once, first come first served. Read the ChangeLog: http://mongrel.rubyforge.org/releases/ChangeLog I also removed the proposed new multipart mime parsing since it was too experimental. SITE There were a bunch of changes to the site, but mostly just corrections. New pages that people can access are: A joke page about Mongrel MUDCRAP certification that hasn't changed but is now accesible from the site menu: http://mongrel.rubyforge.org/certified.html A page pimping books: http://mongrel.rubyforge.org/books.html And there's now an Atom feed at http://mongrel.rubyforge.org/feed.atom which you can subscribe to and get notified of updates to *any* pages. Let me know how this works out. BOOKS You'll notice the books page mentions my book, as well as one by Fabio Akita, but I want to mention any books that mention Mongrel as well. The more information about Mongrel there is the better. If you've got a book that available for purchase then let me know and I'll put it on the site promptly. LINKS News: http://mongrel.rubyforge.org/news.html Atom: http://mongrel.rubyforge.org/feed.atom ChangeLog: http://mongrel.rubyforge.org/releases/ChangeLog Books: http://mongrel.rubyforge.org/books.html Certified: http://mongrel.rubyforge.org/certified.html -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From tom at hur.st Sat Nov 25 05:52:33 2006 From: tom at hur.st (Thomas Hurst) Date: Sat, 25 Nov 2006 10:52:33 +0000 Subject: [Mongrel] [PATCH] HTTP accept filter support for FreeBSD Message-ID: <20061125105233.GA1373@voi.aagh.net> This small patch extends configure_socket_options to support FreeBSD's accf_http(9), which defers accept() until there's a full HTTP request to read. Seems to work fine on 6.1-STABLE. DragonflyBSD should work too provided the /freebsd/ line is modified to match it. accf_http(9): http://www.freebsd.org/cgi/man.cgi?query=accf_http&sektion=9 -- Thomas 'Freaky' Hurst http://hur.st/ -------------- next part -------------- --- mongrel.rb.orig Sat Nov 25 05:19:12 2006 +++ mongrel.rb Sat Nov 25 08:41:20 2006 @@ -666,10 +666,17 @@ end def configure_socket_options - if /linux/ === RUBY_PLATFORM + case RUBY_PLATFORM + when /linux/ # 9 is currently TCP_DEFER_ACCEPT - $tcp_defer_accept_opts = [9,1] - $tcp_cork_opts = [3,1] + $tcp_defer_accept_opts = [Socket::SOL_TCP, 9, 1] + $tcp_cork_opts = [Socket::SOL_TCP, 3, 1] + when /freebsd/ + # Use the HTTP accept filter if available. + # The struct made by pack() is defined in /usr/include/sys/socket.h as accept_filter_arg + unless `/sbin/sysctl -nq net.inet.accf.http`.empty? + $tcp_defer_accept_opts = [Socket::SOL_SOCKET, Socket::SO_ACCEPTFILTER, ['httpready', nil].pack('a16a240')] + end end end @@ -680,13 +687,13 @@ configure_socket_options - @socket.setsockopt(Socket::SOL_TCP, $tcp_defer_accept_opts[0], $tcp_defer_accept_opts[1]) if $tcp_defer_accept_opts + @socket.setsockopt(*$tcp_defer_accept_opts) if $tcp_defer_accept_opts @acceptor = Thread.new do while true begin client = @socket.accept - client.setsockopt(Socket::SOL_TCP, $tcp_cork_opts[0], $tcp_cork_opts[1]) if $tcp_cork_opts + client.setsockopt(*$tcp_cork_opts) if $tcp_cork_opts worker_list = @workers.list From rmdf at stimble.net Sat Nov 25 13:23:24 2006 From: rmdf at stimble.net (Michael Fairchild) Date: Sat, 25 Nov 2006 10:23:24 -0800 Subject: [Mongrel] [OT] I Finally Got an Atom Feed In-Reply-To: <48fe25b0611241924k64e96c40v1f0db2263776c479@mail.gmail.com> References: <20061123224211.1c924841.zedshaw@zedshaw.com> <2ef9bb620611241717s15f02d1ft4c259191e182d458@mail.gmail.com> <20061124211239.c510905d.zedshaw@zedshaw.com> <48fe25b0611241924k64e96c40v1f0db2263776c479@mail.gmail.com> Message-ID: <2ef9bb620611251023l7cdef406tc0f256a3744cbb4@mail.gmail.com> I just did a little more testing and it appears that it is just the .atom at the end of the url that confuses flock and makes it think it needs to download the file. I manually added it to my feeds and it works fine that way. In any case, Its a flock issue. ~michael On 11/24/06, Rick Olson wrote: > > > Interesting. I'm planning on using this same code to do an atom feed > for the Mongrel site as well. Do you know if it's the mime type that's > confusing flock? What type does flock expect? > > It's coming back as application/atom+xml, which is the correct content > type. This just means your browser isn't set up for that mime type. > Safari opens the feed up in Vienna, and Firefox opens it up in > Bloglines. > > -- > Rick Olson > http://weblog.techno-weenie.net > http://mephistoblog.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: http://rubyforge.org/pipermail/mongrel-users/attachments/20061125/cd79a893/attachment.html From jacob at jacobatzen.dk Sat Nov 25 13:49:35 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Sat, 25 Nov 2006 19:49:35 +0100 Subject: [Mongrel] [ANN] Mongrel 0.3.17 PR -- Big Work Day, 1.0 RC1 Very Close In-Reply-To: <20061125011130.ee055a7a.zedshaw@zedshaw.com> References: <20061125011130.ee055a7a.zedshaw@zedshaw.com> Message-ID: <20061125184935.GA28615@apoc.jacobatzen.dk> Hello Zed, Just wanted to let you know that from the testing I've done this release seems to be very stable on my setup. So far I have been unable to crash mongrel when using 512 or 128 processors. I'm still experiencing lockups with 1024 processors though. Additionally it seems something is still leaking memory when threads get killed. I am seeing processes eating up to ~95MB with 512 processors and ~170MB with 1024. It does seem to only grow to somewhere around these sizes and then it stops leaking. Unfortunately the memory is not freed again as far as I can tell. But keeping the number of processors low will also keep the memory usage acceptable. Anyways, I'm really excited to have a stable mongrel, so thank you very much! -- Cheers, - Jacob Atzen From zedshaw at zedshaw.com Sat Nov 25 14:05:53 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sat, 25 Nov 2006 14:05:53 -0500 Subject: [Mongrel] [PATCH] HTTP accept filter support for FreeBSD In-Reply-To: <20061125105233.GA1373@voi.aagh.net> References: <20061125105233.GA1373@voi.aagh.net> Message-ID: <20061125140553.3ad5c4f4.zedshaw@zedshaw.com> On Sat, 25 Nov 2006 10:52:33 +0000 Thomas Hurst wrote: > This small patch extends configure_socket_options to support FreeBSD's > accf_http(9), which defers accept() until there's a full HTTP request > to read. Very nice. This is in the 0.3.18 which is now on the pre-release site. Try it out for me. gem install mongrel --source=http://mongrel.rubyforge.org/releases/ Thanks. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From will at hotgazpacho.com Sat Nov 25 14:01:02 2006 From: will at hotgazpacho.com (Will Green) Date: Sat, 25 Nov 2006 14:01:02 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.17 PR -- Big Work Day, 1.0 RC1 Very Close In-Reply-To: <20061125184935.GA28615@apoc.jacobatzen.dk> References: <20061125011130.ee055a7a.zedshaw@zedshaw.com> <20061125184935.GA28615@apoc.jacobatzen.dk> Message-ID: <456892EE.6000800@hotgazpacho.com> 128, 512, and 1024 Processors (hardware)? Do you perhaps mean processes (software)? You either have some serious SERIOUS Enterprisey Hardware, or you're spawning an (IMHO) ridiculous number of Mongrels... Jacob Atzen wrote: > Hello Zed, > > Just wanted to let you know that from the testing I've done this release > seems to be very stable on my setup. So far I have been unable to crash > mongrel when using 512 or 128 processors. I'm still experiencing lockups > with 1024 processors though. Additionally it seems something is > still leaking memory when threads get killed. I am seeing processes > eating up to ~95MB with 512 processors and ~170MB with 1024. It does > seem to only grow to somewhere around these sizes and then it stops > leaking. Unfortunately the memory is not freed again as far as I can > tell. But keeping the number of processors low will also keep the memory > usage acceptable. > > Anyways, I'm really excited to have a stable mongrel, so thank you very > much! > From jacob at jacobatzen.dk Sat Nov 25 14:24:31 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Sat, 25 Nov 2006 20:24:31 +0100 Subject: [Mongrel] [ANN] Mongrel 0.3.17 PR -- Big Work Day, 1.0 RC1 Very Close In-Reply-To: <20061125184935.GA28615@apoc.jacobatzen.dk> References: <20061125011130.ee055a7a.zedshaw@zedshaw.com> <20061125184935.GA28615@apoc.jacobatzen.dk> Message-ID: <20061125192431.GA31401@apoc.jacobatzen.dk> On Sat, Nov 25, 2006 at 07:49:35PM +0100, Jacob Atzen wrote: > eating up to ~95MB with 512 processors and ~170MB with 1024. It does > seem to only grow to somewhere around these sizes and then it stops > leaking. Unfortunately the memory is not freed again as far as I can > tell. It appears this is only a problem when Rails is in development mode. In production mode all memory is nicely deallocated as far as I can tell. -- Cheers, - Jacob Atzen From mental at rydia.net Sat Nov 25 14:35:11 2006 From: mental at rydia.net (MenTaLguY) Date: Sat, 25 Nov 2006 14:35:11 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.17 PR -- Big Work Day, 1.0 RC1 Very Close In-Reply-To: <20061125011130.ee055a7a.zedshaw@zedshaw.com> References: <20061125011130.ee055a7a.zedshaw@zedshaw.com> Message-ID: <1164483311.9474.3.camel@localhost.localdomain> On Sat, 2006-11-25 at 01:11 -0500, Zed A. Shaw wrote: > Restart Mongrel and all will be as it was before. The fastthread > stuff will hopefully make Mongrel a little quicker and also reduce > it's memory leakage potential. Incidentally, in 0.4 I think I've finally taken care of all of the issues Luis identified as blocking a Win32 build of fastthread. I guess the main remaining thing is to write the Win32 gemspec magic. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061125/55f229d5/attachment.bin From jacob at jacobatzen.dk Sat Nov 25 14:44:57 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Sat, 25 Nov 2006 20:44:57 +0100 Subject: [Mongrel] [ANN] Mongrel 0.3.17 PR -- Big Work Day, 1.0 RC1 Very Close In-Reply-To: <456892EE.6000800@hotgazpacho.com> References: <20061125011130.ee055a7a.zedshaw@zedshaw.com> <20061125184935.GA28615@apoc.jacobatzen.dk> <456892EE.6000800@hotgazpacho.com> Message-ID: <20061125194457.GA32686@apoc.jacobatzen.dk> On Sat, Nov 25, 2006 at 02:01:02PM -0500, Will Green wrote: > 128, 512, and 1024 Processors (hardware)? Do you perhaps mean processes > (software)? > > You either have some serious SERIOUS Enterprisey Hardware, or you're > spawning an (IMHO) ridiculous number of Mongrels... I was refering to the -n parameter. From the output of mongrel_rails start -h: -n, --num-procs INT Number of processors active before clients denied -- Cheers, - Jacob Atzen From zedshaw at zedshaw.com Sat Nov 25 15:39:37 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sat, 25 Nov 2006 15:39:37 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.18 PR -- Lightning Fast Turnaround Message-ID: <20061125153937.6780c8f9.zedshaw@zedshaw.com> Alright folks, I put in a fix for camping and added the patch by Thomas Hurst for the accf_http deferred accept settings for FreeBSD. As usual, please test this release out and let me know if it has any additional problems. I'll be working on win32 builds today and tomorrow with Luis. Install with: sudo gem install fastthread --source=http://mongrel.rubyforge.org/releases sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases Fastthread didn't change so you don't need the first install if you've got it already. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From tom at hur.st Sat Nov 25 16:37:22 2006 From: tom at hur.st (Thomas Hurst) Date: Sat, 25 Nov 2006 21:37:22 +0000 Subject: [Mongrel] [PATCH] HTTP accept filter support for FreeBSD In-Reply-To: <20061125140553.3ad5c4f4.zedshaw@zedshaw.com> References: <20061125105233.GA1373@voi.aagh.net> <20061125140553.3ad5c4f4.zedshaw@zedshaw.com> Message-ID: <20061125213722.GA41380@voi.aagh.net> * Zed A. Shaw (zedshaw at zedshaw.com) wrote: > On Sat, 25 Nov 2006 10:52:33 +0000 Thomas Hurst wrote: > > > This small patch extends configure_socket_options to support > > FreeBSD's accf_http(9), which defers accept() until there's a full > > HTTP request to read. > > Very nice. This is in the 0.3.18 which is now on the pre-release > site. Try it out for me. Thanks :) > gem install mongrel --source=http://mongrel.rubyforge.org/releases/ This reinstalls 0.3.17 for me. Had to grab the gem manually. One of my camping apps now throws EINVAL; turns out I was calling HttpServer#run twice, once in Mongrel::Camping.start, and again on the returned HttpServer. Oops. The comments in mongrel/camping.rb say to do something like: Mongrel::Camping::start("0.0.0.0",3001,"/tepee",Tepee).join But there's no HttpServer#join method; either it needs to return the result from .run, .join needs to be added, or this should be changed to .acceptor.join. -- Thomas 'Freaky' Hurst http://hur.st/ From zedshaw at zedshaw.com Sat Nov 25 18:21:14 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sat, 25 Nov 2006 18:21:14 -0500 Subject: [Mongrel] [PATCH] HTTP accept filter support for FreeBSD In-Reply-To: <20061125213722.GA41380@voi.aagh.net> References: <20061125105233.GA1373@voi.aagh.net> <20061125140553.3ad5c4f4.zedshaw@zedshaw.com> <20061125213722.GA41380@voi.aagh.net> Message-ID: <20061125182114.cc92ebd2.zedshaw@zedshaw.com> On Sat, 25 Nov 2006 21:37:22 +0000 Thomas Hurst wrote: > * Zed A. Shaw (zedshaw at zedshaw.com) wrote: > > gem install mongrel --source=http://mongrel.rubyforge.org/releases/ > > This reinstalls 0.3.17 for me. Had to grab the gem manually. Oops, looks like the old version was pushed again. 0.3.18 is up now and verified. Try it again. > One of my camping apps now throws EINVAL; turns out I was calling > HttpServer#run twice, once in Mongrel::Camping.start, and again on the > returned HttpServer. Oops. > > The comments in mongrel/camping.rb say to do something like: > > Mongrel::Camping::start("0.0.0.0",3001,"/tepee",Tepee).join The docs might be old, I'll look at the real code and update for 0.3.19. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Sat Nov 25 18:28:44 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sat, 25 Nov 2006 18:28:44 -0500 Subject: [Mongrel] [ANN] Mongrel 0.3.18 PR -- Lightning Fast Turnaround In-Reply-To: <20061125153937.6780c8f9.zedshaw@zedshaw.com> References: <20061125153937.6780c8f9.zedshaw@zedshaw.com> Message-ID: <20061125182844.1e5f7d25.zedshaw@zedshaw.com> On Sat, 25 Nov 2006 15:39:37 -0500 "Zed A. Shaw" wrote: > Alright folks, I put in a fix for camping and added the patch by Thomas Hurst for the accf_http deferred accept settings for FreeBSD. > Holy crap I'm gonna kill the rubygems team. Ok folks, if you do this: sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases You magically get 0.3.17 but if you do this: sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases/ You get 0.3.18 (notice the / now). I have no idea at all why this is happening, and since I can't delete files on the rubyforge server it will probably be a constant problem. Anyone have an idea why this is happening? -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From list at bednarz.ch Sun Nov 26 03:00:50 2006 From: list at bednarz.ch (Tom Bednarz) Date: Sun, 26 Nov 2006 09:00:50 +0100 Subject: [Mongrel] mongrel & apache on Win32 Message-ID: <456949B2.8000406@bednarz.ch> I am thinking about migrating a Java based Web Application to Ruby & Rails. Before I start the work I need more information about the runtime environment. I am forced to use Windows 2003 Server and I need SSL. My Java Web Apps all run on Apache 2.x with any of the many J2EE App Servers (Tomcat, Geronimo, etc...) an Windows without any problems. From reading the mongrel web-site I learned that Rails is not threadsafe and therefore every HttpRequest is synchonised. To compensate the performance draw-backs you suggest to use multiple instances of Mongrel with Apache and its mod_proxy_balancer. Questions: ********** Is there a mongrel cluster for Win32? How can I run multiple instances of mongrel on Win32? Capistrano on Win32?? Many thanks for your feedback! Thomas From olle at olleolleolle.dk Sun Nov 26 03:54:35 2006 From: olle at olleolleolle.dk (Olle Jonsson) Date: Sun, 26 Nov 2006 09:54:35 +0100 Subject: [Mongrel] [ANN] Mongrel 0.3.18 PR -- Lightning Fast Turnaround In-Reply-To: References: Message-ID: <8E5443C1-4032-42D5-AE32-A81837A18B78@olleolleolle.dk> > Install with: > > sudo gem install fastthread --source=http://mongrel.rubyforge.org/ > releases > sudo gem install mongrel --source=http://mongrel.rubyforge.org/ > releases > > Fastthread didn't change so you don't need the first install if > you've got it already. Or, update your existing gems (from Mongrel) with: sudo gem up --source=http://mongrel.rubyforge.org/releases best regards, and thanks for all the software, Olle, Copenhagen PS: I'm reading the list digest-mode, so I apologize if this is already talked about. The reason I post is that running the sudo gem install command only gave me the same 0.3.17 release that I got yesterday evening. Hence, this post. From will at hotgazpacho.com Sun Nov 26 09:31:07 2006 From: will at hotgazpacho.com (Will Green) Date: Sun, 26 Nov 2006 09:31:07 -0500 Subject: [Mongrel] mongrel & apache on Win32 In-Reply-To: <456949B2.8000406@bednarz.ch> References: <456949B2.8000406@bednarz.ch> Message-ID: <4569A52B.6070606@hotgazpacho.com> > Is there a mongrel cluster for Win32? Yes, mongrel works on Windows, and you can start a cluster. BTW, I compiled the 0.3.17 pre-release on win32 the other day, and it appears to have compiled without complaint (even with fastthread). I have not, however, had the opportunity to test it. > How can I run multiple instances of mongrel on Win32? Luis Lavena is working on cleaning up the code for running a Mongrel cluster as a service. Stay tuned... > Capistrano on Win32?? If you set up a Cygwin environment to get SSH and the other tools Capistrano expects (cp, ls, tar, gzip, sudo, etc.), then yes. I have done this in development, but not production. > Many thanks for your feedback! Just out of curiosity, is your Java web app broken? The Rubyists might string me up for this, but if it ain't broke, don't fix it. Especially if it is mission critical (i.e. the unavailability of your web app for more than a minute or two will cost you pain, suffering, or your job). That said, at my former employer, I converted a (simple) Java web app running on Windows to a Rails app on Linux, but I also had a week with utterly nothing else to do, a clueless manager who didn't know a thing about managing a programmer (much less managing a person), a supervisor who encouraged me to learn new things, and no one screaming bloody murder if the app was down for a while. == Will From list at bednarz.ch Sun Nov 26 12:29:09 2006 From: list at bednarz.ch (Tom Bednarz) Date: Sun, 26 Nov 2006 18:29:09 +0100 Subject: [Mongrel] mongrel & apache on Win32 In-Reply-To: <4569A52B.6070606@hotgazpacho.com> References: <456949B2.8000406@bednarz.ch> <4569A52B.6070606@hotgazpacho.com> Message-ID: <4569CEE5.20707@bednarz.ch> Hi Will, Thanks a lot for your feedback! > > Just out of curiosity, is your Java web app broken? The Rubyists might > string me up for this, but if it ain't broke, don't fix it. Especially > if it is mission critical (i.e. the unavailability of your web app for > more than a minute or two will cost you pain, suffering, or your job). > > That said, at my former employer, I converted a (simple) Java web app > running on Windows to a Rails app on Linux, but I also had a week with > utterly nothing else to do, a clueless manager who didn't know a thing > about managing a programmer (much less managing a person), a supervisor > who encouraged me to learn new things, and no one screaming bloody > murder if the app was down for a while. > > == > Will Regarding Java / Rails etc: It is a Web-Frontend for a self owned product. I like to extend the application and I have the impression, that development with ruby and the rails framework is a lot faster then with Java. Java is a good technology and it offers a lot of OpenSource support (Apache group) and it is bullet proof in production. Java has many different OpenSource MVC frameworks. Struts is probably the most known because it was one of the first on the market. What I consider a problem is that every Java Web App ends up in writing endless XML configuration files that you cannot debug. Basically you can spend hours and days to find a bug in your application which finally turns out to be a misconfigured XML file! I really hate that meanwile!!! So basically I am looking for an environment that speeds up development time and thats currently the only reason, why I am looking at Ruby on Rails. On the Java side there are also newer frameworks such as JavaServer Faces. Groovy is a scripting language that borrowed a lot from Ruby. Tom From cremes.devlist at mac.com Sun Nov 26 16:17:39 2006 From: cremes.devlist at mac.com (cremes.devlist at mac.com) Date: Sun, 26 Nov 2006 15:17:39 -0600 Subject: [Mongrel] Writing a mod_put HttpHandler Message-ID: I'm looking at writing a Mongrel handler that mimics the behavior of the Apache mod_put [1]. It allows for the streaming upload of very large (GB) files; it also supports resumable upload. Before I get too involved, I'd like to ask if my reading of the mongrel source code is correct, i.e. what I want to do isn't currently possible. Looking at the class HttpRequest I see that request bodies larger than Mongrel::MAX_BODY get streamed to a tempfile before they are handed off to any handlers registered in the chain. Things were looking up for me when I saw the HttpHandler#request_progress call, but it doesn't hand the body off to the handler (only the params). In other words, mongrel would need to stream the entire upload to a tempfile before it hands off to my "PUT handler," right? If that's the case, any suggestions on how I could hack the code to hook into the HttpRequest class and redirect the write from "tempfile" to the real permanent file? This code path would only need to be activated for HTTP PUT where Content-Length is greater than Mongrel::MAX_BODY. Of course, I'd like that hack to allow all other requests to work normally. Thanks for any input and pointers. If you think I'm nuts for looking at Mongrel to do this operation, suggest another method that doesn't involve Apache and mod_put. cr [1] http://www.gknw.at/development/apache/httpd-2.0/unix/modules/ mod_put-2.0.8.tar.gz From ezmobius at gmail.com Sun Nov 26 17:14:46 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Sun, 26 Nov 2006 14:14:46 -0800 Subject: [Mongrel] Writing a mod_put HttpHandler In-Reply-To: References: Message-ID: <72EDB5A3-DBB3-4B12-BB7B-AEB15A4B0384@gmail.com> On Nov 26, 2006, at 1:17 PM, cremes.devlist at mac.com wrote: > I'm looking at writing a Mongrel handler that mimics the behavior of > the Apache mod_put [1]. It allows for the streaming upload of very > large (GB) files; it also supports resumable upload. > > Before I get too involved, I'd like to ask if my reading of the > mongrel source code is correct, i.e. what I want to do isn't > currently possible. > > Looking at the class HttpRequest I see that request bodies larger > than Mongrel::MAX_BODY get streamed to a tempfile before they are > handed off to any handlers registered in the chain. Things were > looking up for me when I saw the HttpHandler#request_progress call, > but it doesn't hand the body off to the handler (only the params). In > other words, mongrel would need to stream the entire upload to a > tempfile before it hands off to my "PUT handler," right? > > If that's the case, any suggestions on how I could hack the code to > hook into the HttpRequest class and redirect the write from > "tempfile" to the real permanent file? This code path would only need > to be activated for HTTP PUT where Content-Length is greater than > Mongrel::MAX_BODY. Of course, I'd like that hack to allow all other > requests to work normally. > > Thanks for any input and pointers. > > If you think I'm nuts for looking at Mongrel to do this operation, > suggest another method that doesn't involve Apache and mod_put. You are correct. The way mongrel upload progress works is mongrel itself streams to a tmpfile before it passes the request to any handlers. Then by the tiem your handler gets the request it has to parse the mime boundaries again which is inefficient. Zed is working on a fast C mime carver and I am going to implement a way to grab the tmpfile mongrel makes without reparsing it but we haven't made progress yet. So let me know if you end up workign on this or if you want to work with me to come up with a way to get the first tmpfile without reparsing. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From cremes.devlist at mac.com Sun Nov 26 19:00:15 2006 From: cremes.devlist at mac.com (cremes.devlist at mac.com) Date: Sun, 26 Nov 2006 18:00:15 -0600 Subject: [Mongrel] Writing a mod_put HttpHandler In-Reply-To: <72EDB5A3-DBB3-4B12-BB7B-AEB15A4B0384@gmail.com> References: <72EDB5A3-DBB3-4B12-BB7B-AEB15A4B0384@gmail.com> Message-ID: <62F69DA1-0C3B-445B-89CA-87EE0A25CB32@mac.com> On Nov 26, 2006, at 4:14 PM, Ezra Zygmuntowicz wrote: > > On Nov 26, 2006, at 1:17 PM, cremes.devlist at mac.com wrote: > >> I'm looking at writing a Mongrel handler that mimics the behavior of >> the Apache mod_put [1]. It allows for the streaming upload of very >> large (GB) files; it also supports resumable upload. >> >> Before I get too involved, I'd like to ask if my reading of the >> mongrel source code is correct, i.e. what I want to do isn't >> currently possible. >> [snip[ > > You are correct. The way mongrel upload progress works is mongrel > itself streams to a tmpfile before it passes the request to any > handlers. Then by the tiem your handler gets the request it has to > parse the mime boundaries again which is inefficient. Zed is working > on a fast C mime carver and I am going to implement a way to grab the > tmpfile mongrel makes without reparsing it but we haven't made > progress yet. Ezra, I don't see where Mongrel is doing any mime parsing in the HttpRequest class. As far as I can see, it's just dumping the contents of @params.http_body to a TempFile without any intermediate parsing. > So let me know if you end up workign on this or if you want to work > with me to come up with a way to get the first tmpfile without > reparsing. Sure, I'd like to work with you on this. I either get this working in Mongrel or I bite the bullet and use Apache/mod_put (which, in my particular circumstances, will require me to bend all sorts of other rules). What ideas have you developed for grabbing the TempFile? From a cursory look at the code, here's my first idea. Feel free to poke holes in it. 1. Modify the HttpRequest class to stop reading from @params.http_body into @body at Mongrel::MAX_BODY bytes. Set internal flag on this request to indicate the request is unfinished. 2. Add #done? to HttpRequest class to test internal flag and return its true/false state. 3. Modify HttpServer#process_client in the following ways: 3a. Do not allocate an HttpResponse object unless request.done? 3b. Do not finalize the response object until request.done? This would have the effect of calling handlers with a nil 'response' and a potentially unfinalized 'request' which would probably break all current handlers. :-( Alternately, create a second chain of handlers which register for 'partial requests' and only call the other handler chain when the request and response objects are whole/finalized. We avoid the use of TempFiles altogether with this approach and allow this new class of handler to be the first to hit the disk. If the TempFile behavior is necessary for other handler's proper operation, Mongrel could ship with a handler that restores this functionality as the default. cr From luislavena at gmail.com Sun Nov 26 22:36:27 2006 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 27 Nov 2006 00:36:27 -0300 Subject: [Mongrel] mongrel & apache on Win32 In-Reply-To: <4569A52B.6070606@hotgazpacho.com> References: <456949B2.8000406@bednarz.ch> <4569A52B.6070606@hotgazpacho.com> Message-ID: <71166b3b0611261936j2c01532fmc6582154c05209ca@mail.gmail.com> On 11/26/06, Will Green wrote: > > Is there a mongrel cluster for Win32? > > Yes, mongrel works on Windows, and you can start a cluster. BTW, I > compiled the 0.3.17 pre-release on win32 the other day, and it appears > to have compiled without complaint (even with fastthread). I have not, > however, had the opportunity to test it. > > > How can I run multiple instances of mongrel on Win32? > > Luis Lavena is working on cleaning up the code for running a Mongrel > cluster as a service. Stay tuned... > Yep, will be adding process monitoring tomorrow and cluster support by the end of the week. > > Capistrano on Win32?? > > If you set up a Cygwin environment to get SSH and the other tools > Capistrano expects (cp, ls, tar, gzip, sudo, etc.), then yes. I have > done this in development, but not production. > I don't have experience deploying with capistrano on windows. I use a different approach based on rails applications packaged as gems (I call this Fossilize). Radiant is the first public RoR that takes this approach, from the same codebase/checkout you could serve different "instances" of your application, each one with its own db settings, cache, or plugins. All rake tasks works under that design, so rake db:migrate will work without problems. Also mongrel recognizes it as a true rails application, no problems with your true "application code" came from a gem or a svn checkout. I hooked up a mongrel handler that allow me: 1) download the lastest available gem of my application 2) install it (gem install) 3) stop the application 4) update the instace to use the new version 5) run the database migrations 6) restart the application Hope could release the new Fossilize gem by the end of the year. > > Many thanks for your feedback! > > Just out of curiosity, is your Java web app broken? The Rubyists might > string me up for this, but if it ain't broke, don't fix it. Especially > if it is mission critical (i.e. the unavailability of your web app for > more than a minute or two will cost you pain, suffering, or your job). > > That said, at my former employer, I converted a (simple) Java web app > running on Windows to a Rails app on Linux, but I also had a week with > utterly nothing else to do, a clueless manager who didn't know a thing > about managing a programmer (much less managing a person), a supervisor > who encouraged me to learn new things, and no one screaming bloody > murder if the app was down for a while. > > == > Will > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From luislavena at gmail.com Sun Nov 26 22:39:26 2006 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 27 Nov 2006 00:39:26 -0300 Subject: [Mongrel] mongrel & apache on Win32 In-Reply-To: <4569CEE5.20707@bednarz.ch> References: <456949B2.8000406@bednarz.ch> <4569A52B.6070606@hotgazpacho.com> <4569CEE5.20707@bednarz.ch> Message-ID: <71166b3b0611261939m5f00fc5evd9f7f8715d118f91@mail.gmail.com> On 11/26/06, Tom Bednarz wrote: > Hi Will, > > Thanks a lot for your feedback! > > > > > Just out of curiosity, is your Java web app broken? The Rubyists might > > string me up for this, but if it ain't broke, don't fix it. Especially > > if it is mission critical (i.e. the unavailability of your web app for > > more than a minute or two will cost you pain, suffering, or your job). > > > > That said, at my former employer, I converted a (simple) Java web app > > running on Windows to a Rails app on Linux, but I also had a week with > > utterly nothing else to do, a clueless manager who didn't know a thing > > about managing a programmer (much less managing a person), a supervisor > > who encouraged me to learn new things, and no one screaming bloody > > murder if the app was down for a while. > > > > == > > Will > Regarding Java / Rails etc: > > It is a Web-Frontend for a self owned product. I like to extend the > application and I have the impression, that development with ruby and > the rails framework is a lot faster then with Java. > > Java is a good technology and it offers a lot of OpenSource support > (Apache group) and it is bullet proof in production. Java has many > different OpenSource MVC frameworks. Struts is probably the most known > because it was one of the first on the market. What I consider a problem > is that every Java Web App ends up in writing endless XML configuration > files that you cannot debug. Basically you can spend hours and days to > find a bug in your application which finally turns out to be a > misconfigured XML file! I really hate that meanwile!!! > Ohh, the magic of configuration files... that one of the reasons we dropped Zope. > So basically I am looking for an environment that speeds up development > time and thats currently the only reason, why I am looking at Ruby on > Rails. On the Java side there are also newer frameworks such as > JavaServer Faces. Groovy is a scripting language that borrowed a lot > from Ruby. > Borrow something to mimic other languages is bad: they try to do something that originally aren't designed for, and sometimes they implement these functionality badly (in a bad way?) What more I could say? Welcome aboard! :-) > Tom > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From list at bednarz.ch Mon Nov 27 05:39:54 2006 From: list at bednarz.ch (Tom Bednarz) Date: Mon, 27 Nov 2006 11:39:54 +0100 Subject: [Mongrel] mongrel & apache on Win32 In-Reply-To: <71166b3b0611261936j2c01532fmc6582154c05209ca@mail.gmail.com> References: <456949B2.8000406@bednarz.ch> <4569A52B.6070606@hotgazpacho.com> <71166b3b0611261936j2c01532fmc6582154c05209ca@mail.gmail.com> Message-ID: <456AC07A.1000402@bednarz.ch> Hi Luis, Thanks for that feedback. Sounds very intersting to me. I plan to go into production in January 2007. By that time I need a scalable environment for Windows. It would kill me, if I spend the time to migrate now and find out in January that there is no suitable production runtime environment on Windows! I am convinced, that during next year other improvements will take place. So for a start I need something stable that can serve a smaller group of users. Later I need support for a larger community, thats why scalabilty is important for me right now from the beginning. We start small but the environment should be able to grow. I must say that I depend on M$ only regarding the OS, the database is Sybase iAnywhere, web server is Apache etc. So if you could send me some instructions how to get mongrel and RoR going on W2K3 and Apache 2.2 If that helps you, I would test it in december and give you feedback. Luis Lavena wrote: > > Yep, will be adding process monitoring tomorrow and cluster support by > the end of the week. > >>> Capistrano on Win32?? >> If you set up a Cygwin environment to get SSH and the other tools >> Capistrano expects (cp, ls, tar, gzip, sudo, etc.), then yes. I have >> done this in development, but not production. >> > > I don't have experience deploying with capistrano on windows. > > I use a different approach based on rails applications packaged as > gems (I call this Fossilize). > > Radiant is the first public RoR that takes this approach, from the > same codebase/checkout you could serve different "instances" of your > application, each one with its own db settings, cache, or plugins. > URL ?? > Hope could release the new Fossilize gem by the end of the year. > That would be very interesting for me too. Drop me a line if I can test something for you! By the way: I read your interview with pat eyler on O'Reilly. We are based in Switzerland and I have to do everything in German language. Do you use Internationalization in RoR to support Spanish and English or do you offer Spanish only? Tom From luislavena at gmail.com Mon Nov 27 10:17:58 2006 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 27 Nov 2006 12:17:58 -0300 Subject: [Mongrel] mongrel & apache on Win32 In-Reply-To: <456AC07A.1000402@bednarz.ch> References: <456949B2.8000406@bednarz.ch> <4569A52B.6070606@hotgazpacho.com> <71166b3b0611261936j2c01532fmc6582154c05209ca@mail.gmail.com> <456AC07A.1000402@bednarz.ch> Message-ID: <71166b3b0611270717w796af305qfeebfe82e738344e@mail.gmail.com> On 11/27/06, Tom Bednarz wrote: > Hi Luis, > > Thanks for that feedback. Sounds very intersting to me. I plan to go > into production in January 2007. By that time I need a scalable > environment for Windows. It would kill me, if I spend the time to > migrate now and find out in January that there is no suitable production > runtime environment on Windows! > I am convinced, that during next year other improvements will take > place. So for a start I need something stable that can serve a smaller > group of users. Later I need support for a larger community, thats why > scalabilty is important for me right now from the beginning. We start > small but the environment should be able to grow. > I agree with you on this. From day one you must take in consideration scalability. > I must say that I depend on M$ only regarding the OS, the database is > Sybase iAnywhere, web server is Apache etc. Anyway, one of the things that the new implementation [1] is provide the more smooth and clean implementation for users that require some *nix features in windows environments (ones due requirements of their customers or prior license purchases, like my situation). > > So if you could send me some instructions how to get mongrel and RoR > going on W2K3 and Apache 2.2 If that helps you, I would test it in > december and give you feedback. > I don't use apache (if you read the interview in detail), mostly due we don't serve a huge amount of static content from our applications (and the 100% of them are intranets). What we developed at our company is a TCP balancer for windows/linux, but currently on hold for a open-source release (still lot to be done). Off-topic, we create "native" installer for windows and deploy everything (ror, ruby, mongrel) from the same setup, so administrators could reinstall everything if they require. > > Luis Lavena wrote: > > > > Yep, will be adding process monitoring tomorrow and cluster support by > > the end of the week. > > > >>> Capistrano on Win32?? > >> If you set up a Cygwin environment to get SSH and the other tools > >> Capistrano expects (cp, ls, tar, gzip, sudo, etc.), then yes. I have > >> done this in development, but not production. > >> > > > > I don't have experience deploying with capistrano on windows. > > > > I use a different approach based on rails applications packaged as > > gems (I call this Fossilize). > > > > Radiant is the first public RoR that takes this approach, from the > > same codebase/checkout you could serve different "instances" of your > > application, each one with its own db settings, cache, or plugins. > > > URL ?? > Radiant CMS: http://www.radiantcms.org > > Hope could release the new Fossilize gem by the end of the year. > > > > That would be very interesting for me too. Drop me a line if I can test > something for you! > It will be a open release with spam-like announcements here (mongrel-users) and other lists, so stay tune ;-) > By the way: I read your interview with pat eyler on O'Reilly. We are > based in Switzerland and I have to do everything in German language. Do > you use Internationalization in RoR to support Spanish and English or do > you offer Spanish only? > We took the complex but safer approach to this: instead of using globalize plugin [2]. we're using GetText [3] So far that manual approach give us good results. Basically we code the whole application in English, then generate the Spanish and Portuguese translations using the .po resources. Regards and good week! > Tom > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > [1] http://rubyforge.org/pipermail/mongrel-users/2006-November/002186.html [2] http://www.globalize-rails.org/globalize/ [3] http://manuals.rubyonrails.com/read/book/16 -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From list at bednarz.ch Mon Nov 27 11:53:38 2006 From: list at bednarz.ch (Tom Bednarz) Date: Mon, 27 Nov 2006 17:53:38 +0100 Subject: [Mongrel] mongrel & apache on Win32 In-Reply-To: <71166b3b0611270717w796af305qfeebfe82e738344e@mail.gmail.com> References: <456949B2.8000406@bednarz.ch> <4569A52B.6070606@hotgazpacho.com> <71166b3b0611261936j2c01532fmc6582154c05209ca@mail.gmail.com> <456AC07A.1000402@bednarz.ch> <71166b3b0611270717w796af305qfeebfe82e738344e@mail.gmail.com> Message-ID: <456B1812.6070804@bednarz.ch> Luis Lavena wrote: > > I don't use apache (if you read the interview in detail), mostly due > we don't serve a huge amount of static content from our applications > (and the 100% of them are intranets). > I need it for SSL only, apart from a couple of small icons and a css file we do not have static content. > Radiant CMS: http://www.radiantcms.org Ahh a CMS based on RoR, interesting! > > It will be a open release with spam-like announcements here > (mongrel-users) and other lists, so stay tune ;-) > OK hope it does not get deleted by my SPAM filter !!!! :-) > > We took the complex but safer approach to this: instead of using > globalize plugin [2]. we're using GetText [3] > Interesting remark too! Something I have to look at. > > Regards and good week! > Thank you, the same to you! Tom From jamie at dangosaur.us Mon Nov 27 13:02:18 2006 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Mon, 27 Nov 2006 13:02:18 -0500 Subject: [Mongrel] win32 problems Message-ID: I'm setting up a Rails app for a client that uses Windows. I'm getting this error: c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/lib/mongrel/rails.rb: 32: uninitial ized constant Mongrel::HttpHandler (NameError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:21:in `re quire' from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/bin/ mongrel_rails:10 from c:/ruby/bin/mongrel_rails:18 Setup: Windows Server 2003, Standard Rails 1.1.6 Mongrel 0.3.18 Mongrel Service 0.1 Daemons 1.0.3 Cgi Multipart OEF fix 1.0.0 Win32-Service 0.5.2 Any ideas. Jamie From gethemant at gmail.com Mon Nov 27 14:49:10 2006 From: gethemant at gmail.com (hemant) Date: Tue, 28 Nov 2006 01:19:10 +0530 Subject: [Mongrel] win32 problems In-Reply-To: References: Message-ID: On 11/27/06, Jamie Orchard-Hays wrote: > I'm setting up a Rails app for a client that uses Windows. I'm > getting this error: > > c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/lib/mongrel/rails.rb: > 32: uninitial > ized constant Mongrel::HttpHandler (NameError) > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/ > custom_require.rb:21:in `re > quire' > from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/bin/ > mongrel_rails:10 > from c:/ruby/bin/mongrel_rails:18 > > Setup: > > Windows Server 2003, Standard > Rails 1.1.6 > Mongrel 0.3.18 > Mongrel Service 0.1 > Daemons 1.0.3 > Cgi Multipart OEF fix 1.0.0 > Win32-Service 0.5.2 > > Any ideas. Yes..i hope you read about Lluis and Zed's effort to port mongrel-0.3.18 to Windows and make it smooth. People are able to compile it successfully but unless our benevolent dictator certifies it....you should wait. -- There was only one Road; that it was like a great river: its springs were at every doorstep, and every path was its tributary. From jamie at dangosaur.us Mon Nov 27 14:57:56 2006 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Mon, 27 Nov 2006 14:57:56 -0500 Subject: [Mongrel] win32 problems In-Reply-To: References: Message-ID: <5FAEA167-5AF9-4693-B3F9-CE9FA4F756B1@dangosaur.us> OK, is there another version recommended that works now? This is a very low traffic, internal app, so that's all I need it to work well with. On Nov 27, 2006, at 2:49 PM, hemant wrote: > On 11/27/06, Jamie Orchard-Hays wrote: >> I'm setting up a Rails app for a client that uses Windows. I'm >> getting this error: >> >> c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/lib/mongrel/rails.rb: >> 32: uninitial >> ized constant Mongrel::HttpHandler (NameError) >> from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/ >> custom_require.rb:21:in `re >> quire' >> from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/bin/ >> mongrel_rails:10 >> from c:/ruby/bin/mongrel_rails:18 >> >> Setup: >> >> Windows Server 2003, Standard >> Rails 1.1.6 >> Mongrel 0.3.18 >> Mongrel Service 0.1 >> Daemons 1.0.3 >> Cgi Multipart OEF fix 1.0.0 >> Win32-Service 0.5.2 >> >> Any ideas. > > > Yes..i hope you read about Lluis and Zed's effort to port > mongrel-0.3.18 to Windows and make it smooth. People are able to > compile it successfully but unless our benevolent dictator certifies > it....you should wait. > > > > -- > There was only one Road; that it was like a great river: its springs > were at every doorstep, and every path was its tributary. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From zedshaw at zedshaw.com Mon Nov 27 17:34:31 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 27 Nov 2006 17:34:31 -0500 Subject: [Mongrel] win32 problems In-Reply-To: References: Message-ID: <20061127173431.0a3029bd.zedshaw@zedshaw.com> On Mon, 27 Nov 2006 13:02:18 -0500 Jamie Orchard-Hays wrote: > I'm setting up a Rails app for a client that uses Windows. I'm > getting this error: Yep, just hold for a bit. I was travelling yesterday so now I've got to work with Luis for the win32 part of this release. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From luislavena at gmail.com Mon Nov 27 18:51:23 2006 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 27 Nov 2006 20:51:23 -0300 Subject: [Mongrel] win32 problems In-Reply-To: <5FAEA167-5AF9-4693-B3F9-CE9FA4F756B1@dangosaur.us> References: <5FAEA167-5AF9-4693-B3F9-CE9FA4F756B1@dangosaur.us> Message-ID: <71166b3b0611271551l5e61d57evc03f5921ef01642a@mail.gmail.com> On 11/27/06, Jamie Orchard-Hays wrote: > OK, is there another version recommended that works now? This is a > very low traffic, internal app, so that's all I need it to work well > with. > Jamie, you're trying to run the (ruby) gem, which require a compiler to build the native extensions. For win32 there is a pre-compiled version that skip the compilation step, but is not officially released. I could put them (mongrel, fastthread and mongrel_service) in my web server and offer as download, but they first must pass a series of tests, something to avoid you "suing us" due problems on your "internal, very low traffic" application. Still, try downloading a (mswin32) gem from rubyforge, last stable release was 0.3.13.3 Simply put in a terminal/console window: gem install mongrel -v 0.3.13.3 and select option 2 (mswin32) to install the precompiled one. I could say we are close to the release, but still a things must be done first. > > On Nov 27, 2006, at 2:49 PM, hemant wrote: > > > On 11/27/06, Jamie Orchard-Hays wrote: > >> I'm setting up a Rails app for a client that uses Windows. I'm > >> getting this error: > >> > >> c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/lib/mongrel/rails.rb: > >> 32: uninitial > >> ized constant Mongrel::HttpHandler (NameError) > >> from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/ > >> custom_require.rb:21:in `re > >> quire' > >> from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.18/bin/ > >> mongrel_rails:10 > >> from c:/ruby/bin/mongrel_rails:18 > >> > >> Setup: > >> > >> Windows Server 2003, Standard > >> Rails 1.1.6 > >> Mongrel 0.3.18 > >> Mongrel Service 0.1 > >> Daemons 1.0.3 > >> Cgi Multipart OEF fix 1.0.0 > >> Win32-Service 0.5.2 > >> > >> Any ideas. > > > > > > Yes..i hope you read about Lluis and Zed's effort to port > > mongrel-0.3.18 to Windows and make it smooth. People are able to > > compile it successfully but unless our benevolent dictator certifies > > it....you should wait. > > > > > > > > -- > > There was only one Road; that it was like a great river: its springs > > were at every doorstep, and every path was its tributary. > > _______________________________________________ > > 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 > -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From luislavena at gmail.com Tue Nov 28 07:48:09 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 28 Nov 2006 09:48:09 -0300 Subject: [Mongrel] Mongrel, Mutex and FastThread results for win32. Message-ID: <71166b3b0611280448r68c22fe7j31ac3993d29cbfd1@mail.gmail.com> Hello Guys, Been testing fastthread (known on previous releases as optimized_locking) for soon to be released 0.3.18 mswin32 gems (official ones). Attached to this message is the ruby script I used for the test results shown on graphics [1] and [2] The idea of the script is simulate what Mongrel do with threads creating a simple workload for testing Ruby VM stability. [1] refers to normal, unmodified ruby Mutex functionality under Windows. [2] is fastthread overlay modification (which must be loaded prior ruby thread functions). What you can see from both graphs, is the similarities of both results, but unmodified Mutex slightly increments its memory "peak" values. Could anyone on the list confirm these stability enhancement on other platforms? AFAIK, the huge memory leakage only affects *nix versions of ruby, I couldn't reproduce the problem shown by Zed on the list [3], and my results, back in august [4] [1] http://mmediasys.com/mongrel/mutex-rb.png [2] http://mmediasys.com/mongrel/mutex-fastthread.png [3] http://rubyforge.org/pipermail/mongrel-users/2006-August/001239.html [4] http://rubyforge.org/pipermail/mongrel-users/2006-August/001253.html -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi -------------- next part -------------- A non-text attachment was scrubbed... Name: mutex_test.rb Type: application/octet-stream Size: 932 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/181e86d2/attachment.obj From jamie at dangosaur.us Tue Nov 28 09:43:37 2006 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Tue, 28 Nov 2006 09:43:37 -0500 Subject: [Mongrel] win32 problems In-Reply-To: <71166b3b0611271551l5e61d57evc03f5921ef01642a@mail.gmail.com> References: <5FAEA167-5AF9-4693-B3F9-CE9FA4F756B1@dangosaur.us> <71166b3b0611271551l5e61d57evc03f5921ef01642a@mail.gmail.com> Message-ID: <27BBA396-4EEE-43E1-A7FD-12768BC053D1@dangosaur.us> Thanks Luis. Perhaps it wasn't building. I had put nmake on the system, but I don't know if it had the needed compilers. I had actually tried the 0.13.3.3 release and had a different error. I'm not at the client site today, so I can't report what that was with 0.13.3.3. I'll just wait until the new version is ready. I'm running webrick as a service until then. Thanks, Jamie On Nov 27, 2006, at 6:51 PM, Luis Lavena wrote: > Jamie, you're trying to run the (ruby) gem, which require a compiler > to build the native extensions. For win32 there is a pre-compiled > version that skip the compilation step, but is not officially > released. > > I could put them (mongrel, fastthread and mongrel_service) in my web > server and offer as download, but they first must pass a series of > tests, something to avoid you "suing us" due problems on your > "internal, very low traffic" application. > > Still, try downloading a (mswin32) gem from rubyforge, last stable > release was 0.3.13.3 > > Simply put in a terminal/console window: > > gem install mongrel -v 0.3.13.3 > > and select option 2 (mswin32) to install the precompiled one. > > I could say we are close to the release, but still a things must be > done first. From joeat303 at yahoo.com Tue Nov 28 11:27:38 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Tue, 28 Nov 2006 08:27:38 -0800 (PST) Subject: [Mongrel] Determining ideal number of Mongrels for an app? Message-ID: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> What's a rule of thumb for guesstimating how many Mongrels to use in a cluster for an app? I have an app that gets about 5000 unique visitors per day. I figured I'd give it plenty of Mongrels -- twenty to be specific. After running out of memory and hitting the swap periodically, I scaled it back to five and it still seems to serve up visitors fine. So, is there some super-secret math fomula I can use to determine the ideal number of Mongrels I should start in a cluster for an app? Joe ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com From luislavena at gmail.com Tue Nov 28 11:54:15 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 28 Nov 2006 13:54:15 -0300 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> Message-ID: <71166b3b0611280854u1a9abab9gc5d67032c3f343eb@mail.gmail.com> On 11/28/06, Joe Ruby wrote: > What's a rule of thumb for guesstimating how many > Mongrels to use in a cluster for an app? I have an app > that gets about 5000 unique visitors per day. I > figured I'd give it plenty of Mongrels -- twenty to be > specific. After running out of memory and hitting the > swap periodically, I scaled it back to five and it > still seems to serve up visitors fine. So, is there > some super-secret math fomula I can use to determine > the ideal number of Mongrels I should start in a > cluster for an app? > More information in the docs: http://mongrel.rubyforge.org/docs/how_many_mongrels.html Also check about deployment: http://mongrel.rubyforge.org/docs/choosing_deployment.html > Joe > Hope That Helps, -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From al-mongrelusers at none.at Tue Nov 28 12:05:56 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Tue, 28 Nov 2006 18:05:56 +0100 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> Message-ID: <20061128170556.GA4124@none.at> Hi, On Die 28.11.2006 08:27, Joe Ruby wrote: > >What's a rule of thumb for guesstimating how many Mongrels to use in a >cluster for an app? I have an app that gets about 5000 unique visitors >per day. I figured I'd give it plenty of Mongrels -- twenty to be >specific. After running out of memory and hitting the swap >periodically, I scaled it back to five and it still seems to serve up >visitors fine. So, is there some super-secret math fomula I can use to >determine the ideal number of Mongrels I should start in a cluster for >an app? Super-Secret, I think maybe but a possible start for a *normal* formula could be: http://mongrel.rubyforge.org/docs/how_many_mongrels.html Hth Regards Aleks From wilsonb at gmail.com Tue Nov 28 12:24:08 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Tue, 28 Nov 2006 12:24:08 -0500 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> Message-ID: On 11/28/06, Joe Ruby wrote: > What's a rule of thumb for guesstimating how many > Mongrels to use in a cluster for an app? I have an app > that gets about 5000 unique visitors per day. I > figured I'd give it plenty of Mongrels -- twenty to be > specific. After running out of memory and hitting the > swap periodically, I scaled it back to five and it > still seems to serve up visitors fine. So, is there > some super-secret math fomula I can use to determine > the ideal number of Mongrels I should start in a > cluster for an app? See this: http://mongrel.rubyforge.org/docs/how_many_mongrels.html From gbattig at optaros.com Tue Nov 28 12:02:25 2006 From: gbattig at optaros.com (Gregor Battig) Date: Tue, 28 Nov 2006 12:02:25 -0500 (EST) Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> Message-ID: <29469276.32271164733345336.JavaMail.root@enzo.optaros.com> Hey Joe, here's the link I have bookmarked for this: http://rubyforge.org/pipermail/mongrel-users/2006-May/000200.html As far as I know, that's still the way to go. Cheers, greg ----- Joe Ruby wrote: > What's a rule of thumb for guesstimating how many > Mongrels to use in a cluster for an app? I have an app > that gets about 5000 unique visitors per day. I > figured I'd give it plenty of Mongrels -- twenty to be > specific. After running out of memory and hitting the > swap periodically, I scaled it back to five and it > still seems to serve up visitors fine. So, is there > some super-secret math fomula I can use to determine > the ideal number of Mongrels I should start in a > cluster for an app? > > Joe > > > > ____________________________________________________________________________________ > Do you Yahoo!? > Everyone is raving about the all-new Yahoo! Mail beta. > http://new.mail.yahoo.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From rogelio.samour at gmail.com Tue Nov 28 12:40:20 2006 From: rogelio.samour at gmail.com (Rogelio J. Samour) Date: Tue, 28 Nov 2006 11:40:20 -0600 Subject: [Mongrel] Uploading Large (100mb+) files Message-ID: <1164735620.30693.8.camel@localhost.localdomain> I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does not have mongrel installed. It does proxy requests to several other mongrel-only servers (each running 2 mongrel processes). Each mongrel node has the same rails code-base and it's working perfectly. However, my question is when I add an upload file form... where is it going to physically put that file? I mean since it's hitting either one node or the other, so how does mongrel deal with that? and how or where do I tell it to accept large files (100mb+) ? I have read on having an upload-only mongrel process, but again how will all the other mongrels know to post the file to it or to a specific folder somewhere? Direction on this would be greatly appreciated! Thanks for your help on this. I searched the forum and didn't find anything specifically dealing with this. I have also checked the mongrel docs and most of the setups talk about mongrel_upload_progress plugin and/or the mongrel_cluster setup...(I may have missed something :-/) cheers, -rjs- p.s. mongrel ROCKS! From mongrel at philip.pjkh.com Tue Nov 28 12:03:06 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 11:03:06 -0600 (CST) Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> Message-ID: <20061128110142.T82510@bravo.pjkh.com> > What's a rule of thumb for guesstimating how many > Mongrels to use in a cluster for an app? I have an app > that gets about 5000 unique visitors per day. I > figured I'd give it plenty of Mongrels -- twenty to be > specific. After running out of memory and hitting the > swap periodically, I scaled it back to five and it > still seems to serve up visitors fine. So, is there > some super-secret math fomula I can use to determine > the ideal number of Mongrels I should start in a > cluster for an app? http://mongrel.rubyforge.org/docs/how_many_mongrels.html Just for reference, we get about 500,000 pages a day and run 4 mongrel processes... we've got about 20 servers[1], but 4 gives us the best performance. [1] We don't need 20 except for about one month a year when we do about 8 million pages a day... then they come in handy, but even then they don't sweat that much. -philip From g.vishnu at gmail.com Tue Nov 28 14:03:10 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Wed, 29 Nov 2006 00:33:10 +0530 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <1164735620.30693.8.camel@localhost.localdomain> References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: If you're using Rails with Mongrel, file upload currently sucks. If you have two mongrels running (say) and two users upload two large files, your entire app will be hung just serving those requests. This is because Rails can't run safely multi-threaded, and it's not Mongrel's fault. An upload only Mongrel could (and should) be written in a framework other than Rails. Both Camping and Merb are good choices. In this instance you don't need many mongrels since even 1 can simultaneously serve many file uploads. So you'll ideally have 1 server where you have one or more mongrels running your file upload app, and use that to accept uploads. This is what we do at SlideShare: we have a custom Camping app to accept file uploads. Your frontend webserver or load balancer would redirect all requests to /upload (say) to your uploader mongrel running at it's own port. And all other requests can be served some other way. We do this through lighttpd proxying. HTH Vish On 11/28/06, Rogelio J. Samour wrote: > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > not have mongrel installed. It does proxy requests to several other > mongrel-only servers (each running 2 mongrel processes). Each mongrel > node has the same rails code-base and it's working perfectly. > > However, my question is when I add an upload file form... where is it > going to physically put that file? I mean since it's hitting either one > node or the other, so how does mongrel deal with that? and how or where > do I tell it to accept large files (100mb+) ? > > I have read on having an upload-only mongrel process, but again how will > all the other mongrels know to post the file to it or to a specific > folder somewhere? Direction on this would be greatly appreciated! > > Thanks for your help on this. I searched the forum and didn't find > anything specifically dealing with this. I have also checked the mongrel > docs and most of the setups talk about mongrel_upload_progress plugin > and/or the mongrel_cluster setup...(I may have missed something :-/) > > > cheers, > > -rjs- > > p.s. mongrel ROCKS! > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/1fc96cbb/attachment.html From cremes.devlist at mac.com Tue Nov 28 14:05:12 2006 From: cremes.devlist at mac.com (cremes.devlist at mac.com) Date: Tue, 28 Nov 2006 13:05:12 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <1164735620.30693.8.camel@localhost.localdomain> References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: On Nov 28, 2006, at 11:40 AM, Rogelio J. Samour wrote: > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > not have mongrel installed. It does proxy requests to several other > mongrel-only servers (each running 2 mongrel processes). Each mongrel > node has the same rails code-base and it's working perfectly. > > However, my question is when I add an upload file form... where is it > going to physically put that file? I mean since it's hitting either > one > node or the other, so how does mongrel deal with that? and how or > where > do I tell it to accept large files (100mb+) ? > > I have read on having an upload-only mongrel process, but again how > will > all the other mongrels know to post the file to it or to a specific > folder somewhere? Direction on this would be greatly appreciated! > > Thanks for your help on this. I searched the forum and didn't find > anything specifically dealing with this. I have also checked the > mongrel > docs and most of the setups talk about mongrel_upload_progress plugin > and/or the mongrel_cluster setup...(I may have missed something :-/) I'm starting work on a way for Mongrel to better handle really large file uploads (20+ MB). In the meantime, it's still pretty easy to setup a dedicated mongrel instance for file uploads. Assuming you are using mod_proxy_balancer, you first need to setup an exception for it. For example, the balancer setup lines look like this: ProxyPass / balancer://mongrel_cluster/ ProxyPassReverse / balancer://mongrel_cluster Put an exception line before the first call to ProxyPass like so: ProxyPass /uploads ! # proxy will not rewrite if it contains this URI Then, further down in your Apache configuration file, put in a rewrite rule to send the connection to the mongrel dedicated to uploads: RewriteEngine On RewriteCond %{REQUEST_URI} ^/uploads.* RewriteRule .* http://example.com:some_port% {REQUEST_URI} [P,QSA,L] (That RewriteRule is untested but should work.) There are probably other ways to skin this particular cat. cr From rogelio.samour at gmail.com Tue Nov 28 14:26:21 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Tue, 28 Nov 2006 13:26:21 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: I would like to combine what you guys are suggesting. Namely, have a merb app (mongrel) dealio... be the sole file uploader listener. I understand the ReWrite rules and ProxyPass magic. However, this poses a new question: how would I go about downloading these uploaded files? I'm assuming I would want this mongrel node to also be a file server, correct? My only experience with setting up mongrel is through mongrel_rails. cremes: are you saying this upload-only mongrel is it's own setup? if so, is there docs on setting up something like this? Thanks a lot for your time amigos! -rjs- On 11/28/06, cremes.devlist at mac.com wrote: > > > On Nov 28, 2006, at 11:40 AM, Rogelio J. Samour wrote: > > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > > not have mongrel installed. It does proxy requests to several other > > mongrel-only servers (each running 2 mongrel processes). Each mongrel > > node has the same rails code-base and it's working perfectly. > > > > However, my question is when I add an upload file form... where is it > > going to physically put that file? I mean since it's hitting either > > one > > node or the other, so how does mongrel deal with that? and how or > > where > > do I tell it to accept large files (100mb+) ? > > > > I have read on having an upload-only mongrel process, but again how > > will > > all the other mongrels know to post the file to it or to a specific > > folder somewhere? Direction on this would be greatly appreciated! > > > > Thanks for your help on this. I searched the forum and didn't find > > anything specifically dealing with this. I have also checked the > > mongrel > > docs and most of the setups talk about mongrel_upload_progress plugin > > and/or the mongrel_cluster setup...(I may have missed something :-/) > > I'm starting work on a way for Mongrel to better handle really large > file uploads (20+ MB). > > In the meantime, it's still pretty easy to setup a dedicated mongrel > instance for file uploads. > > Assuming you are using mod_proxy_balancer, you first need to setup an > exception for it. > > For example, the balancer setup lines look like this: > > ProxyPass / balancer://mongrel_cluster/ > ProxyPassReverse / balancer://mongrel_cluster > > Put an exception line before the first call to ProxyPass like so: > > ProxyPass /uploads ! # proxy will not rewrite if it contains this URI > > Then, further down in your Apache configuration file, put in a > rewrite rule to send the connection to the mongrel dedicated to uploads: > > RewriteEngine On > > RewriteCond %{REQUEST_URI} ^/uploads.* > RewriteRule .* http://example.com:some_port% > {REQUEST_URI} [P,QSA,L] > > (That RewriteRule is untested but should work.) There are probably > other ways to skin this particular cat. > > cr > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/fde9625f/attachment.html From mongrel at philip.pjkh.com Tue Nov 28 14:35:32 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 13:35:32 -0600 (CST) Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <1164735620.30693.8.camel@localhost.localdomain> References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: <20061128133437.T82510@bravo.pjkh.com> > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > not have mongrel installed. It does proxy requests to several other > mongrel-only servers (each running 2 mongrel processes). Each mongrel > node has the same rails code-base and it's working perfectly. > > However, my question is when I add an upload file form... where is it > going to physically put that file? I mean since it's hitting either one > node or the other, so how does mongrel deal with that? and how or where > do I tell it to accept large files (100mb+) ? Others have given good advice on how to do it, but wanted to say you don't need to do anything to get it to accept 100mb files. We do that quite a bit and while it takes awhile works just fine. It does tie up a mongrel process, but we're okay with that. > > I have read on having an upload-only mongrel process, but again how will > all the other mongrels know to post the file to it or to a specific > folder somewhere? Direction on this would be greatly appreciated! > > Thanks for your help on this. I searched the forum and didn't find > anything specifically dealing with this. I have also checked the mongrel > docs and most of the setups talk about mongrel_upload_progress plugin > and/or the mongrel_cluster setup...(I may have missed something :-/) > > > cheers, > > -rjs- > > p.s. mongrel ROCKS! > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From stockliasteroid at gmail.com Tue Nov 28 14:30:34 2006 From: stockliasteroid at gmail.com (Matt White) Date: Wed, 29 Nov 2006 08:30:34 +1300 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> If you use something like mongrel_upload_progress, the single-threadedness of Rails is no problem because Mongrel will intercept the upload and not hand it off to Rails until it's complete. That's what I'm doing at the moment, and my app runs just fine on one Mongrel. If you're running large file uploads, I would recommend looking into it anyway, because your users will surely want some kind of update about how their upload is going. Matt On 11/29/06, Vishnu Gopal wrote: > > If you're using Rails with Mongrel, file upload currently sucks. If you > have two mongrels running (say) and two users upload two large files, your > entire app will be hung just serving those requests. This is because Rails > can't run safely multi-threaded, and it's not Mongrel's fault. > > An upload only Mongrel could (and should) be written in a framework other > than Rails. Both Camping and Merb are good choices. In this instance you > don't need many mongrels since even 1 can simultaneously serve many file > uploads. So you'll ideally have 1 server where you have one or more mongrels > running your file upload app, and use that to accept uploads. This is what > we do at SlideShare: we have a custom Camping app to accept file uploads. > > Your frontend webserver or load balancer would redirect all requests to > /upload (say) to your uploader mongrel running at it's own port. And all > other requests can be served some other way. We do this through lighttpd > proxying. > > HTH > Vish > > On 11/28/06, Rogelio J. Samour wrote: > > > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > > not have mongrel installed. It does proxy requests to several other > > mongrel-only servers (each running 2 mongrel processes). Each mongrel > > node has the same rails code-base and it's working perfectly. > > > > However, my question is when I add an upload file form... where is it > > going to physically put that file? I mean since it's hitting either one > > node or the other, so how does mongrel deal with that? and how or where > > do I tell it to accept large files (100mb+) ? > > > > I have read on having an upload-only mongrel process, but again how will > > all the other mongrels know to post the file to it or to a specific > > folder somewhere? Direction on this would be greatly appreciated! > > > > Thanks for your help on this. I searched the forum and didn't find > > anything specifically dealing with this. I have also checked the mongrel > > docs and most of the setups talk about mongrel_upload_progress plugin > > and/or the mongrel_cluster setup...(I may have missed something :-/) > > > > > > cheers, > > > > -rjs- > > > > p.s. mongrel ROCKS! > > > > _______________________________________________ > > 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 > > -- Matt White ----------------------- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/13b552dc/attachment-0001.html From me at seebq.com Tue Nov 28 14:31:44 2006 From: me at seebq.com (Charles Brian Quinn) Date: Tue, 28 Nov 2006 14:31:44 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: <3a2de0cd0611281131t5719ed0ak6446351c37b4e22d@mail.gmail.com> Great work guys, I'm testing this with a client and we'll be updating the apache docs and linking over to the mongrel upload pages from there. On 11/28/06, cremes.devlist at mac.com wrote: > > On Nov 28, 2006, at 11:40 AM, Rogelio J. Samour wrote: > > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > > not have mongrel installed. It does proxy requests to several other > > mongrel-only servers (each running 2 mongrel processes). Each mongrel > > node has the same rails code-base and it's working perfectly. > > > > However, my question is when I add an upload file form... where is it > > going to physically put that file? I mean since it's hitting either > > one > > node or the other, so how does mongrel deal with that? and how or > > where > > do I tell it to accept large files (100mb+) ? > > > > I have read on having an upload-only mongrel process, but again how > > will > > all the other mongrels know to post the file to it or to a specific > > folder somewhere? Direction on this would be greatly appreciated! > > > > Thanks for your help on this. I searched the forum and didn't find > > anything specifically dealing with this. I have also checked the > > mongrel > > docs and most of the setups talk about mongrel_upload_progress plugin > > and/or the mongrel_cluster setup...(I may have missed something :-/) > > I'm starting work on a way for Mongrel to better handle really large > file uploads (20+ MB). > > In the meantime, it's still pretty easy to setup a dedicated mongrel > instance for file uploads. > > Assuming you are using mod_proxy_balancer, you first need to setup an > exception for it. > > For example, the balancer setup lines look like this: > > ProxyPass / balancer://mongrel_cluster/ > ProxyPassReverse / balancer://mongrel_cluster > > Put an exception line before the first call to ProxyPass like so: > > ProxyPass /uploads ! # proxy will not rewrite if it contains this URI > > Then, further down in your Apache configuration file, put in a > rewrite rule to send the connection to the mongrel dedicated to uploads: > > RewriteEngine On > > RewriteCond %{REQUEST_URI} ^/uploads.* > RewriteRule .* http://example.com:some_port% > {REQUEST_URI} [P,QSA,L] > > (That RewriteRule is untested but should work.) There are probably > other ways to skin this particular cat. > > cr > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com From rogelio.samour at gmail.com Tue Nov 28 14:37:15 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Tue, 28 Nov 2006 13:37:15 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128133437.T82510@bravo.pjkh.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> Message-ID: Philip: at this point I want to upload something... anything. I'm following the example on the mongrel_upload_plugin and though it says finished I don't see the file anywhere. I Turned on --debug and I can only see that it's at least getting the headers (content-type, etc) on the uploaded file... but nothing on the whereabouts. Like I mentioned before, I'm very green when it comes to mongrel... however I'm decently versed in sysadmin *nix stuff... apache and friends. I'm just needing a nudge in the right direction. :-) cheers, -rjs- On 11/28/06, Philip Hallstrom wrote: > > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > > not have mongrel installed. It does proxy requests to several other > > mongrel-only servers (each running 2 mongrel processes). Each mongrel > > node has the same rails code-base and it's working perfectly. > > > > However, my question is when I add an upload file form... where is it > > going to physically put that file? I mean since it's hitting either one > > node or the other, so how does mongrel deal with that? and how or where > > do I tell it to accept large files (100mb+) ? > > Others have given good advice on how to do it, but wanted to say you don't > need to do anything to get it to accept 100mb files. We do that quite a > bit and while it takes awhile works just fine. It does tie up a mongrel > process, but we're okay with that. > > > > > I have read on having an upload-only mongrel process, but again how will > > all the other mongrels know to post the file to it or to a specific > > folder somewhere? Direction on this would be greatly appreciated! > > > > Thanks for your help on this. I searched the forum and didn't find > > anything specifically dealing with this. I have also checked the mongrel > > docs and most of the setups talk about mongrel_upload_progress plugin > > and/or the mongrel_cluster setup...(I may have missed something :-/) > > > > > > cheers, > > > > -rjs- > > > > p.s. mongrel ROCKS! > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/3538951a/attachment.html From rogelio.samour at gmail.com Tue Nov 28 14:47:28 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Tue, 28 Nov 2006 13:47:28 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> Message-ID: Matt: I definitely want to use the mongrel_upload_progress* (I realize I call it something different earlier :-p) Can you post your setup and how you have this running with one mongrel? Are you using DRb? (I am and I just ran ruby lib/upload.rb and it printed the following: 1164740868: Added 1164740868: Finished 1164740868: Added 1164740868: Marking 1164740868: Checking ... Last 2 lines Many times 1164740868: Finished But again. I have no idea where the file went. :-/ -rjs- On 11/28/06, Matt White wrote: > > If you use something like mongrel_upload_progress, the single-threadedness > of Rails is no problem because Mongrel will intercept the upload and not > hand it off to Rails until it's complete. That's what I'm doing at the > moment, and my app runs just fine on one Mongrel. > > If you're running large file uploads, I would recommend looking into it > anyway, because your users will surely want some kind of update about how > their upload is going. > > Matt > > On 11/29/06, Vishnu Gopal wrote: > > > > If you're using Rails with Mongrel, file upload currently sucks. If you > > have two mongrels running (say) and two users upload two large files, your > > entire app will be hung just serving those requests. This is because Rails > > can't run safely multi-threaded, and it's not Mongrel's fault. > > > > An upload only Mongrel could (and should) be written in a framework > > other than Rails. Both Camping and Merb are good choices. In this instance > > you don't need many mongrels since even 1 can simultaneously serve many file > > uploads. So you'll ideally have 1 server where you have one or more mongrels > > running your file upload app, and use that to accept uploads. This is what > > we do at SlideShare: we have a custom Camping app to accept file uploads. > > > > Your frontend webserver or load balancer would redirect all requests to > > /upload (say) to your uploader mongrel running at it's own port. And all > > other requests can be served some other way. We do this through lighttpd > > proxying. > > > > HTH > > Vish > > > > On 11/28/06, Rogelio J. Samour < rogelio.samour at gmail.com> wrote: > > > > > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > > > not have mongrel installed. It does proxy requests to several other > > > mongrel-only servers (each running 2 mongrel processes). Each mongrel > > > node has the same rails code-base and it's working perfectly. > > > > > > However, my question is when I add an upload file form... where is it > > > going to physically put that file? I mean since it's hitting either > > > one > > > node or the other, so how does mongrel deal with that? and how or > > > where > > > do I tell it to accept large files (100mb+) ? > > > > > > I have read on having an upload-only mongrel process, but again how > > > will > > > all the other mongrels know to post the file to it or to a specific > > > folder somewhere? Direction on this would be greatly appreciated! > > > > > > Thanks for your help on this. I searched the forum and didn't find > > > anything specifically dealing with this. I have also checked the > > > mongrel > > > docs and most of the setups talk about mongrel_upload_progress plugin > > > and/or the mongrel_cluster setup...(I may have missed something :-/) > > > > > > > > > cheers, > > > > > > -rjs- > > > > > > p.s. mongrel ROCKS! > > > > > > _______________________________________________ > > > 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 > > > > > > > -- > Matt White > ----------------------- > Thermal Creative > http://blog.thermalcreative.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: http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/12cc91e5/attachment.html From stockliasteroid at gmail.com Tue Nov 28 14:50:03 2006 From: stockliasteroid at gmail.com (Matt White) Date: Wed, 29 Nov 2006 08:50:03 +1300 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> Message-ID: <85f2e53f0611281150x79f72c7dy8b701e0f1302720d@mail.gmail.com> Rogelio, It will arrive in Rails just like any other uploaded file... It will show up in params[:model][:file_field], or whatever you've named your input file field. Until you do something else with it, it only lives as a file in /tmp/. You need to move it somewhere else, though, because Rails will do away with it once the request is complete :) Something like: @file = params[:model][:file_field] File.open("/path/to/#{@file.original_filename}", "wb") { |file| file.write(@ file.read) } Would copy the file from it's temp location to /path/to/original_filename on your box. As you were wondering, it will end up on whatever machine is hosting the mongrel that the client was connected to. So, you may need to scp it to an assets server or something when it's done... That's as far as I can go without knowing more about your setup ;) Hope this helps! Matt On 11/29/06, Rogelio Samour wrote: > > Philip: at this point I want to upload something... anything. I'm > following the example on the mongrel_upload_plugin and though it says > finished I don't see the file anywhere. I Turned on --debug and I can only > see that it's at least getting the headers (content-type, etc) on the > uploaded file... but nothing on the whereabouts. > > Like I mentioned before, I'm very green when it comes to mongrel... > however I'm decently versed in sysadmin *nix stuff... apache and friends. > I'm just needing a nudge in the right direction. :-) > > cheers, > > -rjs- > > On 11/28/06, Philip Hallstrom wrote: > > > > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > > > not have mongrel installed. It does proxy requests to several other > > > mongrel-only servers (each running 2 mongrel processes). Each mongrel > > > node has the same rails code-base and it's working perfectly. > > > > > > However, my question is when I add an upload file form... where is it > > > going to physically put that file? I mean since it's hitting either > > one > > > node or the other, so how does mongrel deal with that? and how or > > where > > > do I tell it to accept large files (100mb+) ? > > > > Others have given good advice on how to do it, but wanted to say you > > don't > > need to do anything to get it to accept 100mb files. We do that quite a > > > > bit and while it takes awhile works just fine. It does tie up a mongrel > > process, but we're okay with that. > > > > > > > > I have read on having an upload-only mongrel process, but again how > > will > > > all the other mongrels know to post the file to it or to a specific > > > folder somewhere? Direction on this would be greatly appreciated! > > > > > > Thanks for your help on this. I searched the forum and didn't find > > > anything specifically dealing with this. I have also checked the > > mongrel > > > docs and most of the setups talk about mongrel_upload_progress plugin > > > and/or the mongrel_cluster setup...(I may have missed something :-/) > > > > > > > > > cheers, > > > > > > -rjs- > > > > > > p.s. mongrel ROCKS! > > > > > > _______________________________________________ > > > 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 > > -- Matt White ----------------------- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/02b23577/attachment-0001.html From mongrel at philip.pjkh.com Tue Nov 28 15:14:52 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 14:14:52 -0600 (CST) Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> Message-ID: <20061128141426.G82510@bravo.pjkh.com> I don't know anything about the mongrel_upload_plugin... sorry... We do our uploads through standard rails... see their wiki or info... On Tue, 28 Nov 2006, Rogelio Samour wrote: > Philip: at this point I want to upload something... anything. I'm following > the example on the mongrel_upload_plugin and though it says finished I don't > see the file anywhere. I Turned on --debug and I can only see that it's at > least getting the headers (content-type, etc) on the uploaded file... but > nothing on the whereabouts. > > Like I mentioned before, I'm very green when it comes to mongrel... however > I'm decently versed in sysadmin *nix stuff... apache and friends. I'm just > needing a nudge in the right direction. :-) > > cheers, > > -rjs- > > On 11/28/06, Philip Hallstrom wrote: >> >> > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does >> > not have mongrel installed. It does proxy requests to several other >> > mongrel-only servers (each running 2 mongrel processes). Each mongrel >> > node has the same rails code-base and it's working perfectly. >> > >> > However, my question is when I add an upload file form... where is it >> > going to physically put that file? I mean since it's hitting either one >> > node or the other, so how does mongrel deal with that? and how or where >> > do I tell it to accept large files (100mb+) ? >> >> Others have given good advice on how to do it, but wanted to say you don't >> need to do anything to get it to accept 100mb files. We do that quite a >> bit and while it takes awhile works just fine. It does tie up a mongrel >> process, but we're okay with that. >> >> > >> > I have read on having an upload-only mongrel process, but again how will >> > all the other mongrels know to post the file to it or to a specific >> > folder somewhere? Direction on this would be greatly appreciated! >> > >> > Thanks for your help on this. I searched the forum and didn't find >> > anything specifically dealing with this. I have also checked the mongrel >> > docs and most of the setups talk about mongrel_upload_progress plugin >> > and/or the mongrel_cluster setup...(I may have missed something :-/) >> > >> > >> > cheers, >> > >> > -rjs- >> > >> > p.s. mongrel ROCKS! >> > >> > _______________________________________________ >> > 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 mongrel at philip.pjkh.com Tue Nov 28 15:20:00 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 14:20:00 -0600 (CST) Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> Message-ID: <20061128141849.S82510@bravo.pjkh.com> > If you use something like mongrel_upload_progress, the single-threadedness > of Rails is no problem because Mongrel will intercept the upload and not > hand it off to Rails until it's complete. That's what I'm doing at the > moment, and my app runs just fine on one Mongrel. I haven't used this plugin, but just gave it a quick read through... one thing I didn't see mentioned... can I skip the upload progress stuff and just get the benefits of it not blocking mongrel/rails? > > If you're running large file uploads, I would recommend looking into it > anyway, because your users will surely want some kind of update about how > their upload is going. > > Matt > > On 11/29/06, Vishnu Gopal wrote: >> >> If you're using Rails with Mongrel, file upload currently sucks. If you >> have two mongrels running (say) and two users upload two large files, your >> entire app will be hung just serving those requests. This is because Rails >> can't run safely multi-threaded, and it's not Mongrel's fault. >> >> An upload only Mongrel could (and should) be written in a framework other >> than Rails. Both Camping and Merb are good choices. In this instance you >> don't need many mongrels since even 1 can simultaneously serve many file >> uploads. So you'll ideally have 1 server where you have one or more >> mongrels >> running your file upload app, and use that to accept uploads. This is what >> we do at SlideShare: we have a custom Camping app to accept file uploads. >> >> Your frontend webserver or load balancer would redirect all requests to >> /upload (say) to your uploader mongrel running at it's own port. And all >> other requests can be served some other way. We do this through lighttpd >> proxying. >> >> HTH >> Vish >> >> On 11/28/06, Rogelio J. Samour wrote: >> > >> > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does >> > not have mongrel installed. It does proxy requests to several other >> > mongrel-only servers (each running 2 mongrel processes). Each mongrel >> > node has the same rails code-base and it's working perfectly. >> > >> > However, my question is when I add an upload file form... where is it >> > going to physically put that file? I mean since it's hitting either one >> > node or the other, so how does mongrel deal with that? and how or where >> > do I tell it to accept large files (100mb+) ? >> > >> > I have read on having an upload-only mongrel process, but again how will >> > all the other mongrels know to post the file to it or to a specific >> > folder somewhere? Direction on this would be greatly appreciated! >> > >> > Thanks for your help on this. I searched the forum and didn't find >> > anything specifically dealing with this. I have also checked the mongrel >> > docs and most of the setups talk about mongrel_upload_progress plugin >> > and/or the mongrel_cluster setup...(I may have missed something :-/) >> > >> > >> > cheers, >> > >> > -rjs- >> > >> > p.s. mongrel ROCKS! >> > >> > _______________________________________________ >> > 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 >> >> > > > -- > Matt White > ----------------------- > Thermal Creative > http://blog.thermalcreative.com > From jacob at jacobatzen.dk Tue Nov 28 15:13:25 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Tue, 28 Nov 2006 21:13:25 +0100 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128110142.T82510@bravo.pjkh.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> <20061128110142.T82510@bravo.pjkh.com> Message-ID: <20061128201325.GB72566@apoc.jacobatzen.dk> On Tue, Nov 28, 2006 at 11:03:06AM -0600, Philip Hallstrom wrote: > > What's a rule of thumb for guesstimating how many > > Mongrels to use in a cluster for an app? I have an app > > that gets about 5000 unique visitors per day. I > > figured I'd give it plenty of Mongrels -- twenty to be > > specific. After running out of memory and hitting the > > swap periodically, I scaled it back to five and it > > still seems to serve up visitors fine. So, is there > > some super-secret math fomula I can use to determine > > the ideal number of Mongrels I should start in a > > cluster for an app? > > http://mongrel.rubyforge.org/docs/how_many_mongrels.html > > Just for reference, we get about 500,000 pages a day and run 4 mongrel > processes... we've got about 20 servers[1], but 4 gives us the best > performance. I'm curious - do you have 4 * 20 Mongrels or just 4? How many requests/sec does Rails report in your logs? -- Thanks, - Jacob Atzen From jarkko at jlaine.net Tue Nov 28 14:46:06 2006 From: jarkko at jlaine.net (Jarkko Laine) Date: Tue, 28 Nov 2006 21:46:06 +0200 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> Message-ID: <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> On 28.11.2006, at 21.30, Matt White wrote: > If you use something like mongrel_upload_progress, the single- > threadedness of Rails is no problem because Mongrel will intercept > the upload and not hand it off to Rails until it's complete. That's > what I'm doing at the moment, and my app runs just fine on one > Mongrel. > > If you're running large file uploads, I would recommend looking > into it anyway, because your users will surely want some kind of > update about how their upload is going. Out of curiosity, has anyone managed to pair mongrel_upload_progress (or any of the other options) with MogileFS? //jarkko -- Jarkko Laine http://jlaine.net http://dotherightthing.com http://www.railsecommerce.com http://odesign.fi -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/e5aa7db4/attachment.bin From cremes.devlist at mac.com Tue Nov 28 15:17:37 2006 From: cremes.devlist at mac.com (cremes.devlist at mac.com) Date: Tue, 28 Nov 2006 14:17:37 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: On Nov 28, 2006, at 1:26 PM, Rogelio Samour wrote: > I would like to combine what you guys are suggesting. Namely, have > a merb app (mongrel) dealio... be the sole file uploader listener. > I understand the ReWrite rules and ProxyPass magic. However, this > poses a new question: how would I go about downloading these > uploaded files? I'm assuming I would want this mongrel node to also > be a file server, correct? > > My only experience with setting up mongrel is through > mongrel_rails. cremes: are you saying this upload-only mongrel is > it's own setup? if so, is there docs on setting up something like > this? > Well, there aren't any specific docs explaining how to do this configuration. There are docs for setting up a standalone Mongrel. Then there are other docs which show how to create a mongrel cluster and proxy it with Apache. Just combine the two techniques and you're done. It really is as simple as it sounds. If you have specific problems that you need the group's help to overcome, post here and we'll try. cr From cremes.devlist at mac.com Tue Nov 28 15:20:06 2006 From: cremes.devlist at mac.com (cremes.devlist at mac.com) Date: Tue, 28 Nov 2006 14:20:06 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <85f2e53f0611281150x79f72c7dy8b701e0f1302720d@mail.gmail.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> <85f2e53f0611281150x79f72c7dy8b701e0f1302720d@mail.gmail.com> Message-ID: <4E66BA70-51BC-4575-90FA-DE46C1A3A7D4@mac.com> On Nov 28, 2006, at 1:50 PM, Matt White wrote: > Rogelio, > > It will arrive in Rails just like any other uploaded file... It > will show up in params[:model][:file_field], or whatever you've > named your input file field. Until you do something else with it, > it only lives as a file in /tmp/. You need to move it somewhere > else, though, because Rails will do away with it once the request > is complete :) > > Something like: > > @file = params[:model][:file_field] > File.open("/path/to/#{@file.original_filename}", "wb") { |file| > file.write(@file.read) } > > Would copy the file from it's temp location to /path/to/ > original_filename on your box. As you were wondering, it will end > up on whatever machine is hosting the mongrel that the client was > connected to. So, you may need to scp it to an assets server or > something when it's done... That's as far as I can go without > knowing more about your setup ;) > This is what I'd like to improve in Mongrel. It's really wasteful to write the file to a TempFile and then rewrite it again elsewhere. For really big files (multi-gigabyte) the performance hit would be tremendous. I'm thinking furiously about how to properly manage this. If anyone has any ideas, feel free to share them on the list. cr From zedshaw at zedshaw.com Tue Nov 28 15:21:24 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 15:21:24 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128133437.T82510@bravo.pjkh.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> Message-ID: <20061128152124.d481938a.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 13:35:32 -0600 (CST) Philip Hallstrom wrote: > > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > > not have mongrel installed. It does proxy requests to several other > > mongrel-only servers (each running 2 mongrel processes). Each mongrel > > node has the same rails code-base and it's working perfectly. > > > > However, my question is when I add an upload file form... where is it > > going to physically put that file? I mean since it's hitting either one > > node or the other, so how does mongrel deal with that? and how or where > > do I tell it to accept large files (100mb+) ? > > Others have given good advice on how to do it, but wanted to say you don't > need to do anything to get it to accept 100mb files. We do that quite a > bit and while it takes awhile works just fine. It does tie up a mongrel > process, but we're okay with that. Quick clarification to what Philip said: The actual upload doesn't block mongrel since it's done in a thread before rails gets the uploaded body. Now, once Rails gets it the cgi.rb multipart mime processing is run on the resulting file which can eat your CPU for about 20 seconds/100mb of file (based on my observations). -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 15:30:35 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 15:30:35 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <1164735620.30693.8.camel@localhost.localdomain> References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: <20061128153035.dd84395b.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 11:40:20 -0600 "Rogelio J. Samour" wrote: > I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > not have mongrel installed. It does proxy requests to several other > mongrel-only servers (each running 2 mongrel processes). Each mongrel > node has the same rails code-base and it's working perfectly. > > However, my question is when I add an upload file form... where is it > going to physically put that file? I mean since it's hitting either one > node or the other, so how does mongrel deal with that? and how or where > do I tell it to accept large files (100mb+) ? You really want to look at mongrel_upload_progress and check out how you can do your own standalone upload service. Several folks proposed different apache configs for you to try out. When you break a small standalone Mongrel out of the main Rails setup and use it as the upload target you can basically handle hundreds of uploads concurrently without clustering. I'm gonna do a small write-up on this since I just did it for travelistic.com, but the main thing you need to know (which is found in the simple mongrel_upload_progress code) is that the file is streamed to /tmp/ and then handed to your rails app as a complete file. You don't need to do your own copying inside Ruby (as someone else suggested) but instead can just do a simple move to where you want it. Next thing to know is that mongrel streams the file in small chunks of about 16k, so if the file is 200mb you don't actually load 200mb into ram. Now, cgi.rb might load all 200mb and I know fastcgi does load the whole file. Then the files are uploaded as multipart content, and you need to use cgi.rb to process them since that's about the best there is for ruby right now. I've got code in the works that uses a different algorithm and will make multipart mime much more efficient. Until then you've gotta put up with the sudden CPU bursts you get from cgi.rb after the file is upload. Finally, and this is very important, while the file is written to disk in small chunks and this upload doesn't block Rails actions going on, when you finally pass this to Rails you'll block that Mongrel process while cgi.rb is going. *THIS* is why you should make a separate Mongrel handler to do all of your upload processing and file preparation before you pass the fully cooked stuff to Rails. Mongrel running cgi.rb in a thread is much more efficient than Rails running cgi.rb inside a lock. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 15:34:14 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 15:34:14 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <4E66BA70-51BC-4575-90FA-DE46C1A3A7D4@mac.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> <85f2e53f0611281150x79f72c7dy8b701e0f1302720d@mail.gmail.com> <4E66BA70-51BC-4575-90FA-DE46C1A3A7D4@mac.com> Message-ID: <20061128153414.add758fc.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 14:20:06 -0600 cremes.devlist at mac.com wrote: > > On Nov 28, 2006, at 1:50 PM, Matt White wrote: > > > Rogelio, > > > > It will arrive in Rails just like any other uploaded file... It > > will show up in params[:model][:file_field], or whatever you've > > named your input file field. Until you do something else with it, > > it only lives as a file in /tmp/. You need to move it somewhere > > else, though, because Rails will do away with it once the request > > is complete :) > > > > Something like: > > > > @file = params[:model][:file_field] > > File.open("/path/to/#{@file.original_filename}", "wb") { |file| > > file.write(@file.read) } Matt, don't do this. In fact, if there's code in Mongrel doing this then point it out to me. You already have the fully formed file handle, all you need to do is use fileutils to just rename it. This is an ultra fast operation. Don't copy it in a loop inside ruby. > This is what I'd like to improve in Mongrel. It's really wasteful to > write the file to a TempFile and then rewrite it again elsewhere. For > really big files (multi-gigabyte) the performance hit would be > tremendous. Matt's mistaken Cremes, this isn't how it's done. > I'm thinking furiously about how to properly manage this. If anyone > has any ideas, feel free to share them on the list. You probably have been missing the entire chunk of code I and Ezra have been working on to solve this problem. Including a modified string search algorithm that will find the mime boundaries. If you wanna help on this, e-mail me off line with your ideas and I'll help you check out the source. I haven't been ignoring your other ideas, they're just kind of secondary to the Mongrel 1.0 RC1 release. I'm pushing for this stuff in more of a Mongrel 1.1 or later release. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 15:38:01 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 15:38:01 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> Message-ID: <20061128153801.b0155966.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 14:17:37 -0600 cremes.devlist at mac.com wrote: > > On Nov 28, 2006, at 1:26 PM, Rogelio Samour wrote: > > > I would like to combine what you guys are suggesting. Namely, have > > a merb app (mongrel) dealio... be the sole file uploader listener. > > I understand the ReWrite rules and ProxyPass magic. However, this > > poses a new question: how would I go about downloading these > > uploaded files? I'm assuming I would want this mongrel node to also > > be a file server, correct? > > > > My only experience with setting up mongrel is through > > mongrel_rails. cremes: are you saying this upload-only mongrel is > > it's own setup? if so, is there docs on setting up something like > > this? > > > > Well, there aren't any specific docs explaining how to do this > configuration. There are docs for setting up a standalone Mongrel. > Then there are other docs which show how to create a mongrel cluster > and proxy it with Apache. Just combine the two techniques and you're > done. It really is as simple as it sounds. > > If you have specific problems that you need the group's help to > overcome, post here and we'll try. Yep, it's not hard, the main thing is to read up on the Configurator and to create your own startup script. It's maybe 20-60 lines of code depending on how complex you want to get. Take a look at the mongrel_rails script and the Configurator documentation in the RDoc: http://mongrel.rubyforge.org/rdoc/ I've also already done this for a company and they've given me permission to write it up and release it for other people to use. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 15:39:14 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 15:39:14 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128141849.S82510@bravo.pjkh.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <20061128141849.S82510@bravo.pjkh.com> Message-ID: <20061128153914.64663144.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 14:20:00 -0600 (CST) Philip Hallstrom wrote: > > If you use something like mongrel_upload_progress, the single-threadedness > > of Rails is no problem because Mongrel will intercept the upload and not > > hand it off to Rails until it's complete. That's what I'm doing at the > > moment, and my app runs just fine on one Mongrel. > > I haven't used this plugin, but just gave it a quick read through... one > thing I didn't see mentioned... can I skip the upload progress stuff and > just get the benefits of it not blocking mongrel/rails? Yep, actually that's an incredibly trivial thing to do. You'd probably be better off just starting with a small handler that moved the files where you wanted after the upload, and then expand it to your needs. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 15:41:44 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 15:41:44 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> Message-ID: <20061128154144.d6794ca2.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 21:46:06 +0200 Jarkko Laine wrote: > On 28.11.2006, at 21.30, Matt White wrote: > > > If you use something like mongrel_upload_progress, the single- > > threadedness of Rails is no problem because Mongrel will intercept > > the upload and not hand it off to Rails until it's complete. That's > > what I'm doing at the moment, and my app runs just fine on one > > Mongrel. > > > > If you're running large file uploads, I would recommend looking > > into it anyway, because your users will surely want some kind of > > update about how their upload is going. > > Out of curiosity, has anyone managed to pair mongrel_upload_progress > (or any of the other options) with MogileFS? That's been mentioned in the past, but I believe it wouldn't work since the file has to be streamed to the local disk and then pushed up to MogileFS. Since disks are so cheap it turns out to be cheaper to just upload the file to a big disk and then use a fast web server to serve the files. Now, if you have a post processing stage you could benefit from this. I know several folks that, after they process the files, push them up to Amazon S3. Similar things can be done with MogileFS too. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 15:49:09 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 15:49:09 -0500 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> Message-ID: <20061128154909.4aeeb395.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 08:27:38 -0800 (PST) Joe Ruby wrote: > What's a rule of thumb for guesstimating how many > Mongrels to use in a cluster for an app? I have an app > that gets about 5000 unique visitors per day. Pathetic. 5000/day? Sad. Oh wait, is that 5000 visitors doing 100k request/second during the whole day, or 5000 visitors doing .005 request/second at noon? (I'm jokingly saying you should find out what their usage pattern is and translate that to req/sec processed and kb/second transfered first.) > I figured I'd give it plenty of Mongrels -- twenty to be > specific. After running out of memory and hitting the > swap periodically, I scaled it back to five and it > still seems to serve up visitors fine. So, is there > some super-secret math fomula I can use to determine > the ideal number of Mongrels I should start in a > cluster for an app? Many folks pointed you at the semi-official tuning documentation. 20 is totally over kill and will hurt you more than you know. I find it's about 2-4/CPU depending on the amount of ram you have and the speed of your CPU. BUT YOU SHOULD TUNE EVERY APP EVERY TIME NO MATTER WHAT YOU CHANGED. Don't believe anything as gospel, always test it yourself. Now, lately I've been wanting to add a couple of qualifiers on the scaling issue related to your resource usage. In some situations people are using up tons of ram or tons of files. If you have 2-4 mongrels you quickly outstrip the ram and files. For these folks I tell them to do a different test that tries to do a lot of concurrent but slow connections to eat up as much ram and file handles as they can. Then, they expand the mongrels out to handle the number of connections they need. Many times, people in these situations have to buy more machines. The main culprit of this is RMagick. If you have RMagick you need to simulate a ton of people concurrently slamming you with files to make sure you have the resources. This is also a reasonably good description of file limit defaults and HTTP performance: http://www.xenoclast.org/doc/benchmark/HTTP-benchmarking-HOWTO/node7.html Play with these settings as well for each, maybe even just increasing the defaults. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From stockliasteroid at gmail.com Tue Nov 28 15:58:24 2006 From: stockliasteroid at gmail.com (Matt White) Date: Wed, 29 Nov 2006 09:58:24 +1300 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128153414.add758fc.zedshaw@zedshaw.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> <85f2e53f0611281150x79f72c7dy8b701e0f1302720d@mail.gmail.com> <4E66BA70-51BC-4575-90FA-DE46C1A3A7D4@mac.com> <20061128153414.add758fc.zedshaw@zedshaw.com> Message-ID: <85f2e53f0611281258u773be97as4be90641ec3af0e4@mail.gmail.com> Ha! I wondered if I would manage to incur the wrath of Zed... He is, as always, correct... That's what I get for having outdated Rails wiki code stuck in my head. require 'fileutils' @file = params[:model][:file_field] FileUtils.mv @file.local_path, "/path/to/#{@file.original_filename}" I assume this is what I should do instead, correct? And yeah, I'll second Zed's comment on S3... That's what I'm doing, in conjunction with Backgroundrb, because of some post-processing. Works great. Matt On 11/29/06, Zed A. Shaw wrote: > > On Tue, 28 Nov 2006 14:20:06 -0600 > cremes.devlist at mac.com wrote: > > > > > On Nov 28, 2006, at 1:50 PM, Matt White wrote: > > > > > Rogelio, > > > > > > It will arrive in Rails just like any other uploaded file... It > > > will show up in params[:model][:file_field], or whatever you've > > > named your input file field. Until you do something else with it, > > > it only lives as a file in /tmp/. You need to move it somewhere > > > else, though, because Rails will do away with it once the request > > > is complete :) > > > > > > Something like: > > > > > > @file = params[:model][:file_field] > > > File.open("/path/to/#{@file.original_filename}", "wb") { |file| > > > file.write(@file.read) } > > Matt, don't do this. In fact, if there's code in Mongrel doing this then > point it out to me. > > You already have the fully formed file handle, all you need to do is use > fileutils to just rename it. This is an ultra fast operation. Don't copy > it in a loop inside ruby. > > > This is what I'd like to improve in Mongrel. It's really wasteful to > > write the file to a TempFile and then rewrite it again elsewhere. For > > really big files (multi-gigabyte) the performance hit would be > > tremendous. > > Matt's mistaken Cremes, this isn't how it's done. > > > I'm thinking furiously about how to properly manage this. If anyone > > has any ideas, feel free to share them on the list. > > You probably have been missing the entire chunk of code I and Ezra have > been working on to solve this problem. Including a modified string search > algorithm that will find the mime boundaries. If you wanna help on this, > e-mail me off line with your ideas and I'll help you check out the source. > > I haven't been ignoring your other ideas, they're just kind of secondary > to the Mongrel 1.0 RC1 release. I'm pushing for this stuff in more of a > Mongrel 1.1 or later release. > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://www.awprofessional.com/title/0321483502 -- The Mongrel Book > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Matt White ----------------------- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/886817fa/attachment.html From jarkko at jlaine.net Tue Nov 28 16:08:56 2006 From: jarkko at jlaine.net (Jarkko Laine) Date: Tue, 28 Nov 2006 23:08:56 +0200 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128154144.d6794ca2.zedshaw@zedshaw.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> Message-ID: <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> On 28.11.2006, at 22.41, Zed A. Shaw wrote: > On Tue, 28 Nov 2006 21:46:06 +0200 > Jarkko Laine wrote: >> Out of curiosity, has anyone managed to pair mongrel_upload_progress >> (or any of the other options) with MogileFS? > > That's been mentioned in the past, but I believe it wouldn't work > since the file has to be streamed to the local disk and then pushed > up to MogileFS. Since disks are so cheap it turns out to be > cheaper to just upload the file to a big disk and then use a fast > web server to serve the files. The problem with this, I think, is that you won't get the benefits of no single point of failure (unless you use an expensive RAID array or SAN setup). Also, if you have app servers on multiple machines, you would have to setup NFS or something if you have anything else than the file to be added through the form (i.e. you can't send the entire form to a process dedicated just for file uploads). So I guess something like a BackgrounDRB process running the Robot Co-Op's Mogile library might be the way to go. //jarkko -- Jarkko Laine http://jlaine.net http://dotherightthing.com http://www.railsecommerce.com http://odesign.fi -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/ee37b16d/attachment-0001.bin From mongrel at philip.pjkh.com Tue Nov 28 16:23:14 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 15:23:14 -0600 (CST) Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128201325.GB72566@apoc.jacobatzen.dk> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> <20061128110142.T82510@bravo.pjkh.com> <20061128201325.GB72566@apoc.jacobatzen.dk> Message-ID: <20061128150610.J86635@bravo.pjkh.com> > On Tue, Nov 28, 2006 at 11:03:06AM -0600, Philip Hallstrom wrote: >>> What's a rule of thumb for guesstimating how many >>> Mongrels to use in a cluster for an app? I have an app >>> that gets about 5000 unique visitors per day. I >>> figured I'd give it plenty of Mongrels -- twenty to be >>> specific. After running out of memory and hitting the >>> swap periodically, I scaled it back to five and it >>> still seems to serve up visitors fine. So, is there >>> some super-secret math fomula I can use to determine >>> the ideal number of Mongrels I should start in a >>> cluster for an app? >> >> http://mongrel.rubyforge.org/docs/how_many_mongrels.html >> >> Just for reference, we get about 500,000 pages a day and run 4 mongrel >> processes... we've got about 20 servers[1], but 4 gives us the best >> performance. > > I'm curious - do you have 4 * 20 Mongrels or just 4? How many > requests/sec does Rails report in your logs? We have 4 mongrels per server. Just did a quick grep on one of the servers log files and for about 6000 requests we are averaging 38 reqs/sec with a standard deviation of 113. If I throw out about 2700 requests that I know are slow (< 5 req/s mostly cause we can't cache them) the average goes to 65 reqs/sec. Like I said, we only need those for a little bit every year... during the world series of poker. People really like there poker :) http://www.alexaholic.com/cardplayer.com+penny-arcade.com+basecamphq.com -philip From mongrel at philip.pjkh.com Tue Nov 28 16:26:04 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 15:26:04 -0600 (CST) Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128152124.d481938a.zedshaw@zedshaw.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> <20061128152124.d481938a.zedshaw@zedshaw.com> Message-ID: <20061128152435.R86635@bravo.pjkh.com> >>> I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does >>> not have mongrel installed. It does proxy requests to several other >>> mongrel-only servers (each running 2 mongrel processes). Each mongrel >>> node has the same rails code-base and it's working perfectly. >>> >>> However, my question is when I add an upload file form... where is it >>> going to physically put that file? I mean since it's hitting either one >>> node or the other, so how does mongrel deal with that? and how or where >>> do I tell it to accept large files (100mb+) ? >> >> Others have given good advice on how to do it, but wanted to say you don't >> need to do anything to get it to accept 100mb files. We do that quite a >> bit and while it takes awhile works just fine. It does tie up a mongrel >> process, but we're okay with that. > > Quick clarification to what Philip said: The actual upload doesn't > block mongrel since it's done in a thread before rails gets the uploaded > body. Now, once Rails gets it the cgi.rb multipart mime processing is > run on the resulting file which can eat your CPU for about 20 > seconds/100mb of file (based on my observations). You lost me a bit... are you saying the actual upload doesn't block mongrel with or without the plugin? And when you say "mongrel" do you really mean "rails within mongrel" or just mongrel? I'm thinking you mean that uploads don't block *mongrel* ever, but without the plugin uploads block rails within mongrel which affectively blocks any other rails requests. Yes? From mongrel at philip.pjkh.com Tue Nov 28 16:27:06 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 15:27:06 -0600 (CST) Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128153914.64663144.zedshaw@zedshaw.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <20061128141849.S82510@bravo.pjkh.com> <20061128153914.64663144.zedshaw@zedshaw.com> Message-ID: <20061128152606.C86635@bravo.pjkh.com> > On Tue, 28 Nov 2006 14:20:00 -0600 (CST) > Philip Hallstrom wrote: > >>> If you use something like mongrel_upload_progress, the single-threadedness >>> of Rails is no problem because Mongrel will intercept the upload and not >>> hand it off to Rails until it's complete. That's what I'm doing at the >>> moment, and my app runs just fine on one Mongrel. >> >> I haven't used this plugin, but just gave it a quick read through... one >> thing I didn't see mentioned... can I skip the upload progress stuff and >> just get the benefits of it not blocking mongrel/rails? > > Yep, actually that's an incredibly trivial thing to do. You'd probably > be better off just starting with a small handler that moved the files > where you wanted after the upload, and then expand it to your needs. Yeah, you're right. I grabbed the Rick's svn repo and ran his example in about 10 minutes... That's pretty slick :) Slick enough I might keep that progress bar :) -philip From rogelio.samour at gmail.com Tue Nov 28 16:31:21 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Tue, 28 Nov 2006 15:31:21 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128152435.R86635@bravo.pjkh.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> <20061128152124.d481938a.zedshaw@zedshaw.com> <20061128152435.R86635@bravo.pjkh.com> Message-ID: Holy crap! I leave for an hour and find 24 messages on this thread! Take about a nudge on the right direction... more like a shove! Thanks amigos! Zed... et al! Great job! I'll keep you guys posted. Also once I figure all this out... I'll do a write-up. I'm also investigating how all this will work with nginx (which I assume will be more efficient!) cheers, -rjs- On 11/28/06, Philip Hallstrom wrote: > > >>> I have an Apache 2.2.3 (mod_proxy_balancer) frontend server that does > >>> not have mongrel installed. It does proxy requests to several other > >>> mongrel-only servers (each running 2 mongrel processes). Each mongrel > >>> node has the same rails code-base and it's working perfectly. > >>> > >>> However, my question is when I add an upload file form... where is it > >>> going to physically put that file? I mean since it's hitting either > one > >>> node or the other, so how does mongrel deal with that? and how or > where > >>> do I tell it to accept large files (100mb+) ? > >> > >> Others have given good advice on how to do it, but wanted to say you > don't > >> need to do anything to get it to accept 100mb files. We do that quite > a > >> bit and while it takes awhile works just fine. It does tie up a > mongrel > >> process, but we're okay with that. > > > > Quick clarification to what Philip said: The actual upload doesn't > > block mongrel since it's done in a thread before rails gets the uploaded > > body. Now, once Rails gets it the cgi.rb multipart mime processing is > > run on the resulting file which can eat your CPU for about 20 > > seconds/100mb of file (based on my observations). > > You lost me a bit... are you saying the actual upload doesn't block > mongrel with or without the plugin? And when you say "mongrel" do you > really mean "rails within mongrel" or just mongrel? > > I'm thinking you mean that uploads don't block *mongrel* ever, but without > the plugin uploads block rails within mongrel which affectively blocks any > other rails requests. > > Yes? > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/32ad2c12/attachment.html From ezmobius at gmail.com Tue Nov 28 16:53:39 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Tue, 28 Nov 2006 13:53:39 -0800 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> Message-ID: <1020C900-EBAB-4004-877E-AF7D449CD534@brainspl.at> There is an example merb controller for use with the mongrel_upload_progress if anyone is interested in using a small merb app for their upload app server. We have a number of customers doing this and some of them are handling a ton of file uploads all the time. Merb can also be a nice secure download manager. The Files controller in the example app in the merb svn shows how easy it is to do: http://svn.devjavu.com/merb/examples/sample_app/dist/app/controllers/ files.rb You can do a svn checkout of the merb svn here: $ svn co http://svn.devjavu.com/merb And build it and play with the example app like this: $ cd merb $ sudo rake install $ cd examples/sample_app $ merb -p 4000 Then go to http://localhost:4000/files/start in your browser to see an example of the upload progress. Sice it is running locally you shoudl try to upload a file at least 100Mb or bigger or else it will happen too fast and you won't see the progress bar. The nice thing about the way merb works is that it doesn't use cgi.rb for mime parsing and it is written in a more thread safe way then actionpack. So multiple concurrent requests can be processed and have their mime parsing done all at the same time. Merb only does a mutex around the smallest possible place where you might be calling ActiveRecord code. With the rails dispatcher, the mutex surrounds the entire routing code and mime parsing and your controler code. Merb only locks around the action in your controller code. It does route recognition and mime parsing outside the mutex in a multi threaded way. This allows us to use ActiveRecord in single threaded mode which is better then AR's multi threaded mode for performance. So we use the smallest sized lock we can in order to still support this, but we do all the heavyweight routing and mime parsing concurrently. I promised Zed I would do a write up about using a merb app for a dedicated upload server in conjunction with a rails app. I will try to get something written this week and posted. Until then I am open to and questions about merb and you can file tickets for support or feature requests here: http://merb.devjavu.com/ http://merb.devjavu.com/projects/merb/register Zed and I hope to come up with a solution so that we can use the upload progress without reparsing the mime twice per file. Right now mongrel streams the upload to a tmp file and increments the progress bar all the way to 100% before it hands control to your rails or merb controller to deal with the file. But then rails or merb has to parse the mime boundaries of the entire file again. So you may notice with big files that right when the progress bar makes it to 95-100% it will pause while rails or meb parses the mime again into another tmpfile. This is obviously not an optimal way to do this. Zed has started an awesome fast C mime carver and I will be working with him to integrate this so uploads can be parsed once with the fast C mimer and then just handed off to the next handler with no need to reparse. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From stockliasteroid at gmail.com Tue Nov 28 16:55:27 2006 From: stockliasteroid at gmail.com (Matt White) Date: Wed, 29 Nov 2006 10:55:27 +1300 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128152606.C86635@bravo.pjkh.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <20061128141849.S82510@bravo.pjkh.com> <20061128153914.64663144.zedshaw@zedshaw.com> <20061128152606.C86635@bravo.pjkh.com> Message-ID: <85f2e53f0611281355n39feb869q247fe82262a923d3@mail.gmail.com> Rogelio, Nginx will buffer the entire request before sending it to any mongrels... This probably isn't what you want when dealing with large uploads ;). Check out: http://wiki.codemongers.com/NginxHttpProxyModule Ezra mentioned a while back that the author of Nginx may fix this issue in the future, but for now your requests won't make it through Nginx to Rails (or a dedicated upload mongrel) until the upload is complete... Matt On 11/29/06, Philip Hallstrom wrote: > > > On Tue, 28 Nov 2006 14:20:00 -0600 (CST) > > Philip Hallstrom wrote: > > > >>> If you use something like mongrel_upload_progress, the > single-threadedness > >>> of Rails is no problem because Mongrel will intercept the upload and > not > >>> hand it off to Rails until it's complete. That's what I'm doing at the > >>> moment, and my app runs just fine on one Mongrel. > >> > >> I haven't used this plugin, but just gave it a quick read through... > one > >> thing I didn't see mentioned... can I skip the upload progress stuff > and > >> just get the benefits of it not blocking mongrel/rails? > > > > Yep, actually that's an incredibly trivial thing to do. You'd probably > > be better off just starting with a small handler that moved the files > > where you wanted after the upload, and then expand it to your needs. > > Yeah, you're right. I grabbed the Rick's svn repo and ran his example in > about 10 minutes... > > That's pretty slick :) Slick enough I might keep that progress bar :) > > -philip > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Matt White ----------------------- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/12603ffa/attachment.html From zedshaw at zedshaw.com Tue Nov 28 17:59:20 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 17:59:20 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128152435.R86635@bravo.pjkh.com> References: <1164735620.30693.8.camel@localhost.localdomain> <20061128133437.T82510@bravo.pjkh.com> <20061128152124.d481938a.zedshaw@zedshaw.com> <20061128152435.R86635@bravo.pjkh.com> Message-ID: <20061128175920.d6a4f92a.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 15:26:04 -0600 (CST) Philip Hallstrom wrote: > > Quick clarification to what Philip said: The actual upload doesn't > > block mongrel since it's done in a thread before rails gets the uploaded > > body. Now, once Rails gets it the cgi.rb multipart mime processing is > > run on the resulting file which can eat your CPU for about 20 > > seconds/100mb of file (based on my observations). > > You lost me a bit... are you saying the actual upload doesn't block > mongrel with or without the plugin? And when you say "mongrel" do you > really mean "rails within mongrel" or just mongrel? > > I'm thinking you mean that uploads don't block *mongrel* ever, but without > the plugin uploads block rails within mongrel which affectively blocks any > other rails requests. Here's the process: 1) Mongrel accepts the client, creates a thread, and processes the headers into an HttpRequest object. 2) Then it hits the body, it looks at the content-length and sets up to read that much. 2a) If the body is over 16k then it is streamed to a Tempfile. Otherwise into a StringIO. 3) Mongrel then reads 16k chunks and writes the results into the IO (Tempfile or StringIO). 4) Once the body is complete, and the content-length checks out, then the HttpRequest is complete. 5) The HttpRequest and an HttpResponse is passed to the RailsHandler for processing. 6) LOCK! 7) Rails runs cgi.rb and a bunch of other stuff on the uploaded file. At this point you aren't blocked by the remote client's IO since it's already saved by Mongrel, but cgi.rb is really slow so it'll take a while depending on the size of the file to parse out the multi-part mime. 9) Rails processes the request and sends back the response (which is also stuffed into a StringIO). 10) UNLOCK! 11) Mongrel now takes the response headers and response body and sends those to the remote client fully threaded. So, there's only a short part of the process where Rails is actually blocking the upload. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 18:18:02 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 18:18:02 -0500 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> Message-ID: <20061128181802.076d1468.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 23:08:56 +0200 Jarkko Laine wrote: > On 28.11.2006, at 22.41, Zed A. Shaw wrote: > > > On Tue, 28 Nov 2006 21:46:06 +0200 > > Jarkko Laine wrote: > >> Out of curiosity, has anyone managed to pair mongrel_upload_progress > >> (or any of the other options) with MogileFS? > > > > That's been mentioned in the past, but I believe it wouldn't work > > since the file has to be streamed to the local disk and then pushed > > up to MogileFS. Since disks are so cheap it turns out to be > > cheaper to just upload the file to a big disk and then use a fast > > web server to serve the files. > > The problem with this, I think, is that you won't get the benefits of > no single point of failure (unless you use an expensive RAID array or > SAN setup). So you're saying a couple of web servers running apache or nginx to serve files right off a server's disk is LESS reliable than a nearly unproven MogileFS setup that uses mysql, trackers, storage nodes, and then eventually just transmits off HTTP anyway? Got any metrics to back this claim? -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Tue Nov 28 18:19:20 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 28 Nov 2006 18:19:20 -0500 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128150610.J86635@bravo.pjkh.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> <20061128110142.T82510@bravo.pjkh.com> <20061128201325.GB72566@apoc.jacobatzen.dk> <20061128150610.J86635@bravo.pjkh.com> Message-ID: <20061128181920.7ce59066.zedshaw@zedshaw.com> On Tue, 28 Nov 2006 15:23:14 -0600 (CST) Philip Hallstrom wrote: > > On Tue, Nov 28, 2006 at 11:03:06AM -0600, Philip Hallstrom wrote: > >> Just for reference, we get about 500,000 pages a day and run 4 mongrel > >> processes... we've got about 20 servers[1], but 4 gives us the best > >> performance. > > > > I'm curious - do you have 4 * 20 Mongrels or just 4? How many > > requests/sec does Rails report in your logs? > > Just did a quick grep on one of the servers log files and for about 6000 > requests we are averaging 38 reqs/sec with a standard deviation of 113. Standard Deviation! YES! -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From mongrel at philip.pjkh.com Tue Nov 28 19:55:25 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 28 Nov 2006 18:55:25 -0600 (CST) Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <20061128181802.076d1468.zedshaw@zedshaw.com> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> <20061128181802.076d1468.zedshaw@zedshaw.com> Message-ID: <20061128185304.E87207@bravo.pjkh.com> >>>> Out of curiosity, has anyone managed to pair mongrel_upload_progress >>>> (or any of the other options) with MogileFS? >>> >>> That's been mentioned in the past, but I believe it wouldn't work >>> since the file has to be streamed to the local disk and then pushed >>> up to MogileFS. Since disks are so cheap it turns out to be >>> cheaper to just upload the file to a big disk and then use a fast >>> web server to serve the files. >> >> The problem with this, I think, is that you won't get the benefits of >> no single point of failure (unless you use an expensive RAID array or >> SAN setup). > > So you're saying a couple of web servers running apache or nginx to > serve files right off a server's disk is LESS reliable than a nearly > unproven MogileFS setup that uses mysql, trackers, storage nodes, and > then eventually just transmits off HTTP anyway? I think he was referring to "big disk... web server", and the obvious lack of plurals... one disk on one web server is giong to give you a single point of failure... What we did was to have a "master media" server that everything gets uploaded to. Then we have several slaves that are configured such that if they don't have the file requested they get it from the master. We also have things setup so that the master will request each file from the slave upon it receiving a new file so within about no time we've replicated the file to several slaves and on the off chance one gets uploaded manually it will get picked up... Works for us... From joeat303 at yahoo.com Tue Nov 28 20:51:58 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Tue, 28 Nov 2006 17:51:58 -0800 (PST) Subject: [Mongrel] Determining ideal number of Mongrels for an app? Message-ID: <20061129015158.48629.qmail@web38604.mail.mud.yahoo.com> > On Tue, 28 Nov 2006 08:27:38 -0800 (PST) > Joe Ruby wrote: > > > What's a rule of thumb for guesstimating how many > > Mongrels to use in a cluster for an app? I have an app > > that gets about 5000 unique visitors per day. > > Pathetic. 5000/day? Sad. Oh wait, is that 5000 visitors doing 100k request/second during the whole day, or 5000 visitors doing .005 request/second at noon? It's both! Yeah, it's pathetic and sad, but you think I trust my enterprisey apps to this script-kiddy RoR stuff?!? :P > (I'm jokingly saying you should find out what their usage pattern is and translate that to req/sec processed and kb/second transfered first.) > > > I figured I'd give it plenty of Mongrels -- twenty to be > > specific. After running out of memory and hitting the > > swap periodically, I scaled it back to five and it > > still seems to serve up visitors fine. So, is there > > some super-secret math fomula I can use to determine > > the ideal number of Mongrels I should start in a > > cluster for an app? > > Many folks pointed you at the semi-official tuning documentation. 20 is totally over kill and will hurt you more than you know. I find it's about 2-4/CPU depending on the amount of ram you have and the speed of your CPU. BUT YOU SHOULD TUNE EVERY APP EVERY TIME NO MATTER WHAT YOU CHANGED. Don't believe anything as gospel, always test it yourself. > > Now, lately I've been wanting to add a couple of qualifiers on the scaling issue related to your resource usage. In some situations people are using up tons of ram or tons of files. If you have 2-4 mongrels you quickly outstrip the ram and files. For these folks I tell them to do a different test that tries to do a lot of concurrent but slow connections to eat up as much ram and file handles as they can. Then, they expand the mongrels out to handle the number of connections they need. Many times, people in these situations have to buy more machines. I know you like doing long lines (scroll, scroll, scroll), but check it, yo: http://rubyforge.org/pipermail/mongrel-users/2006-November/002258.html > A joke page about Mongrel MUDCRAP certification that hasn't changed but is now accesible from the site menu: http://mongrel.rubyforge.org/certified.html A JOKE?!? W. T. F. ?!? > > The main culprit of this is RMagick. If you have RMagick you need to simulate a ton of people concurrently slamming you with files to make sure you have the resources. > > This is also a reasonably good description of file limit defaults and HTTP performance: > > http://www.xenoclast.org/doc/benchmark/HTTP-benchmarking-HOWTO/node7.html > > Play with these settings as well for each, maybe even just increasing the defaults. But seriously, thanks for the tips. :) Joe > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://www.awprofessional.com/title/0321483502 -- The Mongrel Book > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com From mental at rydia.net Tue Nov 28 23:10:19 2006 From: mental at rydia.net (MenTaLguY) Date: Tue, 28 Nov 2006 23:10:19 -0500 Subject: [Mongrel] Mongrel, Mutex and FastThread results for win32. In-Reply-To: <71166b3b0611280448r68c22fe7j31ac3993d29cbfd1@mail.gmail.com> References: <71166b3b0611280448r68c22fe7j31ac3993d29cbfd1@mail.gmail.com> Message-ID: <1164773419.23237.4.camel@localhost.localdomain> On Tue, 2006-11-28 at 09:48 -0300, Luis Lavena wrote: > Could anyone on the list confirm these stability enhancement > on other platforms? I'd also be interested to see if there are any noticable differences with: $fastthread_avoid_mem_pools = true -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061128/a0f6be39/attachment.bin From bryan at galisys.com Wed Nov 29 00:23:26 2006 From: bryan at galisys.com (Bryan Thompson) Date: Tue, 28 Nov 2006 23:23:26 -0600 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061129015158.48629.qmail@web38604.mail.mud.yahoo.com> References: <20061129015158.48629.qmail@web38604.mail.mud.yahoo.com> Message-ID: <8901CDD8-5A1B-4968-987E-8BE6236DD1AB@galisys.com> >> A joke page about Mongrel MUDCRAP certification that >> >> > hasn't changed but is now accesible from the site > menu: http://mongrel.rubyforge.org/certified.html > > A JOKE?!? W. T. F. ?!? > > No kidding, I'm still waiting for Mongrel Business & Enterprise Edition for the Marketplace... Deluxe. :^) Bryan Thompson Loy Inc (Sorry if this double-posts... wonky email settings here.) From wayneeseguin at gmail.com Wed Nov 29 10:08:38 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 29 Nov 2006 10:08:38 -0500 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061128154909.4aeeb395.zedshaw@zedshaw.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> <20061128154909.4aeeb395.zedshaw@zedshaw.com> Message-ID: On Nov 28, 2006, at 15:49 , Zed A. Shaw wrote: > Many folks pointed you at the semi-official tuning documentation. > 20 is totally over kill and will hurt you more than you know. I > find it's about 2-4/CPU depending on the amount of ram you have and > the speed of your CPU. BUT YOU SHOULD TUNE EVERY APP EVERY TIME NO > MATTER WHAT YOU CHANGED. Don't believe anything as gospel, always > test it yourself. Zed, Do dual-core chips count as two CPU's for this calculation? Also what is the recommended amount of ram per mongrel process or per CPU based on your experience? Thanks, ~Wayne From rogelio.samour at gmail.com Wed Nov 29 11:13:37 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Wed, 29 Nov 2006 10:13:37 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <1020C900-EBAB-4004-877E-AF7D449CD534@brainspl.at> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> <1020C900-EBAB-4004-877E-AF7D449CD534@brainspl.at> Message-ID: Ezra, Great job on merb! And the myriad of other projects you're involved in! Quick question: - I followed your instructions checked out the latest merb trunk (rev 99) - rake installed (after installing all it's dependencies... do you mind listing those on the README somewhere? :) - cd'd to the sample_app, and proceeded to upload a 500mb iso image - the problem: it spins its wheels until it's finished and then it shows: File uploaded successfully "UPLOADED: {"commit"=>"Upload", "action"=>"upload", "id"=>nil, "controller"=>"files", "upload_id"=>"1164816252", "data"=>{"name"=>"data", "type"=>"application/x-cd-image", "tempfile"=>#, "filename"=>"debian-31r2-i386-netinst.iso"}} - so it's uploading fine but it's not showing the progress of the upload. - what am I doing wrong? thanks again! cheers, -rjs- here's what my terminal shows: {"action"=>"progress", "id"=>nil, "controller"=>"files", "upload_id"=>"1164816252"}(this one several times) skip mutex (this one several times) {"action"=>"progress", "id"=>nil, "controller"=>"files", "upload_id"=>"1164816252"}(this one several times) => fh[type] = application/x-cd-image skip mutex (this one several times) {"action"=>"progress", "id"=>nil, "controller"=>"files", "upload_id"=>"1164816252"}(this one several times) {"commit"=>"Upload", "action"=>"upload", "id"=>nil, "controller"=>"files", "upload_id"=>"1164816252", "data"=>{"name"=>"data", "type"=>"application/x-cd-image", "tempfile"=>#, "filename"=>"debian-31r2-i386-netinst.iso"}} skip mutex On 11/28/06, Ezra Zygmuntowicz wrote: > > > There is an example merb controller for use with the > mongrel_upload_progress if anyone is interested in using a small > merb app for their upload app server. We have a number of customers > doing this and some of them are handling a ton of file uploads all > the time. Merb can also be a nice secure download manager. The Files > controller in the example app in the merb svn shows how easy it is to > do: > > http://svn.devjavu.com/merb/examples/sample_app/dist/app/controllers/ > files.rb > > You can do a svn checkout of the merb svn here: > > $ svn co http://svn.devjavu.com/merb > > And build it and play with the example app like this: > > $ cd merb > $ sudo rake install > $ cd examples/sample_app > $ merb -p 4000 > > Then go to http://localhost:4000/files/start in your browser to > see > an example of the upload progress. Sice it is running locally you > shoudl try to upload a file at least 100Mb or bigger or else it will > happen too fast and you won't see the progress bar. > > The nice thing about the way merb works is that it doesn't use > cgi.rb for mime parsing and it is written in a more thread safe way > then actionpack. So multiple concurrent requests can be processed and > have their mime parsing done all at the same time. Merb only does a > mutex around the smallest possible place where you might be calling > ActiveRecord code. With the rails dispatcher, the mutex surrounds the > entire routing code and mime parsing and your controler code. Merb > only locks around the action in your controller code. It does route > recognition and mime parsing outside the mutex in a multi threaded > way. This allows us to use ActiveRecord in single threaded mode which > is better then AR's multi threaded mode for performance. So we use > the smallest sized lock we can in order to still support this, but we > do all the heavyweight routing and mime parsing concurrently. > > I promised Zed I would do a write up about using a merb app for a > dedicated upload server in conjunction with a rails app. I will try > to get something written this week and posted. Until then I am open > to and questions about merb and you can file tickets for support or > feature requests here: > > http://merb.devjavu.com/ > http://merb.devjavu.com/projects/merb/register > > Zed and I hope to come up with a solution so that we can use the > upload progress without reparsing the mime twice per file. Right now > mongrel streams the upload to a tmp file and increments the progress > bar all the way to 100% before it hands control to your rails or merb > controller to deal with the file. But then rails or merb has to parse > the mime boundaries of the entire file again. So you may notice with > big files that right when the progress bar makes it to 95-100% it > will pause while rails or meb parses the mime again into another > tmpfile. This is obviously not an optimal way to do this. Zed has > started an awesome fast C mime carver and I will be working with him > to integrate this so uploads can be parsed once with the fast C mimer > and then just handed off to the next handler with no need to reparse. > > Cheers- > > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/65a54e43/attachment-0001.html From smartgpx at gmail.com Wed Nov 29 11:42:55 2006 From: smartgpx at gmail.com (DeeJay) Date: Wed, 29 Nov 2006 16:42:55 +0000 Subject: [Mongrel] Mongrel as Win32 service for a camping app? Message-ID: <533048b70611290842g689e8724mad95a038024b8644@mail.gmail.com> As subject line, basically... http://mongrel.rubyforge.org/docs/win32.html describes how to install Service support for Mongrel on Win32. But it seems to be focussed on providing a way of running Rails apps. If it is possible at all, can you provide hints or refer to documentation that explains how to run apps that use other frameworks, like Camping, as Services please? Is it written up online, or in the "Mongrel:SDE" shortcut book? (Perhaps this is one of the fruits to be expected of the win32 work Zed is engaged in right now?) Thanks DJ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/105a0831/attachment.html From rogelio.samour at gmail.com Wed Nov 29 12:19:09 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Wed, 29 Nov 2006 11:19:09 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> <1020C900-EBAB-4004-877E-AF7D449CD534@brainspl.at> Message-ID: Ezra: Doh! The @upstatus var is never set because of the following: Params: {"action"=>"progress", "id"=>nil, "controller"=>"files", "upload_id"=>"1164816252"} Routing to controller: Files action: progress Parsing HTTP Input took: 0.038226 seconds uninitialized constant Mongrel::Uploads - (NameError) /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in `const_missing' /home/rsamour/public_html/merb/examples/sample_app/dist/app/controllers/files.rb:22:in `progress' The problem stems from the files.rb file (line 22 and 23). I know this is straight from the mup example the docs I'm missing a require somewhere... or the example missing it? hmmm -rjs- p.s. I do have the mup gem installed. On 11/29/06, Rogelio Samour wrote: > > Ezra, > > Great job on merb! And the myriad of other projects you're involved in! > > Quick question: > - I followed your instructions checked out the latest merb trunk (rev 99) > - rake installed (after installing all it's dependencies... do you mind > listing those on the README somewhere? :) > - cd'd to the sample_app, and proceeded to upload a 500mb iso image > - the problem: it spins its wheels until it's finished and then it > shows: > > File uploaded successfully "UPLOADED: {"commit"=>"Upload", > "action"=>"upload", "id"=>nil, > > "controller"=>"files", "upload_id"=>"1164816252", > > "data"=>{"name"=>"data", > > "type"=>"application/x-cd-image", > > "tempfile"=>#, > > "filename"=>" debian-31r2-i386-netinst.iso"}} > - so it's uploading fine but it's not showing the progress of the upload. > - what am I doing wrong? > > thanks again! > > cheers, > > -rjs- > > here's what my terminal shows: > {"action"=>"progress", "id"=>nil, "controller"=>"files", > "upload_id"=>"1164816252"}(this one several times) > skip mutex (this one several times) > {"action"=>"progress", "id"=>nil, "controller"=>"files", > "upload_id"=>"1164816252"} (this one several times) > => fh[type] = application/x-cd-image > skip mutex (this one several times) > {"action"=>"progress", "id"=>nil, "controller"=>"files", > "upload_id"=>"1164816252"} (this one several times) > {"commit"=>"Upload", "action"=>"upload", "id"=>nil, "controller"=>"files", > "upload_id"=>"1164816252", "data"=>{"name"=>"data", > "type"=>"application/x-cd-image", "tempfile"=>#, > "filename"=>" debian-31r2-i386-netinst.iso"}} > skip mutex > > > > On 11/28/06, Ezra Zygmuntowicz < ezmobius at gmail.com > wrote: > > > > > > There is an example merb controller for use with the > > mongrel_upload_progress if anyone is interested in using a small > > merb app for their upload app server. We have a number of customers > > doing this and some of them are handling a ton of file uploads all > > the time. Merb can also be a nice secure download manager. The Files > > controller in the example app in the merb svn shows how easy it is to > > do: > > > > http://svn.devjavu.com/merb/examples/sample_app/dist/app/controllers/ > > files.rb > > > > You can do a svn checkout of the merb svn here: > > > > $ svn co http://svn.devjavu.com/merb > > > > And build it and play with the example app like this: > > > > $ cd merb > > $ sudo rake install > > $ cd examples/sample_app > > $ merb -p 4000 > > > > Then go to http://localhost:4000/files/start in your browser to > > see > > an example of the upload progress. Sice it is running locally you > > shoudl try to upload a file at least 100Mb or bigger or else it will > > happen too fast and you won't see the progress bar. > > > > The nice thing about the way merb works is that it doesn't use > > cgi.rb for mime parsing and it is written in a more thread safe way > > then actionpack. So multiple concurrent requests can be processed and > > have their mime parsing done all at the same time. Merb only does a > > mutex around the smallest possible place where you might be calling > > ActiveRecord code. With the rails dispatcher, the mutex surrounds the > > entire routing code and mime parsing and your controler code. Merb > > only locks around the action in your controller code. It does route > > recognition and mime parsing outside the mutex in a multi threaded > > way. This allows us to use ActiveRecord in single threaded mode which > > is better then AR's multi threaded mode for performance. So we use > > the smallest sized lock we can in order to still support this, but we > > do all the heavyweight routing and mime parsing concurrently. > > > > I promised Zed I would do a write up about using a merb app for > > a > > dedicated upload server in conjunction with a rails app. I will try > > to get something written this week and posted. Until then I am open > > to and questions about merb and you can file tickets for support or > > feature requests here: > > > > http://merb.devjavu.com/ > > http://merb.devjavu.com/projects/merb/register > > > > Zed and I hope to come up with a solution so that we can use the > > > > upload progress without reparsing the mime twice per file. Right now > > mongrel streams the upload to a tmp file and increments the progress > > bar all the way to 100% before it hands control to your rails or merb > > controller to deal with the file. But then rails or merb has to parse > > the mime boundaries of the entire file again. So you may notice with > > big files that right when the progress bar makes it to 95-100% it > > will pause while rails or meb parses the mime again into another > > tmpfile. This is obviously not an optimal way to do this. Zed has > > started an awesome fast C mime carver and I will be working with him > > to integrate this so uploads can be parsed once with the fast C mimer > > and then just handed off to the next handler with no need to reparse. > > > > Cheers- > > > > -- Ezra Zygmuntowicz > > -- Lead Rails Evangelist > > -- ez at engineyard.com > > -- Engine Yard, Serious Rails Hosting > > -- (866) 518-YARD (9273) > > > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/4892344c/attachment.html From luislavena at gmail.com Wed Nov 29 12:35:08 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 29 Nov 2006 14:35:08 -0300 Subject: [Mongrel] Mongrel as Win32 service for a camping app? In-Reply-To: <533048b70611290842g689e8724mad95a038024b8644@mail.gmail.com> References: <533048b70611290842g689e8724mad95a038024b8644@mail.gmail.com> Message-ID: <71166b3b0611290935l586623eh4290733c14bbaee3@mail.gmail.com> On 11/29/06, DeeJay wrote: > > As subject line, basically... > > http://mongrel.rubyforge.org/docs/win32.html describes how > to install Service > support for Mongrel on Win32. But it seems to be focussed on providing a way > of running Rails apps. > My whole idea (actually, my POV) with mongrel is rip mongrel_rails and create a unique, unified "mongrel" command, + mongrel_service to offer win32 services for a plain, framework agnostic mongrel. The actual version of mongrel_services (0.1) validates if you're trying to create a service for somethign that isn't a rails application. > If it is possible at all, can you provide hints or refer to documentation > that > explains how to run apps that use other frameworks, like Camping, as > Services > please? Is it written up online, or in the "Mongrel:SDE" shortcut book? > You could code your service directly using win32utils service gem (please read the docs at their site). http://rubyforge.org/projects/win32utils and docs: http://rubyforge.org/docman/?group_id=85 GemServer Service Tutorial and Instiki Service Tutorial. > (Perhaps this is one of the fruits to be expected of the win32 work Zed is > engaged > in right now?) > Because every framework "start" quite different from how rails start things up. Mongrel should implement a way to auto-sense based on the params and the directory structure which framework should it load. Will be excellent to have that, but is a huge task and the frameworks (camping, rails, IOWA, merb) differ a lot. This could be possible, but not in the near future (maybe for a 1.1 release, but not too close of 1.0). Regards and good week, -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From ezmobius at gmail.com Wed Nov 29 15:41:09 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Wed, 29 Nov 2006 12:41:09 -0800 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> <1020C900-EBAB-4004-877E-AF7D449CD534@brainspl.at> Message-ID: <60095540-AC31-4987-9AC8-623647BF0E9A@brainspl.at> On Nov 29, 2006, at 9:19 AM, Rogelio Samour wrote: > Ezra: > Hey Rogelio- Sorry I still need to write more documentation for merb. It has a lot of features that aren't documented well yet. The secret magic to get the example to work is as follows: You need to tell merb there is a config file to be read. And in the sample app there is a mup.conf which is the config file for mongrel_upload-Progress. So you need to start the sample app like this: $ cd examples/sample_app $ merb -f dist/conf/mup.conf Right now the example will only wotk with one merb running. I am still working on the integrated drb server for when you run a merb cluster. I am happy to help with any merb issues you have. I should have the merb mailing list up shortly. Also any problems or feature requests you have please add tickets to the merb trac. I am trying to centralize where I trac issues. -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From rogelio.samour at gmail.com Wed Nov 29 15:56:39 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Wed, 29 Nov 2006 14:56:39 -0600 Subject: [Mongrel] Uploading Large (100mb+) files In-Reply-To: <60095540-AC31-4987-9AC8-623647BF0E9A@brainspl.at> References: <1164735620.30693.8.camel@localhost.localdomain> <85f2e53f0611281130h6075c6f8u5d4baf0efa824e6@mail.gmail.com> <3DD58970-A784-4473-8A6A-C304D68F4B39@jlaine.net> <20061128154144.d6794ca2.zedshaw@zedshaw.com> <3EEB1FDE-69AC-496B-B16A-EBBC4B8CB50A@jlaine.net> <1020C900-EBAB-4004-877E-AF7D449CD534@brainspl.at> <60095540-AC31-4987-9AC8-623647BF0E9A@brainspl.at> Message-ID: Coolio! That did it! I was adding this to the conf/merb.yml in hopes of getting it to work: :config_script: conf/mup.conf: Of course that didn't work. But the -f did the job! The question now is how do you get all this to work nicely with my rails app? thanks again for merb (my new best friend) :-p -rjs- On 11/29/06, Ezra Zygmuntowicz wrote: > > > On Nov 29, 2006, at 9:19 AM, Rogelio Samour wrote: > > > Ezra: > > > > > Hey Rogelio- > > Sorry I still need to write more documentation for merb. It has a > lot of features that aren't documented well yet. The secret magic to > get the example to work is as follows: > > You need to tell merb there is a config file to be read. And in the > sample app there is a mup.conf which is the config file for > mongrel_upload-Progress. So you need to start the sample app like this: > > $ cd examples/sample_app > $ merb -f dist/conf/mup.conf > > Right now the example will only wotk with one merb running. I am > still working on the integrated drb server for when you run a merb > cluster. I am happy to help with any merb issues you have. I should > have the merb mailing list up shortly. Also any problems or feature > requests you have please add tickets to the merb trac. I am trying to > centralize where I trac issues. > > > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061129/413fb45f/attachment.html From wyhaines at gmail.com Wed Nov 29 19:12:36 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 29 Nov 2006 17:12:36 -0700 Subject: [Mongrel] Mongrel as Win32 service for a camping app? In-Reply-To: <71166b3b0611290935l586623eh4290733c14bbaee3@mail.gmail.com> References: <533048b70611290842g689e8724mad95a038024b8644@mail.gmail.com> <71166b3b0611290935l586623eh4290733c14bbaee3@mail.gmail.com> Message-ID: On 11/29/06, Luis Lavena wrote: > Because every framework "start" quite different from how rails start > things up. Mongrel should implement a way to auto-sense based on the > params and the directory structure which framework should it load. > > Will be excellent to have that, but is a huge task and the frameworks > (camping, rails, IOWA, merb) differ a lot. In the case of IOWA, it's really IOWA that is in charge, not Mongrel. The IOWA app takes care of setting up the configuration for Mongrel, and then registers the Iowa::MongrelHandler with Mongrel. It then starts the Mongrel event loop via: @mongrel.run @mongrel_thread = @mongrel.acceptor @mongrel_thread.join It's very similar to the way Nitro works with Mongrel, as well. Kirk Haines From zedshaw at zedshaw.com Thu Nov 30 00:22:03 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 30 Nov 2006 00:22:03 -0500 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> <20061128154909.4aeeb395.zedshaw@zedshaw.com> Message-ID: <20061130002203.a69d5217.zedshaw@zedshaw.com> On Wed, 29 Nov 2006 10:08:38 -0500 "Wayne E. Seguin" wrote: > > On Nov 28, 2006, at 15:49 , Zed A. Shaw wrote: > > Many folks pointed you at the semi-official tuning documentation. > > 20 is totally over kill and will hurt you more than you know. I > > find it's about 2-4/CPU depending on the amount of ram you have and > > the speed of your CPU. BUT YOU SHOULD TUNE EVERY APP EVERY TIME NO > > MATTER WHAT YOU CHANGED. Don't believe anything as gospel, always > > test it yourself. > > Zed, > > Do dual-core chips count as two CPU's for this calculation? Do believe anything I said above. Find out your own optimal configuration. The reason is if I say 2-4 people will assume it's gospel and never test their apps. You might find your app can get better performance with more or less, or you might find it is so slow that really you just need to spread it out across as many as you can. Test it for yourself, and test it every time a new deployment goes out. > Also what is the recommended amount of ram per mongrel process or per > CPU based on your experience? Again, test it. You should slam a bunch of your biggest pages with large requests and try to see what it hits as a peak, then set that for you resource calculations. This is especially true if you use rmagick. Big thing is to go through your test and development logs and look for huge queries. Those will kill you every time. Also, make sure your session clearing stuff is good. Someone was getting huge memory penalties recently because they had 5.2 million stale sessions in their mysql. Again, believe nothing, test everything. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From zedshaw at zedshaw.com Thu Nov 30 00:46:54 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 30 Nov 2006 00:46:54 -0500 Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061130002203.a69d5217.zedshaw@zedshaw.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> <20061128154909.4aeeb395.zedshaw@zedshaw.com> <20061130002203.a69d5217.zedshaw@zedshaw.com> Message-ID: <20061130004654.46041351.zedshaw@zedshaw.com> On Thu, 30 Nov 2006 00:22:03 -0500 "Zed A. Shaw" wrote: > Do believe anything I said above. Correction: "DON'T believe anything I said above..." -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From kylekochis at gmail.com Thu Nov 30 01:21:35 2006 From: kylekochis at gmail.com (Kyle Kochis) Date: Wed, 29 Nov 2006 23:21:35 -0700 Subject: [Mongrel] Mongrel Cluster init.d problems Message-ID: <6a7034b0611292221g5253ae0sd0f5210fc0e37ccc@mail.gmail.com> I have installed mongrel and mongrel_cluster fine and have them running great with my app. I tried using the init.d script provided with mongrel_cluster 2.1 to start it up on boot but it doesn't. mongrel_cluster_ctl works fine for me by hand and so does /etc/init.d./mongrel_cluster start. I am on Debian so I installed the service links with sudo update-rc.d mongrel_cluster defaults. And yes I chmod'ed it. I checked and double checked /etc/mongrel_cluster and my yml file and everything I can think of. Finally out of frustration I hand linked the system boot stuff like this: sudo ln -s /etc/init.d/mongrel_cluster /etc/rc0.d/S84mongrel_cluster sudo ln -s /etc/init.d/mongrel_cluster /etc/rc3.d/S84mongrel_cluster sudo ln -s /etc/init.d/mongrel_cluster /etc/rc6.d/S84mongrel_cluster And still no luck. Again if I start em up by hand everything works like it should. Thanks for the help, Kyle From luislavena at gmail.com Thu Nov 30 01:22:49 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 30 Nov 2006 03:22:49 -0300 Subject: [Mongrel] Mongrel as Win32 service for a camping app? In-Reply-To: References: <533048b70611290842g689e8724mad95a038024b8644@mail.gmail.com> <71166b3b0611290935l586623eh4290733c14bbaee3@mail.gmail.com> Message-ID: <71166b3b0611292222u385cdc2eq68035b30270294d4@mail.gmail.com> On 11/29/06, Kirk Haines wrote: > On 11/29/06, Luis Lavena wrote: > > > Because every framework "start" quite different from how rails start > > things up. Mongrel should implement a way to auto-sense based on the > > params and the directory structure which framework should it load. > > > > Will be excellent to have that, but is a huge task and the frameworks > > (camping, rails, IOWA, merb) differ a lot. > > In the case of IOWA, it's really IOWA that is in charge, not Mongrel. As I have said: each framework implement/use Mongrel in different ways. > The IOWA app takes care of setting up the configuration for Mongrel, > and then registers the Iowa::MongrelHandler with Mongrel. It then > starts the Mongrel event loop via: > > @mongrel.run > @mongrel_thread = @mongrel.acceptor > @mongrel_thread.join > > It's very similar to the way Nitro works with Mongrel, as well. > IOWA, Nitro and Camping could be implemented as "/frameworks" registered in mongrel. then "mongrel" script validate which is the directory you're trying to run mongrel in and call the framework configurator. Just and idea, maybe that could be implemented in the future. -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From gethemant at gmail.com Thu Nov 30 05:04:07 2006 From: gethemant at gmail.com (hemant) Date: Thu, 30 Nov 2006 15:34:07 +0530 Subject: [Mongrel] Mongrel Cluster init.d problems In-Reply-To: <6a7034b0611292221g5253ae0sd0f5210fc0e37ccc@mail.gmail.com> References: <6a7034b0611292221g5253ae0sd0f5210fc0e37ccc@mail.gmail.com> Message-ID: On 11/30/06, Kyle Kochis wrote: > I have installed mongrel and mongrel_cluster fine and have them > running great with my app. I tried using the init.d script provided > with mongrel_cluster 2.1 to start it up on boot but it doesn't. > mongrel_cluster_ctl works fine for me by hand and so does > /etc/init.d./mongrel_cluster start. I am on Debian so I installed the > service links with sudo update-rc.d mongrel_cluster defaults. And yes > I chmod'ed it. I checked and double checked /etc/mongrel_cluster and > my yml file and everything I can think of. Finally out of frustration > I hand linked the system boot stuff like this: > sudo ln -s /etc/init.d/mongrel_cluster /etc/rc0.d/S84mongrel_cluster > sudo ln -s /etc/init.d/mongrel_cluster /etc/rc3.d/S84mongrel_cluster > sudo ln -s /etc/init.d/mongrel_cluster /etc/rc6.d/S84mongrel_cluster > > And still no luck. Again if I start em up by hand everything works > like it should. > > Thanks for the help, > > Kyle Without appropriate error message only god can help you. -- There was only one Road; that it was like a great river: its springs were at every doorstep, and every path was its tributary. From jamie at dangosaur.us Thu Nov 30 09:34:03 2006 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Thu, 30 Nov 2006 09:34:03 -0500 Subject: [Mongrel] Mongrel Cluster init.d problems In-Reply-To: References: <6a7034b0611292221g5253ae0sd0f5210fc0e37ccc@mail.gmail.com> Message-ID: <8004B87C-51E6-4233-9FD1-8D33B0D2E153@dangosaur.us> Make sure the paths needed are available at boot. I had a similar problem on FreeBSD and was helped out by Andrew Bennett. Here's what he had to say: Hey Jamie, Yeah, I found that out after using my own script for a while. It is caused by the way mongrel_cluster starts each of the mongrel servers. It actually calls the command line "mongrel_rails start ..." on each of the specified directories. However, when FreeBSD starts up, the PATH hasn't been set correctly yet, so calling "mongrel_rails" results in a "not found" error because "/usr/local/bin" hasn't been added to the PATH yet. I just cheated and added the following to /usr/local/etc/rc.d/ mongrel_cluster ... stop_cmd="stop_cmd" status_cmd="status_cmd" PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/ local/bin:/usr/X11R6/bin restart_cmd() { ... I added the surrounding lines so you can tell where I'm talking about. I'm not sure if there is a better way to do this, but it works for now. On Nov 30, 2006, at 5:04 AM, hemant wrote: > On 11/30/06, Kyle Kochis wrote: >> I have installed mongrel and mongrel_cluster fine and have them >> running great with my app. I tried using the init.d script provided >> with mongrel_cluster 2.1 to start it up on boot but it doesn't. >> mongrel_cluster_ctl works fine for me by hand and so does >> /etc/init.d./mongrel_cluster start. I am on Debian so I installed the >> service links with sudo update-rc.d mongrel_cluster defaults. And yes >> I chmod'ed it. I checked and double checked /etc/mongrel_cluster and >> my yml file and everything I can think of. Finally out of frustration >> I hand linked the system boot stuff like this: >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc0.d/S84mongrel_cluster >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc3.d/S84mongrel_cluster >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc6.d/S84mongrel_cluster >> >> And still no luck. Again if I start em up by hand everything works >> like it should. >> >> Thanks for the help, >> >> Kyle > > Without appropriate error message only god can help you. > > -- > There was only one Road; that it was like a great river: its springs > were at every doorstep, and every path was its tributary. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From joeat303 at yahoo.com Thu Nov 30 12:10:13 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Thu, 30 Nov 2006 09:10:13 -0800 (PST) Subject: [Mongrel] Restarting mongrel cluster from other directories Message-ID: <170103.22315.qm@web38601.mail.mud.yahoo.com> I want to restart my Mongrels from crontab periodically to free up memory. I tried this: [admin at mudcrapce ~]$ mongrel_rails cluster::restart -C /var/www/apps/mudcrapce/current/config/mongrel_cluster.yml Restarting 5 Mongrel servers... mongrel_rails restart -P log/mongrel.3040.pid !!! PID file log/mongrel.3040.pid does not exist. Not running? mongrel::restart reported an error. Use mongrel_rails mongrel::restart -h to get help. Mongrel's cluster restart has these options: [admin at mudcrapce ~]$ mongrel_rails cluster::restart -h Usage: mongrel_rails [options] -C, --config PATH Path to config file -s, --soft Do a soft restart rather than a process exit restart -h, --help Show this message --version Show version I see regular Mongrel has a chdir option for restart: -c, --chdir PATH Change to dir before starting (will be expanded) But I don't think that'd work for clusters. Any ideas? I also hear that perhaps Monit could be used for restarting processes if they start using too much memory. Thanks, Joe ____________________________________________________________________________________ Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index From luislavena at gmail.com Thu Nov 30 12:17:30 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 30 Nov 2006 14:17:30 -0300 Subject: [Mongrel] [ANN] Mongrel Service 0.3.1, basic process monitoring Message-ID: <71166b3b0611300917m3c7ca17asc857de387b3a08f1@mail.gmail.com> Hello Folks, I tried create a valid gem repository under windows without luck (rubygems show problem with CRLF/LF line endings between *nix and windows). Anyway, I've uploaded a new gem to my webpage: http://www.mmediasys.com/releases/mongrel_service-0.3.1-mswin32.gem Whats new? Beside the things added in previous announcement [1], this version add basic process monitoring. What that means? If for some reason the mongrel process (also a ruby process) suddenly dies (maybe a runtime error), the service will automatically re-create a new process. So, in intervals of 5 seconds, if your process die, it will be recreated. That will reduce the uptime problems of your applications, right? Later this weekend will add the cluster capability, so Windows no longer envy users running *nix or OSX ;-) Oh, BTW, if you don't want to add a service in windows, you could "simulate" it using console command: mongrel_service console single -c "c:/path/to/my/rails/app" -p 4000 -e production Please, all the folks on Windows environment try the latest build of the gem and report problems (if any was found). Regards, -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi [1] http://rubyforge.org/pipermail/mongrel-users/2006-November/002186.html From kylekochis at gmail.com Thu Nov 30 12:52:59 2006 From: kylekochis at gmail.com (Kyle Kochis) Date: Thu, 30 Nov 2006 10:52:59 -0700 Subject: [Mongrel] Mongrel Cluster init.d problems Message-ID: <6a7034b0611300952w1fc065f4i8f392b0f0ef10107@mail.gmail.com> On 11/30/06, Jamie Orchard-Hays wrote: > > Make sure the paths needed are available at boot. I had a similar > problem on FreeBSD and was helped out by Andrew Bennett. Here's what > he had to say: > > Hey Jamie, > > Yeah, I found that out after using my own script for a while. It is > caused by the way mongrel_cluster starts each of the mongrel servers. > It actually calls the command line "mongrel_rails start ..." on each > of the specified directories. However, when FreeBSD starts up, the > PATH hasn't been set correctly yet, so calling "mongrel_rails" results > in a "not found" error because "/usr/local/bin" hasn't been added to > the PATH yet. > > I just cheated and added the following to /usr/local/etc/rc.d/ > mongrel_cluster > > ... > stop_cmd="stop_cmd" > status_cmd="status_cmd" > > PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/ > local/bin:/usr/X11R6/bin > > restart_cmd() > { > ... > > I added the surrounding lines so you can tell where I'm talking about. > I'm not sure if there is a better way to do this, but it works for > now. > > On Nov 30, 2006, at 5:04 AM, hemant wrote: > > > On 11/30/06, Kyle Kochis wrote: > >> I have installed mongrel and mongrel_cluster fine and have them > >> running great with my app. I tried using the init.d script provided > >> with mongrel_cluster 2.1 to start it up on boot but it doesn't. > >> mongrel_cluster_ctl works fine for me by hand and so does > >> /etc/init.d./mongrel_cluster start. I am on Debian so I installed the > >> service links with sudo update-rc.d mongrel_cluster defaults. And yes > >> I chmod'ed it. I checked and double checked /etc/mongrel_cluster and > >> my yml file and everything I can think of. Finally out of frustration > >> I hand linked the system boot stuff like this: > >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc0.d/S84mongrel_cluster > >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc3.d/S84mongrel_cluster > >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc6.d/S84mongrel_cluster > >> > >> And still no luck. Again if I start em up by hand everything works > >> like it should. > >> > >> Thanks for the help, > >> > >> Kyle > > > > Without appropriate error message only god can help you. > > > > -- > > There was only one Road; that it was like a great river: its springs > > were at every doorstep, and every path was its tributary. > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > From kylekochis at gmail.com Thu Nov 30 12:54:01 2006 From: kylekochis at gmail.com (Kyle Kochis) Date: Thu, 30 Nov 2006 10:54:01 -0700 Subject: [Mongrel] Mongrel Cluster init.d problems In-Reply-To: <6a7034b0611300952w1fc065f4i8f392b0f0ef10107@mail.gmail.com> References: <6a7034b0611300952w1fc065f4i8f392b0f0ef10107@mail.gmail.com> Message-ID: <6a7034b0611300954l3cacaaecmb5a796f21125a301@mail.gmail.com> Sorry about the double post. Thanks. That fixed the problem. Kyle On 11/30/06, Kyle Kochis wrote: > On 11/30/06, Jamie Orchard-Hays wrote: > > > > Make sure the paths needed are available at boot. I had a similar > > problem on FreeBSD and was helped out by Andrew Bennett. Here's what > > he had to say: > > > > Hey Jamie, > > > > Yeah, I found that out after using my own script for a while. It is > > caused by the way mongrel_cluster starts each of the mongrel servers. > > It actually calls the command line "mongrel_rails start ..." on each > > of the specified directories. However, when FreeBSD starts up, the > > PATH hasn't been set correctly yet, so calling "mongrel_rails" results > > in a "not found" error because "/usr/local/bin" hasn't been added to > > the PATH yet. > > > > I just cheated and added the following to /usr/local/etc/rc.d/ > > mongrel_cluster > > > > ... > > stop_cmd="stop_cmd" > > status_cmd="status_cmd" > > > > PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/ > > local/bin:/usr/X11R6/bin > > > > restart_cmd() > > { > > ... > > > > I added the surrounding lines so you can tell where I'm talking about. > > I'm not sure if there is a better way to do this, but it works for > > now. > > > > On Nov 30, 2006, at 5:04 AM, hemant wrote: > > > > > On 11/30/06, Kyle Kochis wrote: > > >> I have installed mongrel and mongrel_cluster fine and have them > > >> running great with my app. I tried using the init.d script provided > > >> with mongrel_cluster 2.1 to start it up on boot but it doesn't. > > >> mongrel_cluster_ctl works fine for me by hand and so does > > >> /etc/init.d./mongrel_cluster start. I am on Debian so I installed the > > >> service links with sudo update-rc.d mongrel_cluster defaults. And yes > > >> I chmod'ed it. I checked and double checked /etc/mongrel_cluster and > > >> my yml file and everything I can think of. Finally out of frustration > > >> I hand linked the system boot stuff like this: > > >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc0.d/S84mongrel_cluster > > >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc3.d/S84mongrel_cluster > > >> sudo ln -s /etc/init.d/mongrel_cluster /etc/rc6.d/S84mongrel_cluster > > >> > > >> And still no luck. Again if I start em up by hand everything works > > >> like it should. > > >> > > >> Thanks for the help, > > >> > > >> Kyle > > > > > > Without appropriate error message only god can help you. > > > > > > -- > > > There was only one Road; that it was like a great river: its springs > > > were at every doorstep, and every path was its tributary. > > > _______________________________________________ > > > Mongrel-users mailing list > > > Mongrel-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > > > From runner at berkeley.edu Thu Nov 30 13:36:47 2006 From: runner at berkeley.edu (Steven Hansen) Date: Thu, 30 Nov 2006 10:36:47 -0800 Subject: [Mongrel] Sharing Mongrel Log Files on SAN Storage Message-ID: <456F24BF.7000408@berkeley.edu> Hi, My department has a SAN and I'm wondering if it is safe to have all of my mongrel's share log files stored on the SAN. More specifically, we have 4 machines, each running a couple of mongrel processes. Right now each machine has its own set of log files for mongrel. However, I am thinking that it might be better to put the log files on the SAN and let all the mongrels on all the different machines share 1 set of log files. I'd be interested to gets some feedback from other mongrelians on whether this is a good idea or a bad idea and why. Thanks, Steven From mongrel at philip.pjkh.com Thu Nov 30 14:55:55 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Thu, 30 Nov 2006 13:55:55 -0600 (CST) Subject: [Mongrel] Determining ideal number of Mongrels for an app? In-Reply-To: <20061130004654.46041351.zedshaw@zedshaw.com> References: <20061128162738.59833.qmail@web38610.mail.mud.yahoo.com> <20061128154909.4aeeb395.zedshaw@zedshaw.com> <20061130002203.a69d5217.zedshaw@zedshaw.com> <20061130004654.46041351.zedshaw@zedshaw.com> Message-ID: <20061130135355.E21812@bravo.pjkh.com> > On Thu, 30 Nov 2006 00:22:03 -0500 > "Zed A. Shaw" wrote: > >> Do believe anything I said above. > > Correction: > > "DON'T believe anything I said above..." Well, now I'm just completely confused! :-) And I'm pretty sure the above is going to cause a memory leak of some sort :) From zedshaw at zedshaw.com Thu Nov 30 15:01:04 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 30 Nov 2006 15:01:04 -0500 Subject: [Mongrel] Sharing Mongrel Log Files on SAN Storage In-Reply-To: <456F24BF.7000408@berkeley.edu> References: <456F24BF.7000408@berkeley.edu> Message-ID: <20061130150104.3e00aed1.zedshaw@zedshaw.com> On Thu, 30 Nov 2006 10:36:47 -0800 Steven Hansen wrote: > > Hi, > > My department has a SAN and I'm wondering if it is safe to have all of > my mongrel's share log files stored on the SAN. > > More specifically, we have 4 machines, each running a couple of mongrel > processes. Right now each machine has its own set of log files for > mongrel. However, I am thinking that it might be better to put the log > files on the SAN and let all the mongrels on all the different machines > share 1 set of log files. I'd be interested to gets some feedback from > other mongrelians on whether this is a good idea or a bad idea and why. I should probably just make this the norm, but I advocate that people setup pid and log files separate for each port they have, and probable each machine:port combination. This makes it easier to isolate one mongrel's stuff and to track what is happening to a particular instance. If you do this it also means you can share it all you like. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. From jgeiger at gmail.com Thu Nov 30 15:02:08 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Thu, 30 Nov 2006 14:02:08 -0600 Subject: [Mongrel] Restarting mongrel cluster from other directories In-Reply-To: <170103.22315.qm@web38601.mail.mud.yahoo.com> References: <170103.22315.qm@web38601.mail.mud.yahoo.com> Message-ID: <466af3440611301202u79ffa9f5t9cad0d7aed38803b@mail.gmail.com> Monit is the way to go. I've setup monit to restart when the mongrel starts to use more than 80MB, and when it's not available. (When I rotate the logs, I have a script that will kill one mongrel process every 30 seconds, until they have all rotated.) There were a few examples posted on the list a while back that should help you out. On 11/30/06, Joe Ruby wrote: > I want to restart my Mongrels from crontab > periodically to free up memory. I tried this: > > [admin at mudcrapce ~]$ mongrel_rails cluster::restart -C > /var/www/apps/mudcrapce/current/config/mongrel_cluster.yml > > Restarting 5 Mongrel servers... > mongrel_rails restart -P log/mongrel.3040.pid > !!! PID file log/mongrel.3040.pid does not exist. Not > running? > mongrel::restart reported an error. Use mongrel_rails > mongrel::restart -h to get help. > > Mongrel's cluster restart has these options: > [admin at mudcrapce ~]$ mongrel_rails cluster::restart -h > Usage: mongrel_rails [options] > -C, --config PATH Path to config > file > -s, --soft Do a soft restart > rather than a process exit restart > -h, --help Show this message > --version Show version > > I see regular Mongrel has a chdir option for restart: > > -c, --chdir PATH Change to dir before > starting (will be expanded) > > But I don't think that'd work for clusters. > > Any ideas? I also hear that perhaps Monit could be > used for restarting processes if they start using too > much memory. > > Thanks, > Joe > > > > > ____________________________________________________________________________________ > Want to start your own business? > Learn how on Yahoo! Small Business. > http://smallbusiness.yahoo.com/r-index > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From ezmobius at gmail.com Thu Nov 30 15:54:41 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Thu, 30 Nov 2006 12:54:41 -0800 Subject: [Mongrel] Sharing Mongrel Log Files on SAN Storage In-Reply-To: <456F24BF.7000408@berkeley.edu> References: <456F24BF.7000408@berkeley.edu> Message-ID: On Nov 30, 2006, at 10:36 AM, Steven Hansen wrote: > > Hi, > > My department has a SAN and I'm wondering if it is safe to have all of > my mongrel's share log files stored on the SAN. > > More specifically, we have 4 machines, each running a couple of > mongrel > processes. Right now each machine has its own set of log files for > mongrel. However, I am thinking that it might be better to put the > log > files on the SAN and let all the mongrels on all the different > machines > share 1 set of log files. I'd be interested to gets some feedback > from > other mongrelians on whether this is a good idea or a bad idea and > why. > > Thanks, > Steven > Hey Steven- What filesystem re you using n the SAN? We have many Xen nodes running rails apps that share a GFS filesystem partition off the SAN. With GFS you can make hostname specific symlinks so that even though the nodes of the cluster are all still writing their logs to logs/ production.log, each node is actually writing to a symlink based on hostname. Let me illustrate. Say we have 2 Xen instances for one rails app. They both share a GFS partition mounted off the SAN at /data. So anything under /data is shared between these nodes. With a capistrano setup you make sure to deploy yoru apps to the /data partition. So to setup the hostname logging on both slices you woudl log into each one and run the following commands: app is here: /data/railsapp/current logs are here: /data/railsapp/shared/log We want both nodes to have their own log files but still have them both be writing to the same log file path. So we make hostname symlinks like this: $ cd /data/railsapp/shared $ rm -rf log $ mkdir `hostname` $ ln -s @hostname log You do that on all nodes that share the same /data partition. This gives a very dramatic increase in performance over all nodes writing to the same log file. Getting a file lock on shared storage is more troublesome then on non shared storage. So with multiple nodes all writing to the same log file, each node has to get a lock before it can write and other nodes wait their turn for the lock. Using this @hostname trick, each node has its own log file that no other nodes write to. But you don't have to change the way rails or capistrano sets up the log files. Each node writes its logs to /data/railsapp/ shared/log/production.log, but in reality they are all writing to a symlink to a directory with the same name as the nodes hostname. We tried NFS and a few other filesystems and they all sucked. We ended up using the red hat clustering suite. But even though its a red hat suite it runs on any linux, we use it with gentoo. It includes GFS and the cluster fencing stuff that allows nodes to dynamically fence off any other nodes that are misbehaving. GFS works really well for shared storage off a SAN. I would definitely recommend not having all your nodes write their logs to the same file on the SAN. See if you can find a way to do like GFS does or as a last resort you may have to do some hacking to get rails to write its log files with the pid or some other unique identifier so that each node writes to its own log files. Doing this gave us a whopping 25% better performance when compared with all nodes sharing the same log file. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From jeroen at supercool.nl Thu Nov 30 16:07:51 2006 From: jeroen at supercool.nl (Jeroen Houben) Date: Thu, 30 Nov 2006 22:07:51 +0100 Subject: [Mongrel] stability Message-ID: <456F4827.2070207@supercool.nl> Hi, Are there any recommendations as to what is currently the most stable setup is for mongrel & apache? I read somewhere (probably here) that you should avoid using PStore for sessions. Are there any more of such recommendations? Also, what is currently the safest version of mongrel to use in production? Jeroen From rogelio.samour at gmail.com Thu Nov 30 18:09:18 2006 From: rogelio.samour at gmail.com (Rogelio Samour) Date: Thu, 30 Nov 2006 17:09:18 -0600 Subject: [Mongrel] stability In-Reply-To: <456F4827.2070207@supercool.nl> References: <456F4827.2070207@supercool.nl> Message-ID: I would definitely use rake db:sessions:create (ActiveRecord Store) that way your sessions are all in one central place and all mongrel nodes can access it. (of course assuming you're using rails :-p) And Apache 2.2.3 (compiled from source with mod_proxy_balancer) and the latest mongrel gem has worked great for me thus far. :: my 2 cents :: cheers, -rjs- On 11/30/06, Jeroen Houben wrote: > > Hi, > > Are there any recommendations as to what is currently the most stable > setup is for mongrel & apache? I read somewhere (probably here) that you > should avoid using PStore for sessions. Are there any more of such > recommendations? Also, what is currently the safest version of mongrel > to use in production? > > Jeroen > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061130/458210a2/attachment.html From rmdf at stimble.net Thu Nov 30 18:39:23 2006 From: rmdf at stimble.net (Michael Fairchild) Date: Thu, 30 Nov 2006 15:39:23 -0800 Subject: [Mongrel] mongrel served from a subdirectory Message-ID: <2ef9bb620611301539t62b9bea0y80326fcf6abe7fb@mail.gmail.com> Hello, I have setup mongrel successfully a few times now, but, each time I have used apaceh 2.2 and mod_proxy setup descibed on the mongrel site. However, I need to set up another app in a subdomain. example.com/docserver instead of docserver.example.com. I have tried just adding I have something like: ProxyPass /docserver/ http://example.com:3001/ ProxyPassReverse /docserver/ http://example.com:3001 ProxyPreserveHost on The problem seems to be two fold. First, the css, image and javascript links, are all broken. Second all the generated links are to /controller/action instead of to docserver/controller/action. I tried putting RAILS_RELATIVE_URL_ROOT="/docserver/" in enviornment.rb, but that didn't help. any ideas? Thanks, Michael Fairchild -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061130/cb2fcf9e/attachment.html From mongrel at philip.pjkh.com Thu Nov 30 18:56:15 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Thu, 30 Nov 2006 17:56:15 -0600 (CST) Subject: [Mongrel] mongrel served from a subdirectory In-Reply-To: <2ef9bb620611301539t62b9bea0y80326fcf6abe7fb@mail.gmail.com> References: <2ef9bb620611301539t62b9bea0y80326fcf6abe7fb@mail.gmail.com> Message-ID: <20061130175545.P21812@bravo.pjkh.com> > Hello, > I have setup mongrel successfully a few times now, but, each time I have > used apaceh 2.2 and mod_proxy setup descibed on the mongrel site. > However, I need to set up another app in a subdomain. example.com/docserver > instead of docserver.example.com. > I have tried just adding I have something like: > > ProxyPass /docserver/ http://example.com:3001/ > ProxyPassReverse /docserver/ http://example.com:3001 > ProxyPreserveHost on > > The problem seems to be two fold. First, the css, image and javascript > links, are all broken. Second all the generated links are to > /controller/action instead of to docserver/controller/action. > > I tried putting RAILS_RELATIVE_URL_ROOT="/docserver/" in enviornment.rb, but > that didn't help. I haven't done it, but seems my memory is there is a --prefix option to mongrel that you need to set as well... Check the mongrel site to see if there any docs on this... From runner at berkeley.edu Thu Nov 30 19:01:12 2006 From: runner at berkeley.edu (Steven Hansen) Date: Thu, 30 Nov 2006 16:01:12 -0800 Subject: [Mongrel] Sharing Mongrel Log Files on SAN Storage In-Reply-To: References: <456F24BF.7000408@berkeley.edu> Message-ID: <456F70C8.7050909@berkeley.edu> Ezra Zygmuntowicz wrote: > On Nov 30, 2006, at 10:36 AM, Steven Hansen wrote: > > >> Hi, >> >> My department has a SAN and I'm wondering if it is safe to have all of >> my mongrel's share log files stored on the SAN. >> >> More specifically, we have 4 machines, each running a couple of >> mongrel >> processes. Right now each machine has its own set of log files for >> mongrel. However, I am thinking that it might be better to put the >> log >> files on the SAN and let all the mongrels on all the different >> machines >> share 1 set of log files. I'd be interested to gets some feedback >> from >> other mongrelians on whether this is a good idea or a bad idea and >> why. >> >> Thanks, >> Steven >> >> > > Hey Steven- > > What filesystem re you using n the SAN? We have many Xen nodes > running rails apps that share a GFS filesystem partition off the SAN. > With GFS you can make hostname specific symlinks so that even though > the nodes of the cluster are all still writing their logs to logs/ > production.log, each node is actually writing to a symlink based on > hostname. > > Let me illustrate. Say we have 2 Xen instances for one rails app. > They both share a GFS partition mounted off the SAN at /data. So > anything under /data is shared between these nodes. With a capistrano > setup you make sure to deploy yoru apps to the /data partition. So to > setup the hostname logging on both slices you woudl log into each one > and run the following commands: > > app is here: > /data/railsapp/current > > logs are here: > /data/railsapp/shared/log > > We want both nodes to have their own log files but still have them > both be writing to the same log file path. So we make hostname > symlinks like this: > > $ cd /data/railsapp/shared > $ rm -rf log > $ mkdir `hostname` > $ ln -s @hostname log > > You do that on all nodes that share the same /data partition. This > gives a very dramatic increase in performance over all nodes writing > to the same log file. Getting a file lock on shared storage is more > troublesome then on non shared storage. So with multiple nodes all > writing to the same log file, each node has to get a lock before it > can write and other nodes wait their turn for the lock. Using this > @hostname trick, each node has its own log file that no other nodes > write to. But you don't have to change the way rails or capistrano > sets up the log files. Each node writes its logs to /data/railsapp/ > shared/log/production.log, but in reality they are all writing to a > symlink to a directory with the same name as the nodes hostname. > > We tried NFS and a few other filesystems and they all sucked. We > ended up using the red hat clustering suite. But even though its a > red hat suite it runs on any linux, we use it with gentoo. It > includes GFS and the cluster fencing stuff that allows nodes to > dynamically fence off any other nodes that are misbehaving. GFS works > really well for shared storage off a SAN. > > I would definitely recommend not having all your nodes write their > logs to the same file on the SAN. See if you can find a way to do > like GFS does or as a last resort you may have to do some hacking to > get rails to write its log files with the pid or some other unique > identifier so that each node writes to its own log files. Doing this > gave us a whopping 25% better performance when compared with all > nodes sharing the same log file. > > > Cheers- > > -- Ezra Zygmuntowicz > -- Lead Rails Evangelist > -- ez at engineyard.com > -- Engine Yard, Serious Rails Hosting > -- (866) 518-YARD (9273) > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > Ezra and Zed, Thanks for responding. I feel a little foolish for even asking the question now, better safe than sorry though :-P I guess originally I was thinking that if I wanted to check logs for traffic or something, then having it all in one log would be easier. But as Zed pointed out, this would make tracking down problems with an offending mongrel instance, much more difficult. Not to mention that the issue with more mongrel threads fighting for the lock on the log files. Anyway, I'm not sure what type of file system we are using as I really don't have much contact with the guys who are in charge of our machines. Their setup seems similar to yours, Ezra. When I ssh to a machine, I end up on 1 of (n) machines. My entire account's file system--except a few directories--is stored on the SAN (at least this is how I understand it). The non SAN directories are symbolic links to the specific machine that I'm logged on to. So in my situation the directory /apps/local/#{account_name} will always point to the directory of a specific machine. I think I'll be ok and have no problem giving each mongrel access to logs on its specific machine. In case, you're interested, below is an overly detailed diagram of the setup. Thanks so much! -Steven '%' means filesystem is local to current machine, all other directories are on the SAN |--apps % | |--users | + | |--#{account_name} | | + | | |--bin | | |--rails | | | + | | | |--#{app_name} | | | | + | | | | |--current -> /users/#{account_name}/rails/#{app_name}/releases/rel_x | | | | | + | | | | | |--app | | | | | |--config | | | | | |--db | | | | | |--doc | | | | | |--lib | | | | | |--log -> /apps/local/#{account_name}/mongrel/log | | | | | |--public | | | | | |--script | | | | | |--test | | | | | |--tmp | | | | | | + | | | | | | |--pids -> /apps/local/#{account_name}/mongrel/pids % | | | | | | | | | | | |--vendor | | | | | | | | | |--releases | | | | | + | | | | | |--rel_1 | | | | | |--rel_2 | | | | | |--rel_3 | | | | | | | | | | |--apache2 | | | + | | | |--conf | | | |--lib | | | |--libexec -> /opt/csw/apache2/libexec % | | | |--logs -> /apps/local/#{account_name}/apache2/logs % | | | |--bin -> /opt/csw/apache2/bin % | | | | | |--include | | |--var | | |--local -> /apps/local/#{account_name} % | | | + | | | |--apache2 % | | | | + | | | | |--logs % | | | | |--tmp % | | | | | | | |--mongrel % | | | | + | | | | |--log % | | | | |--pids % | | | | From jgeiger at gmail.com Thu Nov 30 20:03:31 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Thu, 30 Nov 2006 19:03:31 -0600 Subject: [Mongrel] mongrel served from a subdirectory In-Reply-To: <20061130175545.P21812@bravo.pjkh.com> References: <2ef9bb620611301539t62b9bea0y80326fcf6abe7fb@mail.gmail.com> <20061130175545.P21812@bravo.pjkh.com> Message-ID: <466af3440611301703l400ace0fm20ee56f7183c0ef3@mail.gmail.com> You need to add the prefix to the end of the proxypasses. Also you need to start your mongrels with the prefix option as previously mentioned. This does have the effect of breaking the rails css/javascript/image helpers. I had to rewrite them, but my situation was a bit more complicated. ProxyPass /docserver/ http://example.com:3001/docserver ProxyPassReverse /docserver/ http://example.com:3001/docserver On 11/30/06, Philip Hallstrom wrote: > > Hello, > > I have setup mongrel successfully a few times now, but, each time I have > > used apaceh 2.2 and mod_proxy setup descibed on the mongrel site. > > However, I need to set up another app in a subdomain. example.com/docserver > > instead of docserver.example.com. > > I have tried just adding I have something like: > > > > ProxyPass /docserver/ http://example.com:3001/ > > ProxyPassReverse /docserver/ http://example.com:3001 > > ProxyPreserveHost on > > > > The problem seems to be two fold. First, the css, image and javascript > > links, are all broken. Second all the generated links are to > > /controller/action instead of to docserver/controller/action. > > > > I tried putting RAILS_RELATIVE_URL_ROOT="/docserver/" in enviornment.rb, but > > that didn't help. > > I haven't done it, but seems my memory is there is a --prefix option to > mongrel that you need to set as well... > > Check the mongrel site to see if there any docs on this... > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From jgeiger at gmail.com Thu Nov 30 20:14:17 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Thu, 30 Nov 2006 19:14:17 -0600 Subject: [Mongrel] Mongrel 0.3.18, rails 1.1.6 and cookies Message-ID: <466af3440611301714h70aa0524l60073df22ae815f8@mail.gmail.com> I've run into an issue with my rails application being unable to properly set cookies on Mongrel 0.3.18. If I run the simplified code below in Mongrel 3.14.4, both cookies are properly sent to and saved by the browser. With the same code in 0.3.18, only the auth_token cookie is created (if I switch them, only the userid as it will only properly create the first cookie in the list.) I'm at home right now, but when I get back into work tomorrow, I'll try to install 0.3.15 and see if the problem exists there as well. Thanks. def login cookies[:auth_token] = { :value => "auth", :expires => 10.years.from_now.utc } cookies[:userid] = { :value => "100", :expires => 10.years.from_now.utc } end From rmdf at stimble.net Thu Nov 30 20:57:54 2006 From: rmdf at stimble.net (Michael Fairchild) Date: Thu, 30 Nov 2006 17:57:54 -0800 Subject: [Mongrel] mongrel served from a subdirectory In-Reply-To: <20061130175545.P21812@bravo.pjkh.com> References: <2ef9bb620611301539t62b9bea0y80326fcf6abe7fb@mail.gmail.com> <20061130175545.P21812@bravo.pjkh.com> Message-ID: <2ef9bb620611301757j20a5fcd1k2d6f1a008e87b4ff@mail.gmail.com> Thanks for that Philip. I missed that option. I tried starting up with that, but --prefix=/docserver and leaving the apache stuff the same. When i did that i couldn't even get any of it. I think there might be something i need to set in enviornment.rb, but im not sure. I'll keep trying. ~michael On 11/30/06, Philip Hallstrom wrote: > > > Hello, > > I have setup mongrel successfully a few times now, but, each time I have > > used apaceh 2.2 and mod_proxy setup descibed on the mongrel site. > > However, I need to set up another app in a subdomain. > example.com/docserver > > instead of docserver.example.com. > > I have tried just adding I have something like: > > > > ProxyPass /docserver/ http://example.com:3001/ > > ProxyPassReverse /docserver/ http://example.com:3001 > > ProxyPreserveHost on > > > > The problem seems to be two fold. First, the css, image and javascript > > links, are all broken. Second all the generated links are to > > /controller/action instead of to docserver/controller/action. > > > > I tried putting RAILS_RELATIVE_URL_ROOT="/docserver/" in enviornment.rb, > but > > that didn't help. > > I haven't done it, but seems my memory is there is a --prefix option to > mongrel that you need to set as well... > > Check the mongrel site to see if there any docs on this... > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061130/47f1c1db/attachment-0001.html From jgeiger at gmail.com Thu Nov 30 22:14:41 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Thu, 30 Nov 2006 21:14:41 -0600 Subject: [Mongrel] Sharing Mongrel Log Files on SAN Storage In-Reply-To: <20061130150104.3e00aed1.zedshaw@zedshaw.com> References: <456F24BF.7000408@berkeley.edu> <20061130150104.3e00aed1.zedshaw@zedshaw.com> Message-ID: <466af3440611301914o850b0aeha03b642d05a3dacc@mail.gmail.com> Are you suggesting that you have a separate mongrel.8001.log, mongrel.8002.log like the pids files or is there a way to somehow log like production-8001.log, production-8002.log through a mongrel setting? Having separate log files for the mongrel.log seems like overkill to me, since when my app is running, it's not generating very many entries there... If you can create rails production logs named with the pid, could someone point me in a direction on how to set that up? Thanks. > I should probably just make this the norm, but I advocate that people setup pid and log files separate for each port they have, and probable each machine:port combination. This makes it easier to isolate one mongrel's stuff and to track what is happening to a particular instance. > > If you do this it also means you can share it all you like. From curtis.hatter at insightbb.com Thu Nov 30 23:37:10 2006 From: curtis.hatter at insightbb.com (Curtis Hatter) Date: Thu, 30 Nov 2006 23:37:10 -0500 Subject: [Mongrel] deploying mongrel with capistrano Message-ID: <200611302337.10389.curtis.hatter@insightbb.com> I'm wondering if anyone has built a Capistrano task that will deploy mongrel either standalone or along with a rails app. I've been looking at possibilities for doing this but still new to using both having switched from using FCGI+Lighty and deploying by hand. Thanks, Curtis