From david at vrensk.com Sun Oct 1 14:56:31 2006 From: david at vrensk.com (David Vrensk) Date: Sun, 1 Oct 2006 20:56:31 +0200 Subject: [Mongrel] Log rotation Message-ID: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> Hi mongrel-herders, I'm just wondering what fellow railsers use to rotate their logs in an orderly fashion? I'd like to do something lightweight, i.e. (1) rename the logfile (2, optional) create a new empty logfile and (3) send a signal to each mongrel in the cluster and have them understand it's time to reopen their log file handles. This is what I do with apache and nginx and loads of other apps. Although the question is simple as stated, let me elaborate a little to avoid having the discussion going the wrong way (rein it in, as it were): 1. I'm really only concerned about production.log, since that is the big file. A solution that lets me rotate mongrel.log too is fine, but not necessary. 2. I know I can send a SIGUSR2 to each mongrel (or do a mongrel_cluster restart) to restart mongrel, but I'm running on a low-end machine which takes no less than 30 seconds to start rails, so I'd rather avoid the overhead. And even if it didn't, I think most of us agree that there's no real point in stopping out app even for a second just to reopen a file handle. 3. I realise that mongrel isn't rails-bound, so it might not be mongrel's responsibility to make rails switch log files. In that case, please point me in another direction and I'll see what I find. 4. I see that I can send a SIGHUP to mongrel which might make it do the right thing, but the caveat "(Internal reload) that might not work so well." is all but encouraging. Seeing as I've come this far, perhaps I should take a step back and ask: what do fellow mongrel_railsers use for logging? Logger? Log4R? Something else entirely? And what made you decide on the solution you use? Hope you haven't choked on my ramblings, and I look forward to your collective wisdom! /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061001/9230320f/attachment.html From jacob at jacobatzen.dk Sun Oct 1 15:38:12 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Sun, 1 Oct 2006 21:38:12 +0200 Subject: [Mongrel] Mongrel woes fixed Message-ID: <20061001193811.GA5663@nezbo.dhcp.aub.dk> Hello all, For the past couple of weeks I have been spending some time debugging a couple of issues I was having with Mongrel when I put load on it. I have seen two distinct issues: 1. Mongrel stopped responding as if in an endless loop. 2. Mongrel crashed when severely loaded. I believe to have resolved these two issues and have attached patches which shows the resolution (simple as it is). Explanation of the patches is given below. The first problem is handled by the patch to sync.rb from the standard library. What is happening here is that when sync_unlock is called Thread.critical is set to true. Now if the thread is not the sync_ex_locker an exception is thrown without Thread.critical being set to false. This in turn resulted in a situation where the mongrel_sleeper_thread (configurator.rb:270) was the only thread getting back on the cpu and Thread.critical stayed true. The patch simply ensures that Thread.critical is set to false upon leaving sync.rb. I am not sure if this is really the correct way to handle this issue though. As some famous programmers have been known to say "select() ain't broken" so I'm not really sure what to think of this. The second problem stems from the fact that Mongrel uses the Thread#abort_on_exception. I'm not sure why this is even in there, as the documentation says: When set to true, causes all threads (including the main program) to abort if an exception is raised in thr. The process will effectively exit(0). The patch simply removes the abort_on_exception from mongrel.rb. After applying this patch I have been unable to make Mongrel crash. Finally I have provided a debug patch for the Sync library which simply adds a lot of debug output to STDERR. I believe it might be of use in future performance optimizations as there seems to be happening a lot of work managing the queued up clients. -- Cheers, - Jacob Atzen -------------- next part -------------- Index: lib/mongrel.rb =================================================================== --- lib/mongrel.rb (revision 353) +++ lib/mongrel.rb (working copy) @@ -687,7 +687,6 @@ reap_dead_workers("max processors") else thread = Thread.new(client) {|c| process_client(c) } - thread.abort_on_exception = true thread[:started_on] = Time.now @workers.add(thread) -------------- next part -------------- --- sync.rb Sun Oct 1 21:02:28 2006 +++ sync.new.rb Sun Oct 1 21:05:28 2006 @@ -131,8 +131,10 @@ def sync_try_lock(mode = EX) return unlock if sync_mode == UN + print_critical("sync_try_lock", "1", "true") Thread.critical = true ret = sync_try_lock_sub(sync_mode) + print_critical("sync_try_lock", "2", "false") Thread.critical = false ret end @@ -140,22 +142,27 @@ def sync_lock(m = EX) return unlock if m == UN - until (Thread.critical = true; sync_try_lock_sub(m)) + until (print_critical("sync_lock", "1", "true"); Thread.critical = true; sync_try_lock_sub(m)) if sync_sh_locker[Thread.current] sync_upgrade_waiting.push [Thread.current, sync_sh_locker[Thread.current]] sync_sh_locker.delete(Thread.current) else + STDERR.print "[sync_lock:2] Pushing #{Thread.current.inspect} behind #{sync_waiting.size} others\n" sync_waiting.push Thread.current end + print_critical("sync_lock", "3", "false") Thread.stop end + print_critical("sync_lock", "4", "false") Thread.critical = false self end def sync_unlock(m = EX) + print_critical("sync_unlock", "1", "true") Thread.critical = true if sync_mode == UN + print_critical("sync_unlock", "2", "false") Thread.critical = false Err::UnknownLocker.Fail(Thread.current) end @@ -165,6 +172,7 @@ runnable = false case m when UN + print_critical("sync_unlock", "3", "false") Thread.critical = false Err::UnknownLocker.Fail(Thread.current) @@ -173,13 +181,17 @@ if (self.sync_ex_count = sync_ex_count - 1) == 0 self.sync_ex_locker = nil if sync_sh_locker.include?(Thread.current) + STDERR.print "[sync_unlock] Setting sync_mode = SH\n" self.sync_mode = SH else + STDERR.print "[sync_unlock] Setting sync_mode = UN\n" self.sync_mode = UN end runnable = true end else + # Patching criticalities when exceptions are thrown + print_critical("sync_unlock", "4", "false") Thread.critical = false Err::UnknownLocker.Fail(Thread.current) end @@ -191,6 +203,7 @@ if (sync_sh_locker[Thread.current] = count - 1) == 0 sync_sh_locker.delete(Thread.current) if sync_sh_locker.empty? and sync_ex_count == 0 + STDERR.print "[sync_unlock] Setting sync_mode = UN\n" self.sync_mode = UN runnable = true end @@ -205,6 +218,11 @@ end wait = sync_upgrade_waiting self.sync_upgrade_waiting = [] + for w, v in wait + STDERR.print "[sync_unlock:5] Starting thread #{w.inspect}\n" + end + + print_critical("sync_unlock", "6", "false") Thread.critical = false for w, v in wait @@ -213,22 +231,31 @@ else wait = sync_waiting self.sync_waiting = [] + print_critical("sync_unlock", "7", "false") Thread.critical = false for w in wait + STDERR.print "[sync_unlock:8] Running #{w.inspect}\n" w.run end end end - + print_critical("sync_unlock", "9", "false") Thread.critical = false self end + def print_critical(method, count, bool) + STDERR.print "[#{method}:#{count}] Thread.critical = #{bool} #{Thread.current.inspect}\n" + end + def sync_synchronize(mode = EX) begin + STDERR.print "[sync_synchronize] Getting lock #{Thread.current.inspect}\n" sync_lock(mode) + STDERR.print "[sync_synchronize] Yielding #{Thread.current.inspect}\n" yield ensure + STDERR.print "[sync_synchronize] Unlocking #{Thread.current.inspect}\n" sync_unlock end end @@ -292,6 +319,7 @@ ret = false end else + print_critical("sync_try_lock_sub", "1", "false") Thread.critical = false Err::LockModeFailer.Fail mode end -------------- next part -------------- --- sync.orig.rb Sun Oct 1 20:57:39 2006 +++ sync.rb Sun Oct 1 21:02:28 2006 @@ -180,6 +180,7 @@ runnable = true end else + Thread.critical = false Err::UnknownLocker.Fail(Thread.current) end From zedshaw at zedshaw.com Sun Oct 1 19:39:07 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 1 Oct 2006 16:39:07 -0700 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <20061001193811.GA5663@nezbo.dhcp.aub.dk> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> Message-ID: <20061001163907.56f82b90.zedshaw@zedshaw.com> On Sun, 1 Oct 2006 21:38:12 +0200 Jacob Atzen wrote: > Hello all, > > For the past couple of weeks I have been spending some time debugging a > couple of issues I was having with Mongrel when I put load on it. I have > seen two distinct issues: > > 1. Mongrel stopped responding as if in an endless loop. > 2. Mongrel crashed when severely loaded. > Cool, glad you took the time to figure this out. > I believe to have resolved these two issues and have attached patches > which shows the resolution (simple as it is). Explanation of the patches > is given below. > > The first problem is handled by the patch to sync.rb from the standard > library. What is happening here is that when sync_unlock is called > Thread.critical is set to true. Now if the thread is not the > sync_ex_locker an exception is thrown without Thread.critical being set > to false. This in turn resulted in a situation where the > mongrel_sleeper_thread (configurator.rb:270) was the only thread getting > back on the cpu and Thread.critical stayed true. The patch simply > ensures that Thread.critical is set to false upon leaving sync.rb. > Ok, is there a way to fix this without having people backpatch their ruby? Also, why were you the only one having this problem? I'd like to know how the error is caused if you could explain it. > I am not sure if this is really the correct way to handle this issue > though. As some famous programmers have been known to say "select() > ain't broken" so I'm not really sure what to think of this. > Interesting side note is that when you mix threads and select in ruby then the interpreter can randomly decide it's in deadlock without much explanation. Damned if you do, also if you don't. > The second problem stems from the fact that Mongrel uses the > Thread#abort_on_exception. I'm not sure why this is even in there, as > the documentation says: > > When set to true, causes all threads (including the main > program) to abort if an exception is raised in thr. The process > will effectively exit(0). > > The patch simply removes the abort_on_exception from mongrel.rb. After > applying this patch I have been unable to make Mongrel crash. > The abort was put in there to catch exceptions that are "leaking" through and not being caught. I'm curious what exception was being thrown that *none* of the damn begin/rescue blocks catches. We seriously need a begin/rescue-every-damn-thing-no-matter-what construct that actually works. Now, I believe the problem you'll have is when this exception leaks through that thread will become dead and eventually you'll fill up and Mongrel will die anyway. If you can, try to find out what exception causes this so I can have the server kill off its threads properly by handling this yet another annoying random exception. > Finally I have provided a debug patch for the Sync library which simply > adds a lot of debug output to STDERR. I believe it might be of use in > future performance optimizations as there seems to be happening a lot of > work managing the queued up clients. This might not be needed as the ruby-core guys finally started taking a serious look at how array works and we can probably switch back to Mutex in the near future. Thanks again Jacob, if you can answer the questions I had so I can work on a fix that doesn't involve updating ruby. Also an explanation as to why you were having these problems will help people decide if they should apply the patches too. -- 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 matt at eastmedia.com Sun Oct 1 22:58:43 2006 From: matt at eastmedia.com (Matt Pelletier) Date: Sun, 1 Oct 2006 22:58:43 -0400 Subject: [Mongrel] Expert feedback needed In-Reply-To: <2f3066870609261203r7630c552p9ab8a1724a79527a@mail.gmail.com> References: <2f3066870609261203r7630c552p9ab8a1724a79527a@mail.gmail.com> Message-ID: <4554DF21-ABAC-469B-85AB-42063FF5DE9A@eastmedia.com> Hi 13 On Sep 26, 2006, at 3:03 PM, 13 wrote: > Hello list, > > Some time ago I was looking for apache (as non balanced proxy) + > mongrel configurations. Almost everybody seemed to use similar > approaches (one of these could be found @ mongrel.rubygorge.org docs) > with mod_rewrite. I don't use proxy_balancer because I don't need it > at the moment (my site has pretty low traffic). This is apache > configuration that I'm using at the moment. It's tested as Zed > suggested (mr start -e production -B) and it looks like all static > files are served by apache and dynamic ones be mongrel. Here is my > apache config: > > > ServerName myapp.tld > ServerAlias www.myapp.tld > > DocumentRoot /var/www/sites/myapp/current/public > > > Options FollowSymLinks > AllowOverride None > Order allow,deny > Allow from all > > > RewriteEngine On > > # Check for maintenance file. Let apache load it if it exists > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > RewriteRule . /system/maintenance.html [L] > > # Let apache serve static files > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f > RewriteRule (.*) $1 [L] > > # Don't do forward proxying > ProxyRequests Off > > # Enable reverse proxying > > Order deny,allow > Allow from all > > > # Pass other requests to mongrel instance > ProxyPass / http://127.0.0.1:8200/ > ProxyPassReverse / http://127.0.0.1:8200/ > > > > It would be great if some expert could take a look at my config and > point me at my mistakes etc ! I am asking this because it looks like > it just works, and it makes me think that it can't be so easy :) > Based on the above rules, Apache will only try to find files that match the request URI, as it is given. This will indeed work for images, SWFs, JS, CSS, and any HTML requested directly. However if you are doing something like Rails' page caching, and want to serve cached HTML, you will need extra rules to rewrite the URI and have Apache check for that (e.g. if the URI is '/articles/' then look for '/articles/index.html' on the file system, if that doesn't exist then forward the original URI to Rails). You can determine which server is serving the files by using curl -I (capital I as in India) (Hello Apache) $ curl -I http://somedomain.com/static/file/url/ HTTP/1.1 200 OK Date: Mon, 11 Sep 2006 23:13:05 GMT Server: Apache/2.2.3 (Unix) Last-Modified: Sun, 10 Sep 2006 18:21:52 GMT ETag: "21ac8f5-9d0a-83f57000" Accept-Ranges: bytes Content-Length: 40202 Vary: Accept-Encoding Connection: close Content-Type: text/html (Hello Mongrel) $ curl -I http://somedomain.com/go_to/rails/ HTTP/1.1 200 OK Date: Mon, 11 Sep 2006 23:13:10 GMT Server: Mongrel 0.3.13.4 Status: 200 OK Cache-Control: no-cache Content-Type: text/html; charset=utf-8 Vary: Accept-Encoding Connection: close > Thanks, > Martins > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > =================== Matt Pelletier EastMedia t. 212-967-4239 f. 212-967-4257 m. 917-902-2525 w. www.eastmedia.com From one.three at gmail.com Mon Oct 2 02:46:12 2006 From: one.three at gmail.com (13) Date: Mon, 2 Oct 2006 09:46:12 +0300 Subject: [Mongrel] Expert feedback needed In-Reply-To: <4554DF21-ABAC-469B-85AB-42063FF5DE9A@eastmedia.com> References: <2f3066870609261203r7630c552p9ab8a1724a79527a@mail.gmail.com> <4554DF21-ABAC-469B-85AB-42063FF5DE9A@eastmedia.com> Message-ID: <2f3066870610012346u41cf1543tcb5990cc3d58a10f@mail.gmail.com> Hi, Thanks for your tip Matt. I have intentionally left out rewrite rules for Rails cached pages simply beacause I don't use them on my page. My goal was to create fast and as simple as it can be config - no cluster, no caching, no defalate ... My full name is Martins Grunskis. -- Martins On 10/2/06, Matt Pelletier wrote: > Hi 13 > > On Sep 26, 2006, at 3:03 PM, 13 wrote: > > > Hello list, > > > > Some time ago I was looking for apache (as non balanced proxy) + > > mongrel configurations. Almost everybody seemed to use similar > > approaches (one of these could be found @ mongrel.rubygorge.org docs) > > with mod_rewrite. I don't use proxy_balancer because I don't need it > > at the moment (my site has pretty low traffic). This is apache > > configuration that I'm using at the moment. It's tested as Zed > > suggested (mr start -e production -B) and it looks like all static > > files are served by apache and dynamic ones be mongrel. Here is my > > apache config: > > > > > > ServerName myapp.tld > > ServerAlias www.myapp.tld > > > > DocumentRoot /var/www/sites/myapp/current/public > > > > > > Options FollowSymLinks > > AllowOverride None > > Order allow,deny > > Allow from all > > > > > > RewriteEngine On > > > > # Check for maintenance file. Let apache load it if it exists > > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > > RewriteRule . /system/maintenance.html [L] > > > > # Let apache serve static files > > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f > > RewriteRule (.*) $1 [L] > > > > # Don't do forward proxying > > ProxyRequests Off > > > > # Enable reverse proxying > > > > Order deny,allow > > Allow from all > > > > > > # Pass other requests to mongrel instance > > ProxyPass / http://127.0.0.1:8200/ > > ProxyPassReverse / http://127.0.0.1:8200/ > > > > > > > > It would be great if some expert could take a look at my config and > > point me at my mistakes etc ! I am asking this because it looks like > > it just works, and it makes me think that it can't be so easy :) > > > > Based on the above rules, Apache will only try to find files that > match the request URI, as it is given. This will indeed work for > images, SWFs, JS, CSS, and any HTML requested directly. However if > you are doing something like Rails' page caching, and want to serve > cached HTML, you will need extra rules to rewrite the URI and have > Apache check for that (e.g. if the URI is '/articles/' then look for > '/articles/index.html' on the file system, if that doesn't exist then > forward the original URI to Rails). > > You can determine which server is serving the files by using curl -I > (capital I as in India) > > (Hello Apache) > $ curl -I http://somedomain.com/static/file/url/ > HTTP/1.1 200 OK > Date: Mon, 11 Sep 2006 23:13:05 GMT > Server: Apache/2.2.3 (Unix) > Last-Modified: Sun, 10 Sep 2006 18:21:52 GMT > ETag: "21ac8f5-9d0a-83f57000" > Accept-Ranges: bytes > Content-Length: 40202 > Vary: Accept-Encoding > Connection: close > Content-Type: text/html > > (Hello Mongrel) > $ curl -I http://somedomain.com/go_to/rails/ > HTTP/1.1 200 OK > Date: Mon, 11 Sep 2006 23:13:10 GMT > Server: Mongrel 0.3.13.4 > Status: 200 OK > Cache-Control: no-cache > Content-Type: text/html; charset=utf-8 > Vary: Accept-Encoding > Connection: close > > > > Thanks, > > Martins > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > =================== > Matt Pelletier > EastMedia > t. 212-967-4239 > f. 212-967-4257 > m. 917-902-2525 > w. www.eastmedia.com > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From kraemer at webit.de Mon Oct 2 04:52:53 2006 From: kraemer at webit.de (Jens Kraemer) Date: Mon, 2 Oct 2006 10:52:53 +0200 Subject: [Mongrel] Expert feedback needed In-Reply-To: <2f3066870610012346u41cf1543tcb5990cc3d58a10f@mail.gmail.com> References: <2f3066870609261203r7630c552p9ab8a1724a79527a@mail.gmail.com> <4554DF21-ABAC-469B-85AB-42063FF5DE9A@eastmedia.com> <2f3066870610012346u41cf1543tcb5990cc3d58a10f@mail.gmail.com> Message-ID: <20061002085253.GA11602@cordoba.webit.de> Hi! On Mon, Oct 02, 2006 at 09:46:12AM +0300, 13 wrote: [..] > > > RewriteEngine On > > > > > > # Check for maintenance file. Let apache load it if it exists > > > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > > > RewriteRule . /system/maintenance.html [L] > > > > > > # Let apache serve static files > > > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f > > > RewriteRule (.*) $1 [L] > > > > > > # Don't do forward proxying > > > ProxyRequests Off > > > > > > # Enable reverse proxying > > > > > > Order deny,allow > > > Allow from all > > > > > > > > > # Pass other requests to mongrel instance > > > ProxyPass / http://127.0.0.1:8200/ > > > ProxyPassReverse / http://127.0.0.1:8200/ Are you sure this setup serves static files via Apache? Imho the ProxyPass directives should be executed regardless of the outcome of your rewriting, forwarding all requests to mongrel. I usually use the rewriting the other way around, without any ProxyPass directives: # Don't do forward proxying ProxyRequests Off # Enable reverse proxying Order deny,allow Allow from all RewriteEngine On # Check for maintenance file. Let apache load it if it exists RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteRule . /system/maintenance.html [L] # Rewrite index to check for static RewriteRule ^/$ /index.html [QSA] # Let apache serve static files (send everything via mod_proxy that # is *no* static file (!-f) RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteRule .* http://127.0.0.1:8200%{REQUEST_URI} [L,P,QSA] the P option to the last rule replaces the ProxyPass and ProxyPassReverse directives. 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 one.three at gmail.com Mon Oct 2 07:22:29 2006 From: one.three at gmail.com (13) Date: Mon, 2 Oct 2006 14:22:29 +0300 Subject: [Mongrel] Expert feedback needed In-Reply-To: <20061002085253.GA11602@cordoba.webit.de> References: <2f3066870609261203r7630c552p9ab8a1724a79527a@mail.gmail.com> <4554DF21-ABAC-469B-85AB-42063FF5DE9A@eastmedia.com> <2f3066870610012346u41cf1543tcb5990cc3d58a10f@mail.gmail.com> <20061002085253.GA11602@cordoba.webit.de> Message-ID: <2f3066870610020422u180b8ff7n80c074d49eb57386@mail.gmail.com> Hi Jens, Yes I am sure that static files are served by apache. I have checked it using both mongrel debug mode and curl. I'm not sure why would I need to forward requests, for files that apache can serve, to mongrel so I will stay with my configuration until someone proves me wrong. As I said before I'm not an apache expert, but your last rule looks like misuse of mod_rewrite. Isn't it like that last rewrite rule does what ProxyPass + ProxyPassReverse are supposed to do ? -- Martins On 10/2/06, Jens Kraemer wrote: > Hi! > > On Mon, Oct 02, 2006 at 09:46:12AM +0300, 13 wrote: > [..] > > > > RewriteEngine On > > > > > > > > # Check for maintenance file. Let apache load it if it exists > > > > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > > > > RewriteRule . /system/maintenance.html [L] > > > > > > > > # Let apache serve static files > > > > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f > > > > RewriteRule (.*) $1 [L] > > > > > > > > # Don't do forward proxying > > > > ProxyRequests Off > > > > > > > > # Enable reverse proxying > > > > > > > > Order deny,allow > > > > Allow from all > > > > > > > > > > > > # Pass other requests to mongrel instance > > > > ProxyPass / http://127.0.0.1:8200/ > > > > ProxyPassReverse / http://127.0.0.1:8200/ > > Are you sure this setup serves static files via Apache? Imho the > ProxyPass directives should be executed regardless of the outcome of > your rewriting, forwarding all requests to mongrel. > > I usually use the rewriting the other way around, without any ProxyPass > directives: > > # Don't do forward proxying > ProxyRequests Off > > # Enable reverse proxying > > Order deny,allow > Allow from all > > > RewriteEngine On > > # Check for maintenance file. Let apache load it if it exists > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > RewriteRule . /system/maintenance.html [L] > > # Rewrite index to check for static > RewriteRule ^/$ /index.html [QSA] > > # Let apache serve static files (send everything via mod_proxy that > # is *no* static file (!-f) > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f > RewriteRule .* http://127.0.0.1:8200%{REQUEST_URI} [L,P,QSA] > > > the P option to the last rule replaces the ProxyPass and > ProxyPassReverse directives. > > 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 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From thibaut.barrere at gmail.com Mon Oct 2 07:40:41 2006 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Mon, 2 Oct 2006 13:40:41 +0200 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? Message-ID: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> Hi! I've been using parallels, vmware player, or virtual pc (did not try xen yet) for development, testing and experimenting with new platforms (and I must say I love them - copy paste a few files, and I have a clean deployment box etc) Since the RailsConf and various talks I've seen (like Jason Hoffmann's http://svn.joyent.com/public/JasonHoffman-EuroRailsConf.pdf , or James Duncan Davidson), I'm willing to apply the benefits to production. is there anyone here actually using virtualization techniques in production ? (even for single machine setups?) any feedback would be most welcome! thanks! Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061002/d430924e/attachment.html From SClark at pellahealth.org Mon Oct 2 10:09:05 2006 From: SClark at pellahealth.org (Sean Clark) Date: Mon, 2 Oct 2006 09:09:05 -0500 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? Message-ID: <6FF3C9BA6D6ED94183EDC346866D74DD035D5242@PRHC-MS1.pellahealth.org> Virtualization rocks! No problems in our production environment. I strongly suggest it for any website, unless you're hosting Google or Yahoo. We're using VMware's ESX 3.0 in production. I have 37 production VMs spread across 4 ESX3 hosts. We also have a SAN which allows us to VMotion (hot migrate) running VMs from server to server. Most of my VMs are Windows but I do have 3 linux VMs with CentOS 4.3 running pound and mongrel, as well as MySQL. Everything is running very well. If you don't have the cash for ESX 3, you might consider running VMware Server. VMWare Server is free, but the performance is less and you can't get as many VMs on a single box and no Vmotion :-(. The biggest benefit we see from the VMware is Disaster Recovery options available. I also love using the snapshot feature prior to major software upgrades. If the upgrade introduces major errors, you can then shutdown the VM, revert to the earlier snapshot. The one problem I had initially was with time keeping. The below link is what fixed my problems. KB Doc ID: 1420 is recommended reading for time sync issues with Linux guest on vmware. http://kb.vmware.com/vmtnkb/search.do?cmd=displayKC&docType=kc&externalId=1420&sliceId=SAL_Public In addition to instructions in the above KB document, I also needed to add a one line script to /etc/cron.hourly/, "ntpdate myntpserver.mydomain.com". This corrects the remaining 1-2 seconds that I'm ahead each hour. ________________________________ From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, October 02, 2006 6:41 AM To: mongrel-users at rubyforge.org Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? Hi! I've been using parallels, vmware player, or virtual pc (did not try xen yet) for development, testing and experimenting with new platforms (and I must say I love them - copy paste a few files, and I have a clean deployment box etc) Since the RailsConf and various talks I've seen (like Jason Hoffmann's http://svn.joyent.com/public/JasonHoffman-EuroRailsConf.pdf , or James Duncan Davidson), I'm willing to apply the benefits to production. is there anyone here actually using virtualization techniques in production ? (even for single machine setups?) any feedback would be most welcome! thanks! Thibaut Confidentiality Notice: This e-mail message, including any attachments, is for the use of the intended recipient(s), and may contain legally privileged and confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please do not read, copy, or use it, and do not disclose it to others. Please notify the sender of the delivery error by replying to this message, then delete it from your system, and destroy all copies. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061002/df810c06/attachment-0001.html From kraemer at webit.de Mon Oct 2 10:53:28 2006 From: kraemer at webit.de (Jens Kraemer) Date: Mon, 2 Oct 2006 16:53:28 +0200 Subject: [Mongrel] Expert feedback needed In-Reply-To: <2f3066870610020422u180b8ff7n80c074d49eb57386@mail.gmail.com> References: <2f3066870609261203r7630c552p9ab8a1724a79527a@mail.gmail.com> <4554DF21-ABAC-469B-85AB-42063FF5DE9A@eastmedia.com> <2f3066870610012346u41cf1543tcb5990cc3d58a10f@mail.gmail.com> <20061002085253.GA11602@cordoba.webit.de> <2f3066870610020422u180b8ff7n80c074d49eb57386@mail.gmail.com> Message-ID: <20061002145328.GA20473@cordoba.webit.de> On Mon, Oct 02, 2006 at 02:22:29PM +0300, 13 wrote: > Hi Jens, > > Yes I am sure that static files are served by apache. I have checked > it using both mongrel debug mode and curl. > > I'm not sure why would I need to forward requests, for files that > apache can serve, to mongrel so I will stay with my configuration > until someone proves me wrong. I did not say your config is wrong, just that it's hard to understand why it works from my limited understanding of apache's config. Seems like the [L] flag of your last rewrite rule prevents mod_proxy from following the ProxyPass / directive (which, standing for itself, simply says 'proxy everything to mongrel'). > > As I said before I'm not an apache expert, but your last rule looks > like misuse of mod_rewrite. Isn't it like that last rewrite rule does > what ProxyPass + ProxyPassReverse are supposed to do ? Yes, that was what I wanted to point out - that one line does what your Proxy* directives do. As the [P] flag is officially documented [1], I don't think it's use should be called misuse ;-) As your setup works, too, it seems to be more a question of personal preference... Jens [1] http://httpd.apache.org/docs/2.0/misc/rewriteguide.html, look for "Proxy Throughput feature" -- 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 ezmobius at gmail.com Mon Oct 2 14:10:02 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Mon, 2 Oct 2006 11:10:02 -0700 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> References: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> Message-ID: <1CD0FF9D-ED36-4547-A2D5-BB40983A9F48@brainspl.at> On Oct 2, 2006, at 4:40 AM, Thibaut Barr?re wrote: > Hi! > > I've been using parallels, vmware player, or virtual pc (did not > try xen yet) for development, testing and experimenting with new > platforms (and I must say I love them - copy paste a few files, and > I have a clean deployment box etc) > > Since the RailsConf and various talks I've seen (like Jason > Hoffmann's http://svn.joyent.com/public/JasonHoffman- > EuroRailsConf.pdf , or James Duncan Davidson), I'm willing to apply > the benefits to production. > > is there anyone here actually using virtualization techniques in > production ? (even for single machine setups?) > > any feedback would be most welcome! > > thanks! > > Thibaut Yeah now that I have been way into Xen, I wouldn't setup a new server without it. Even if you only have one server I would put Xen on it, even if its just one huge VM that fills the entire server. The performance overhead of Xen is about 5% compared to raw hardware which is really nothing compared to the gains you get by virtualizing. It makes it so much easier to scale later. Move your VM's from machine to machine. And separate concerns into their own VM's. Seriously I can't recommend it enough. We have built our entire new business on top of Xen. http://engineyard.com . Its only for ruby/ rails hosting and everything runs in Xen. Xen is very cool stuff. -Ezra From francisco at nortenet.pt Mon Oct 2 11:09:07 2006 From: francisco at nortenet.pt (Francisco Alves Cabrita) Date: Mon, 2 Oct 2006 16:09:07 +0100 Subject: [Mongrel] Mongrel cluster FreeBSD rc.d script Message-ID: <200610021609.10065.francisco@nortenet.pt> Hello all After installing Mongrel, Mongrel Cluster and all it's dependencies via gems under FreeBSD. Next I have configured all config/mongrel_cluster.yml for each Rails app, then: % mkdir /usr/local/etc/mongrel_cluster and likend each railsapp.yml to it's refering app/config/mongrel_cluster.yml My question is, after preparing all base configs now I need to add some rc.d script to the base system /usr/local/etc/rc.d/mongrel_cluster.sh or something else. I think mongrel is "shiped" only with an init,d script. Is there someone who have this issue too and have solved it?! Thanks in advance Francisco -- Violence in reality is quite different from theory. -- Spock, "The Cloud Minders", stardate 5818.4 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061002/913dba76/attachment.bin From jacob at jacobatzen.dk Mon Oct 2 17:39:58 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Mon, 2 Oct 2006 23:39:58 +0200 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <20061001163907.56f82b90.zedshaw@zedshaw.com> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> Message-ID: <20061002213958.GA51335@apoc.jacobatzen.dk> On Sun, Oct 01, 2006 at 04:39:07PM -0700, Zed A. Shaw wrote: > Ok, is there a way to fix this without having people backpatch their > ruby? Also, why were you the only one having this problem? I'd like > to know how the error is caused if you could explain it. I'm not sure about this. I'll investigate further and see what I can come up with. > > The second problem stems from the fact that Mongrel uses the > > Thread#abort_on_exception. I'm not sure why this is even in there, as > > the documentation says: > > > > When set to true, causes all threads (including the main > > program) to abort if an exception is raised in thr. The process > > will effectively exit(0). > > > > The patch simply removes the abort_on_exception from mongrel.rb. After > > applying this patch I have been unable to make Mongrel crash. > > > > The abort was put in there to catch exceptions that are "leaking" > through and not being caught. I'm curious what exception was being > thrown that *none* of the damn begin/rescue blocks catches. We > seriously need a begin/rescue-every-damn-thing-no-matter-what > construct that actually works. > > Now, I believe the problem you'll have is when this exception leaks > through that thread will become dead and eventually you'll fill up and > Mongrel will die anyway. If you can, try to find out what exception > causes this so I can have the server kill off its threads properly by > handling this yet another annoying random exception. I'm not sure this is really a problem. It seems that threads are killed of nicely anyhow. But I'll dig into it and report back on this one too. -- Cheers, - Jacob Atzen From luislavena at gmail.com Mon Oct 2 20:23:47 2006 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 2 Oct 2006 21:23:47 -0300 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: <1CD0FF9D-ED36-4547-A2D5-BB40983A9F48@brainspl.at> References: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> <1CD0FF9D-ED36-4547-A2D5-BB40983A9F48@brainspl.at> Message-ID: <71166b3b0610021723i20713033w3ea6daa08cc5827d@mail.gmail.com> On 10/2/06, Ezra Zygmuntowicz wrote: > > On Oct 2, 2006, at 4:40 AM, Thibaut Barr?re wrote: > > > Hi! > > > > I've been using parallels, vmware player, or virtual pc (did not > > try xen yet) for development, testing and experimenting with new > > platforms (and I must say I love them - copy paste a few files, and > > I have a clean deployment box etc) > > > > Since the RailsConf and various talks I've seen (like Jason > > Hoffmann's http://svn.joyent.com/public/JasonHoffman- > > EuroRailsConf.pdf , or James Duncan Davidson), I'm willing to apply > > the benefits to production. > > > > is there anyone here actually using virtualization techniques in > > production ? (even for single machine setups?) > > > > any feedback would be most welcome! > > > > thanks! > > > > Thibaut > > > Yeah now that I have been way into Xen, I wouldn't setup a new > server without it. Even if you only have one server I would put Xen > on it, even if its just one huge VM that fills the entire server. The > performance overhead of Xen is about 5% compared to raw hardware > which is really nothing compared to the gains you get by virtualizing. > > It makes it so much easier to scale later. Move your VM's from > machine to machine. And separate concerns into their own VM's. > Seriously I can't recommend it enough. We have built our entire new > business on top of Xen. http://engineyard.com . Its only for ruby/ > rails hosting and everything runs in Xen. Xen is very cool stuff. > > Ezra, one thing that still bug me is IP handling. If i have a live server and decide to do a hot migration to a newer box, how it manages, and how much downtime will get to the IP switches ges notified of the migration? (in ms resolution) Or i'm forced to have a load balancer that handle the problem for me? > -Ezra > _______________________________________________ > 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 lists at lastonepicked.com Mon Oct 2 21:56:04 2006 From: lists at lastonepicked.com (HH) Date: Mon, 02 Oct 2006 18:56:04 -0700 Subject: [Mongrel] Apache Re-Write and Directories Message-ID: Howdy, I am using the 'default' Apache 2.2 mod_rewrite rules suggested from the Web site and they are working. One thing related to static (non cluster directed) resources: If I have a directory in public called 'static', if I request it as follows: http://www.domain.com/static/ - then it works If I request it as: http://www.domain.com/static - then it does not work as it gets directed to the cluster. How can I change my rewrite rules to have both of the above URLs be served by the static resource via Apache, not by Mongrel? Rewrite rules: RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /maintenance.html [L] # Rewrite index to check for static index.html RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached pages with .html extentions RewriteRule ^([^.]+)$ $1.html [QSA] # All dynamic requests get sent to the cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI} [P,QSA,L] Thanks!!! Hunter From g.vishnu at gmail.com Tue Oct 3 01:46:49 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Tue, 3 Oct 2006 11:16:49 +0530 Subject: [Mongrel] Mongrel cluster FreeBSD rc.d script In-Reply-To: <200610021609.10065.francisco@nortenet.pt> References: <200610021609.10065.francisco@nortenet.pt> Message-ID: I use monit, and monit to start (and monitor) Mongrel. http://www.tildeslash.com/monit/ Vish On 10/2/06, Francisco Alves Cabrita wrote: > > Hello all > > After installing Mongrel, Mongrel Cluster and all it's dependencies via > gems > under FreeBSD. Next I have configured all config/mongrel_cluster.yml for > each > Rails app, then: > > % mkdir /usr/local/etc/mongrel_cluster > > and likend each railsapp.yml to it's refering > app/config/mongrel_cluster.yml > > My question is, after preparing all base configs now I need to add some > rc.d > script to the base system /usr/local/etc/rc.d/mongrel_cluster.sh or > something > else. I think mongrel is "shiped" only with an init,d script. > > Is there someone who have this issue too and have solved it?! > > Thanks in advance > Francisco > > -- > Violence in reality is quite different from theory. > -- Spock, "The Cloud Minders", stardate 5818.4 > > > _______________________________________________ > 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/20061003/c54e9864/attachment.html From one.three at gmail.com Tue Oct 3 02:19:03 2006 From: one.three at gmail.com (13) Date: Tue, 3 Oct 2006 09:19:03 +0300 Subject: [Mongrel] Apache Re-Write and Directories In-Reply-To: References: Message-ID: <2f3066870610022319g18db2ad0l942b20526ddb1477@mail.gmail.com> Hi, In your example what is meant by static (file, directory) ? -- Martins On 10/3/06, HH wrote: > Howdy, > > I am using the 'default' Apache 2.2 mod_rewrite rules suggested from the Web > site and they are working. > > One thing related to static (non cluster directed) resources: > > If I have a directory in public called 'static', if I request it as follows: > > http://www.domain.com/static/ - then it works > > If I request it as: > > http://www.domain.com/static - then it does not work as it gets directed to > the cluster. > > How can I change my rewrite rules to have both of the above URLs be served > by the static resource via Apache, not by Mongrel? > > Rewrite rules: > > RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f > RewriteCond %{SCRIPT_FILENAME} !maintenance.html > RewriteRule ^.*$ /maintenance.html [L] > # Rewrite index to check for static index.html > RewriteRule ^/$ /index.html [QSA] > # Rewrite to check for Rails cached pages with .html extentions > RewriteRule ^([^.]+)$ $1.html [QSA] > # All dynamic requests get sent to the cluster > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI} [P,QSA,L] > > Thanks!!! > > Hunter > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From massimo at zero.it Tue Oct 3 04:37:15 2006 From: massimo at zero.it (Massimo Santoli) Date: Tue, 03 Oct 2006 10:37:15 +0200 Subject: [Mongrel] mongrel.pid disappearing In-Reply-To: <45191E35.9020904@gmail.com> References: <45177C1F.9020909@zero.it> <20060925021901.007e7836.zedshaw@zedshaw.com> <4517FCCC.9040208@zero.it> <20060925164800.Y83564@bravo.pjkh.com> <4518D3B5.4090202@zero.it> <45191E35.9020904@gmail.com> Message-ID: <4522213B.2060706@zero.it> I finally solved the problem. I will recap for future memory: I have installed Ruby 1.8.4 + Rails 1.1.6 + Mongrel 0.3.13.4 on a Linux Box - Centos 4.4 - Apache 2.0.59 with proxy pass to a single Mongrel task ( no cluster ). Everything worked just fine... but after 10/12 hours the mongrel process hanged up, both passing trough apache or calling directly the process. The site had practically no traffic - it was a demo installation. Trying to kill the process 'nicely': mongrel_rails mongrel::stop didn't stop the process, with the command line reporting there was non mongrel.pid file, actually once the file wasn't really there but all the other times the file was present. You had to kill the process in a less more graceful manner ( kill -9 ... ) and everything started again running. After a couple of days of killing dead mongrel process, help form this list, and looking around in the debugging outputs I finally found this ruby trace that gave me some hints ( this trace appears regularly when you killed the hanging process ) and the problem was related to a mysql connection hanging. Mongrel::TimeoutError (Mongrel timed out this thread: shutdown): /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:637:in `write' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:517:in `write' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:491:in `command' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:223:in `close' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:168:in `disconnect!' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:163:in `reconnect!' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:85:in `verify!' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:99:in `verify_active_connections!' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.r b:98:in `verify_active_connections!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:70:in `prepare_application' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:37:in `dispatch' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in `process' /usr/local/lib/ruby/1.8/sync.rb:229:in `synchronize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in `process' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in `process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in `process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 /usr/local/bin/mongrel_rails:18 After suggestion on this list to install the mysql gem, and use the native driver instead of the ruby one. I finally manged to solve the problem - the site is running from about 72hours without a glitch. Thanks to everybody Massimo From jw at innerewut.de Tue Oct 3 06:27:11 2006 From: jw at innerewut.de (Jonathan Weiss) Date: Tue, 03 Oct 2006 11:27:11 +0100 Subject: [Mongrel] Mongrel cluster FreeBSD rc.d script In-Reply-To: <200610021609.10065.francisco@nortenet.pt> References: <200610021609.10065.francisco@nortenet.pt> Message-ID: <45223AFF.202@innerewut.de> Cheers, > Is there someone who have this issue too and have solved it?! I think it should be quite easy to create a FreeBSD etc/rc.d script out of the included Linux version. Just have a look at some of the other rc.d scripts. > > Thanks in advance > Francisco Regards, Jonathan -- Jonathan Weiss http://blog.innerewut.de From francisco at nortenet.pt Tue Oct 3 06:36:26 2006 From: francisco at nortenet.pt (Francisco Alves Cabrita) Date: Tue, 3 Oct 2006 11:36:26 +0100 Subject: [Mongrel] Mongrel cluster FreeBSD rc.d script In-Reply-To: References: <200610021609.10065.francisco@nortenet.pt> Message-ID: <200610031136.29054.francisco@nortenet.pt> Hi Vish Thanks very much for your tip! :) this tool seems very simple to use and maintain, more than bsdtools. Meanwhile, I think I haven't make myself understand with my question :S I think this way is better: Does Mongrel have an rc.d script to start multiple mongrel instances as it has for init.d (System V) scripts. /usr/local/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.0/lib/mongrel_cluster/init.d Once again Thanks very much Francisco Cabrita Em Tuesday, 3 de October de 2006 06:46, o Vishnu Gopal escreveu: > I use monit, and monit to start (and monitor) Mongrel. > http://www.tildeslash.com/monit/ > > Vish > > On 10/2/06, Francisco Alves Cabrita wrote: > > Hello all > > > > After installing Mongrel, Mongrel Cluster and all it's dependencies via > > gems > > under FreeBSD. Next I have configured all config/mongrel_cluster.yml for > > each > > Rails app, then: > > > > % mkdir /usr/local/etc/mongrel_cluster > > > > and likend each railsapp.yml to it's refering > > app/config/mongrel_cluster.yml > > > > My question is, after preparing all base configs now I need to add some > > rc.d > > script to the base system /usr/local/etc/rc.d/mongrel_cluster.sh or > > something > > else. I think mongrel is "shiped" only with an init,d script. > > > > Is there someone who have this issue too and have solved it?! > > > > Thanks in advance > > Francisco > > > > -- > > Violence in reality is quite different from theory. > > -- Spock, "The Cloud Minders", stardate 5818.4 > > > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users -- Either one of us, by himself, is expendable. Both of us are not. -- Kirk, "The Devil in the Dark", stardate 3196.1 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061003/b8a41bd8/attachment.bin From mongrel at philip.pjkh.com Tue Oct 3 11:53:27 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 3 Oct 2006 10:53:27 -0500 (CDT) Subject: [Mongrel] Apache Re-Write and Directories In-Reply-To: References: Message-ID: <20061003105255.M48439@bravo.pjkh.com> > I am using the 'default' Apache 2.2 mod_rewrite rules suggested from the Web > site and they are working. > > One thing related to static (non cluster directed) resources: > > If I have a directory in public called 'static', if I request it as follows: > > http://www.domain.com/static/ - then it works > > If I request it as: > > http://www.domain.com/static - then it does not work as it gets directed to > the cluster. > > How can I change my rewrite rules to have both of the above URLs be served > by the static resource via Apache, not by Mongrel? Add this to the beginning... RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ $1/ [R] > > Rewrite rules: > > RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f > RewriteCond %{SCRIPT_FILENAME} !maintenance.html > RewriteRule ^.*$ /maintenance.html [L] > # Rewrite index to check for static index.html > RewriteRule ^/$ /index.html [QSA] > # Rewrite to check for Rails cached pages with .html extentions > RewriteRule ^([^.]+)$ $1.html [QSA] > # All dynamic requests get sent to the cluster > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI} [P,QSA,L] > > Thanks!!! > > Hunter > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From me at seebq.com Tue Oct 3 13:21:03 2006 From: me at seebq.com (Charles Brian Quinn) Date: Tue, 3 Oct 2006 13:21:03 -0400 Subject: [Mongrel] Apache Re-Write and Directories In-Reply-To: <20061003105255.M48439@bravo.pjkh.com> References: <20061003105255.M48439@bravo.pjkh.com> Message-ID: <3a2de0cd0610031021o6057cb16o3e4f0ce64b6bc20@mail.gmail.com> Nicely done -- I'll add this to apache page! # if the directory exists, add trailing slash > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d > RewriteRule ^(.+[^/])$ $1/ [R] On 10/3/06, Philip Hallstrom wrote: > > I am using the 'default' Apache 2.2 mod_rewrite rules suggested from the Web > > site and they are working. > > > > One thing related to static (non cluster directed) resources: > > > > If I have a directory in public called 'static', if I request it as follows: > > > > http://www.domain.com/static/ - then it works > > > > If I request it as: > > > > http://www.domain.com/static - then it does not work as it gets directed to > > the cluster. > > > > How can I change my rewrite rules to have both of the above URLs be served > > by the static resource via Apache, not by Mongrel? > > Add this to the beginning... > > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d > RewriteRule ^(.+[^/])$ $1/ [R] > > > > > > > Rewrite rules: > > > > RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f > > RewriteCond %{SCRIPT_FILENAME} !maintenance.html > > RewriteRule ^.*$ /maintenance.html [L] > > # Rewrite index to check for static index.html > > RewriteRule ^/$ /index.html [QSA] > > # Rewrite to check for Rails cached pages with .html extentions > > RewriteRule ^([^.]+)$ $1.html [QSA] > > # All dynamic requests get sent to the cluster > > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > > RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI} [P,QSA,L] > > > > Thanks!!! > > > > Hunter > > > > > > _______________________________________________ > > 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 > -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com From mongrel at philip.pjkh.com Tue Oct 3 17:01:40 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 3 Oct 2006 16:01:40 -0500 (CDT) Subject: [Mongrel] Apache Re-Write and Directories In-Reply-To: <3a2de0cd0610031021o6057cb16o3e4f0ce64b6bc20@mail.gmail.com> References: <20061003105255.M48439@bravo.pjkh.com> <3a2de0cd0610031021o6057cb16o3e4f0ce64b6bc20@mail.gmail.com> Message-ID: <20061003155912.F55655@bravo.pjkh.com> > Nicely done -- I'll add this to apache page! Thanks :) I don't think I thought of it though, but don't remember where i saw it.. in case it helps anyone else, here's my full apache config that lets rails/php play nice together.... Of course, if you see any problems with this, be sure to let me know so I can fix it :) ServerName myserver.com DocumentRoot /path/to/my/app/public Options FollowSymLinks AllowOverride None Order allow,deny Allow from all BalancerMember http://127.0.0.1:8805 RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ $1/ [R] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} \.php RewriteRule ^(.*)$ $1 [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.html -f RewriteRule ^(.*)$ $1/index.html [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.php -f RewriteRule ^(.*)$ $1/index.php [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d RewriteRule ^(.*)[^/]$ $1/ [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html php_value include_path /path/to/my/app/php:/usr/local/lib/php:. php_value auto_prepend_file /path/to/my/app/php/auto_prepend.php # this not only blocks access to .svn directories, but makes it appear # as though they aren't even there, not just that they are forbidden ErrorDocument 403 /404.html Order allow,deny Deny from all Satisfy All > > # if the directory exists, add trailing slash >> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d >> RewriteRule ^(.+[^/])$ $1/ [R] > > > > On 10/3/06, Philip Hallstrom wrote: >>> I am using the 'default' Apache 2.2 mod_rewrite rules suggested from the Web >>> site and they are working. >>> >>> One thing related to static (non cluster directed) resources: >>> >>> If I have a directory in public called 'static', if I request it as follows: >>> >>> http://www.domain.com/static/ - then it works >>> >>> If I request it as: >>> >>> http://www.domain.com/static - then it does not work as it gets directed to >>> the cluster. >>> >>> How can I change my rewrite rules to have both of the above URLs be served >>> by the static resource via Apache, not by Mongrel? >> >> Add this to the beginning... >> >> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d >> RewriteRule ^(.+[^/])$ $1/ [R] >> >> >> >>> >>> Rewrite rules: >>> >>> RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f >>> RewriteCond %{SCRIPT_FILENAME} !maintenance.html >>> RewriteRule ^.*$ /maintenance.html [L] >>> # Rewrite index to check for static index.html >>> RewriteRule ^/$ /index.html [QSA] >>> # Rewrite to check for Rails cached pages with .html extentions >>> RewriteRule ^([^.]+)$ $1.html [QSA] >>> # All dynamic requests get sent to the cluster >>> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f >>> RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI} [P,QSA,L] >>> >>> Thanks!!! >>> >>> Hunter >>> >>> >>> _______________________________________________ >>> 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 >> > > > -- > Charles Brian Quinn > self-promotion: www.seebq.com > highgroove studios: www.highgroove.com > slingshot hosting: www.slingshothosting.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From jacob at jacobatzen.dk Tue Oct 3 17:13:26 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Tue, 3 Oct 2006 23:13:26 +0200 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <20061001163907.56f82b90.zedshaw@zedshaw.com> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> Message-ID: <20061003211326.GB38257@apoc.jacobatzen.dk> On Sun, Oct 01, 2006 at 04:39:07PM -0700, Zed A. Shaw wrote: > > The second problem stems from the fact that Mongrel uses the > > Thread#abort_on_exception. I'm not sure why this is even in there, as > > the documentation says: > > > > When set to true, causes all threads (including the main > > program) to abort if an exception is raised in thr. The process > > will effectively exit(0). > > > > The patch simply removes the abort_on_exception from mongrel.rb. After > > applying this patch I have been unable to make Mongrel crash. > > > > The abort was put in there to catch exceptions that are "leaking" > through and not being caught. I'm curious what exception was being > thrown that *none* of the damn begin/rescue blocks catches. We > seriously need a begin/rescue-every-damn-thing-no-matter-what > construct that actually works. Some further digging gives another pointer towards the problem. I am seeing some backtraces that look like this (beware, the line numbers might be a little off): /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:646:in `run': Mongrel timed out this thread: max processors# (Mongrel::TimeoutError) from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:704:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:684:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:268:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 from /usr/local/bin/mongrel_rails:18 The mongrel.rb:646 is the w.raise() call and 704 is: thread = Thread.new(client) { |c| What I make of this is that somehow the thread is put aside as soon as it's created, that is _before_ the process_client() call and when the thread is then killed off there's nothing to catch the exception. Now I am seeing exceptions being cast at line 646 before this one, but they have different backtraces, typically involving sync.rb and seems to be handled more properly. As far as I can tell they are all handled by the "Error calling Dispatcher.dispatch" rescue block. Another interesting note is that after an exception is cast at this exact point and with the above backtrace all processes go into the aborting state. And when they're all killed off Mongrel dies. It's actually quite clear as the following log exerpt will show: % grep -ni timeout log/mongrel.14.log 127011:Tue Oct 03 21:57:28 CEST 2006: Error calling Dispatcher.dispatch #> from # 203806:/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:646:in `run': Mongrel timed out this thread: max processors# (Mongrel::TimeoutError) % grep -n "aborting" log/mongrel.14.log | head -n 3 203815:[sync_synchronize] Unlocking # 203816:[sync_unlock:1] Thread.critical = true # 203817:[sync_unlock:4] Thread.critical = false # I have tried adding a begin/rescue/end around the process_client() call like this: begin process_client(thread_client); rescue Object STDERR.print "ERROR: RESCUING BEFORE CALL\n" end And it seems to be doing the job. At least I haven't been able to make Mongrel crash yet, with whatever little testing I've been doing. Yet I have seen the error message show up a couple of times. What are your thoughts on this? Does it make sense? > Now, I believe the problem you'll have is when this exception leaks > through that thread will become dead and eventually you'll fill up and > Mongrel will die anyway. If you can, try to find out what exception > causes this so I can have the server kill off its threads properly by > handling this yet another annoying random exception. Actually from what I've seen so far, the threads seems to be killed of properly, if somewhat slow. I'm printing the process list in every run of the sleeper thread, and from what I can see Mongrel will clean out the threads even when the exception leaks through. From my understanding when an exception gets to the top level of the thread, the thread is simply killed off. Feel free to correct me if I'm wrong. It does seem that some threads keep lingering in Mongrel even after all requests have died. But this seems to be the case whether the abort flag is set or not. It looks as if some enter an eternal sleeping state. I don't think it's much of a problem stability wise though, as they'll just get killed of whenever the reaper gets to work. > This might not be needed as the ruby-core guys finally started taking > a serious look at how array works and we can probably switch back to > Mutex in the near future. I have no idea how Mutex handles locking, but sync seems to be doing a whole lot of work over and over again. It seems to me it's really meant for smaller locking queues. > Thanks again Jacob, if you can answer the questions I had so I can > work on a fix that doesn't involve updating ruby. Also an explanation > as to why you were having these problems will help people decide if > they should apply the patches too. I'm still not sure why I'm the only one seeing these problems. Maybe others are seing them too and just not being aware of them. Maybe they only show up when the Mongrels gets severely loaded. Maybe I'm simply the only one butchering poor Mongrels for fun in my spare-time? ;-) In regards to the sync issues the jury is still out on that one. I will need to get a deeper understanding of how sync works to get to the bottom of it, but I'll continue poking around. -- Cheers, - Jacob Atzen From wyhaines at gmail.com Tue Oct 3 18:50:03 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 3 Oct 2006 16:50:03 -0600 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <20061003211326.GB38257@apoc.jacobatzen.dk> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> <20061003211326.GB38257@apoc.jacobatzen.dk> Message-ID: On 10/3/06, Jacob Atzen wrote: > I have no idea how Mutex handles locking, but sync seems to be doing a > whole lot of work over and over again. It seems to me it's really meant > for smaller locking queues. They handle locking in more or less the same way. What is really substantially different is the unlocking. Sync goes and wakes up the entire queue of waiting threads. They scramble for the lock again, and all but one (probably the first one to be woken up) fail to get it and are relocked. If you have a big thread queue, it is a lot of extra work. Mutex, on the other hand, just handles it one thread at a time, so it is _MUCH_ more efficient with the unlocking. > In regards to the sync issues the jury is still out on that one. I will > need to get a deeper understanding of how sync works to get to the > bottom of it, but I'll continue poking around. That with Mutex. It't very simple to understand. Then go take a look at Sync. You have to shift through an uglier, more antiquated coding style, and there is a bunch of extra code to deal with the different types of locks that Sync supports, but if you filter through that to find the lock and unlock pieces of code for exclusive locks, you'll quickly start to understand the differences. Mutex is also so very simple that you'll see why I prefer to use a custom version that works around the Array memory mismanagement that bites the standard one over Sync, which is ugly enough to make the baby Jesus cry. Kirk Haines From jeremy at bitsweat.net Tue Oct 3 19:51:55 2006 From: jeremy at bitsweat.net (Jeremy Kemper) Date: Tue, 3 Oct 2006 16:51:55 -0700 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <20061003211326.GB38257@apoc.jacobatzen.dk> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> <20061003211326.GB38257@apoc.jacobatzen.dk> Message-ID: <69a2885c0610031651x286c4752tb6990a70040e8e77@mail.gmail.com> On 10/3/06, Jacob Atzen wrote: > > I'm still not sure why I'm the only one seeing these problems. Maybe > others are seing them too and just not being aware of them. Maybe they > only show up when the Mongrels gets severely loaded. Maybe I'm simply > the only one butchering poor Mongrels for fun in my spare-time? ;-) I see the same behavior with a handler that does some slow, blocking IO (resolving symlinks on heavily loaded NFS servers). I worked around it by using more Mongrels instead of more worker threads and by backgrounding one long-running task which could safely send an HTTP response before completing. It'd be cool if Mongrel forked itself (up to a max # of processes) to alleviate the issues that arise with Rails handler locking and with blocking IO due to Ruby's green threads. Mongrel cluster could work but it feels like overkill when forking would do the job with zero config (minus Win32). jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061003/dcd4c6cf/attachment.html From laird at google.com Tue Oct 3 20:04:53 2006 From: laird at google.com (Scott Laird) Date: Tue, 3 Oct 2006 17:04:53 -0700 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: <71166b3b0610021723i20713033w3ea6daa08cc5827d@mail.gmail.com> References: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> <1CD0FF9D-ED36-4547-A2D5-BB40983A9F48@brainspl.at> <71166b3b0610021723i20713033w3ea6daa08cc5827d@mail.gmail.com> Message-ID: On 10/2/06, Luis Lavena wrote: > Ezra, one thing that still bug me is IP handling. If i have a live > server and decide to do a hot migration to a newer box, how it > manages, and how much downtime will get to the IP switches ges > notified of the migration? (in ms resolution) > > Or i'm forced to have a load balancer that handle the problem for me? If you're doing it right, the switches should notice within a few milliseconds. Any reasonable virtualization setup will have to assign a virtual MAC address to each virtual ethernet interface, and the MAC address should transfer between machines along with the rest of the VM. So, assuming that both machines are on the same L2 network, it's just a matter of the new machine sending an Ethernet frame or two out its interface using the virtual MAC address as the source address. To the switch, it'll look like the virtual server was unplugged from one port and plugged into the new one, which isn't a big deal. I'd be amazed if VMWare didn't have code in it to explicitly trip this, but even without it it'll happen almost instantly. Scott From joeat303 at yahoo.com Tue Oct 3 21:29:43 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Tue, 3 Oct 2006 18:29:43 -0700 (PDT) Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? Message-ID: <20061004012943.90598.qmail@web38603.mail.mud.yahoo.com> Hey Ezra, What other gains do you get with virtualizing? Also, would Xen/virtualizing make these easier? - restoring root compromised servers - transferring everything from an old to new server -- I do this periodically and cringe at having to reinstall everything Thanks, Joe > Yeah now that I have been way into Xen, I wouldn't setup a new > server without it. Even if you only have one server I would put Xen > on it, even if its just one huge VM that fills the entire server. The > performance overhead of Xen is about 5% compared to raw hardware > which is really nothing compared to the gains you get by virtualizing. > > It makes it so much easier to scale later. Move your VM's from > machine to machine. And separate concerns into their own VM's. > Seriously I can't recommend it enough. We have built our entire new > business on top of Xen. http://engineyard.com . Its only for ruby/ > rails hosting and everything runs in Xen. Xen is very cool stuff. > > -Ezra __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From luislavena at gmail.com Tue Oct 3 22:19:07 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 3 Oct 2006 23:19:07 -0300 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: References: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> <1CD0FF9D-ED36-4547-A2D5-BB40983A9F48@brainspl.at> <71166b3b0610021723i20713033w3ea6daa08cc5827d@mail.gmail.com> Message-ID: <71166b3b0610031919g32c52d00m1dcf63f291e6a220@mail.gmail.com> On 10/3/06, Scott Laird wrote: > On 10/2/06, Luis Lavena wrote: > > > Ezra, one thing that still bug me is IP handling. If i have a live > > server and decide to do a hot migration to a newer box, how it > > manages, and how much downtime will get to the IP switches ges > > notified of the migration? (in ms resolution) > > > > Or i'm forced to have a load balancer that handle the problem for me? > > If you're doing it right, the switches should notice within a few > milliseconds. Any reasonable virtualization setup will have to assign > a virtual MAC address to each virtual ethernet interface, and the MAC > address should transfer between machines along with the rest of the > VM. So, assuming that both machines are on the same L2 network, it's > just a matter of the new machine sending an Ethernet frame or two out > its interface using the virtual MAC address as the source address. To > the switch, it'll look like the virtual server was unplugged from one > port and plugged into the new one, which isn't a big deal. I'd be > amazed if VMWare didn't have code in it to explicitly trip this, but > even without it it'll happen almost instantly. > Thank you for your answer Scott, I'll investigate Xen further on my spare time the following months. Regards, > > Scott > _______________________________________________ > 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 Oct 3 22:49:35 2006 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 3 Oct 2006 23:49:35 -0300 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <69a2885c0610031651x286c4752tb6990a70040e8e77@mail.gmail.com> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> <20061003211326.GB38257@apoc.jacobatzen.dk> <69a2885c0610031651x286c4752tb6990a70040e8e77@mail.gmail.com> Message-ID: <71166b3b0610031949m1dcdb089g39bb82d6be48ee5a@mail.gmail.com> On 10/3/06, Jeremy Kemper wrote: > On 10/3/06, Jacob Atzen wrote: > > I'm still not sure why I'm the only one seeing these problems. Maybe > > others are seing them too and just not being aware of them. Maybe they > > only show up when the Mongrels gets severely loaded. Maybe I'm simply > > the only one butchering poor Mongrels for fun in my spare-time? ;-) > > I see the same behavior with a handler that does some slow, blocking IO > (resolving symlinks on heavily loaded NFS servers). I worked around it by > using more Mongrels instead of more worker threads and by backgrounding one > long-running task which could safely send an HTTP response before > completing. > > It'd be cool if Mongrel forked itself (up to a max # of processes) to > alleviate the issues that arise with Rails handler locking and with > blocking IO due to Ruby's green threads. Mongrel cluster could work but it > feels like overkill when forking would do the job with zero config (minus > Win32). Jeremy, I'm working on a improved mongrel_service (for win32) that will handle the mongrel_cluster scenario in a simplified way. Still, configuration will be required, but each time you need to change the parameters for your mongrels, wouldn't need to remove/install cycle, just change the config file and restart the service. Also, with the new schema will get child process monitoring and re spawning if they are needed. (Still, don't know how to differentiate a sleeping-dead-zombie mongrel from the rest, but guess will figure it out ;) > > jeremy > _______________________________________________ > 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 ez at brainspl.at Tue Oct 3 23:16:47 2006 From: ez at brainspl.at (Ezra Zygmuntowicz) Date: Tue, 3 Oct 2006 20:16:47 -0700 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: <20061004012943.90598.qmail@web38603.mail.mud.yahoo.com> References: <20061004012943.90598.qmail@web38603.mail.mud.yahoo.com> Message-ID: Hey Joe- On Oct 3, 2006, at 6:29 PM, Joe Ruby wrote: > Hey Ezra, > > What other gains do you get with virtualizing? > > Also, would Xen/virtualizing make these easier? > - restoring root compromised servers Yup, you can take snapshots of a VM and restore back to that point in time without a fuss. Of course you have to set this up and its up to you how often you take snapshots is up to you. > - transferring everything from an old to new server -- Yup its pretty much just a few command lines to move a VM from one physical box to another physical box *while its running* > I do this periodically and cringe at having to > reinstall everything > > Thanks, > Joe > -Ezra From luislavena at gmail.com Tue Oct 3 23:29:33 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 4 Oct 2006 00:29:33 -0300 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: <20061004012943.90598.qmail@web38603.mail.mud.yahoo.com> References: <20061004012943.90598.qmail@web38603.mail.mud.yahoo.com> Message-ID: <71166b3b0610032029v1079e1e1n2da0fceed51cb2d4@mail.gmail.com> On 10/3/06, Joe Ruby wrote: > Hey Ezra, > > What other gains do you get with virtualizing? > > Also, would Xen/virtualizing make these easier? > - restoring root compromised servers > - transferring everything from an old to new server -- > I do this periodically and cringe at having to > reinstall everything > My guess is like Xen, like parallels or VMWave offer a "rollback" or readonly functionality. for the virtual machine hard disk. I have setup many times with parallels our OS disk in read only (or discard changes mode) and our data with rollback functionality. But guess xen like vmware have some snapshots capabilities which simplifies everything (like revert to yesterday snapshot). But Ezra could get offer better info about Xen. > Thanks, > Joe > > > > Yeah now that I have been way into Xen, I wouldn't > setup a new > > server without it. Even if you only have one server > I would put Xen > > on it, even if its just one huge VM that fills the > entire server. The > > performance overhead of Xen is about 5% compared to > raw hardware > > which is really nothing compared to the gains you > get by virtualizing. > > > > It makes it so much easier to scale later. Move > your VM's from > > machine to machine. And separate concerns into their > own VM's. > > Seriously I can't recommend it enough. We have built > our entire new > > business on top of Xen. http://engineyard.com . Its > only for ruby/ > > rails hosting and everything runs in Xen. Xen is > very cool stuff. > > > > -Ezra > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > 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 carl.lerche at gmail.com Wed Oct 4 01:45:55 2006 From: carl.lerche at gmail.com (Carl Lerche) Date: Tue, 3 Oct 2006 22:45:55 -0700 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: <71166b3b0610031919g32c52d00m1dcf63f291e6a220@mail.gmail.com> References: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> <1CD0FF9D-ED36-4547-A2D5-BB40983A9F48@brainspl.at> <71166b3b0610021723i20713033w3ea6daa08cc5827d@mail.gmail.com> <71166b3b0610031919g32c52d00m1dcf63f291e6a220@mail.gmail.com> Message-ID: This sounds really sweet, I'm definitely going to have to look into this more. It would simply pretty much everything from deployment to backups. -carl On 10/3/06, Luis Lavena wrote: > On 10/3/06, Scott Laird wrote: > > On 10/2/06, Luis Lavena wrote: > > > > > Ezra, one thing that still bug me is IP handling. If i have a live > > > server and decide to do a hot migration to a newer box, how it > > > manages, and how much downtime will get to the IP switches ges > > > notified of the migration? (in ms resolution) > > > > > > Or i'm forced to have a load balancer that handle the problem for me? > > > > If you're doing it right, the switches should notice within a few > > milliseconds. Any reasonable virtualization setup will have to assign > > a virtual MAC address to each virtual ethernet interface, and the MAC > > address should transfer between machines along with the rest of the > > VM. So, assuming that both machines are on the same L2 network, it's > > just a matter of the new machine sending an Ethernet frame or two out > > its interface using the virtual MAC address as the source address. To > > the switch, it'll look like the virtual server was unplugged from one > > port and plugged into the new one, which isn't a big deal. I'd be > > amazed if VMWare didn't have code in it to explicitly trip this, but > > even without it it'll happen almost instantly. > > > > Thank you for your answer Scott, I'll investigate Xen further on my > spare time the following months. > > Regards, > > > > > Scott > > _______________________________________________ > > 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 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From thibaut.barrere at gmail.com Wed Oct 4 04:32:08 2006 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 4 Oct 2006 10:32:08 +0200 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: References: <4a68b8cf0610020440q3aeb8737td45c0c46bc1c5730@mail.gmail.com> <1CD0FF9D-ED36-4547-A2D5-BB40983A9F48@brainspl.at> <71166b3b0610021723i20713033w3ea6daa08cc5827d@mail.gmail.com> <71166b3b0610031919g32c52d00m1dcf63f291e6a220@mail.gmail.com> Message-ID: <4a68b8cf0610040132p7ecd0a63ye0b79a6c283faa78@mail.gmail.com> Thanks everyone for the valuable input! cheers Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061004/08f7a851/attachment-0001.html From g.vishnu at gmail.com Wed Oct 4 08:33:43 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Wed, 4 Oct 2006 18:03:43 +0530 Subject: [Mongrel] Slideshare.net (we use Mongrel) Message-ID: Hi guys :-) Just a note to let you know that today we launched Slideshare ( slideshare.net) into open beta. It's a powerpoint-sharing tool (with a twist) and the app is served with Mongrel. A teaser on techcrunch: http://www.techcrunch.com/2006/10/04/introducing-slideshare-power-point-youtube/ Zed, a huge thanks for developing this server. If anybody needs pointers on using Mongrel in a high-volume deployment situation, watch blog.slideshare.net. I'll have a few posts up soon. Take care all Thanks again! Vish -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061004/eaeb83d4/attachment.html From jamesludlow at gmail.com Wed Oct 4 11:14:11 2006 From: jamesludlow at gmail.com (JDL) Date: Wed, 4 Oct 2006 10:14:11 -0500 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: References: <20061004012943.90598.qmail@web38603.mail.mud.yahoo.com> Message-ID: On 10/3/06, Ezra Zygmuntowicz wrote: > Hey Joe- > > On Oct 3, 2006, at 6:29 PM, Joe Ruby wrote: > > > Hey Ezra, > > > > What other gains do you get with virtualizing? > > > > Also, would Xen/virtualizing make these easier? > > - restoring root compromised servers > > Yup, you can take snapshots of a VM and restore back to that point in > time without a fuss. Of course you have to set this up and its up to > you how often you take snapshots is up to you. > > > - transferring everything from an old to new server -- > > Yup its pretty much just a few command lines to move a VM from one > physical box to another physical box *while its running* OK, I'll take this a bit further off topic. Ezra, do you plan to cover Xen in Rails Deployment? Also, the blurb on the Pragmatic site indicates that the book is going to focus on lighttpd. Is that still the case, or is the description out-of-date? -- James From wyhaines at gmail.com Wed Oct 4 12:08:05 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 4 Oct 2006 10:08:05 -0600 Subject: [Mongrel] Sites that use Mongrel Message-ID: It would be an interesting topic. I bet there are quite a few. I just released one that 1/2 runs on Mongrel. http://direxionfunds.com It was released before it was _quite_ ready, but the last of the content is getting inserted today. I am still waffling on how I will leave it running longterm. Right now it uses a slightly modified version of the Mongrel http parser with EventMachine to front IOWA, all reached via an Apache proxy, but I am also alternately running it under Mongrel 0.13.4 in its entirety, with an IOWA handler, and comparing the performance patterns now that real users are hitting the site. The site is completely dynamic, with all content and navigation generated from data inserted into a database via a simple CMS system, and all fund performance information pulled from a db that is updated automatically via data feeds. There is also a second, by-login-only site that sits on top of this one, in the same URL space, so if you are an investment professional, you login, and then index.html and other parts of the site show you different things. Performance in this setup is better than anything except maybe one using fcgi (the site should peak at about 200 dynamic reqs/second, which is WAAAY more than it'll ever get), but this is brain dead simple to setup and manage, so I like it much more than I like fcgi, and I can toggle pure Mongrel or Mongrel/EM hybrid operation in about 2 seconds, too. Good stuff. I am pleased with what you have brought to the table with Mongrel, Zed. Thanks for your continued work. Kirk Haines From ez at brainspl.at Wed Oct 4 14:21:34 2006 From: ez at brainspl.at (Ezra Zygmuntowicz) Date: Wed, 4 Oct 2006 11:21:34 -0700 Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? In-Reply-To: References: <20061004012943.90598.qmail@web38603.mail.mud.yahoo.com> Message-ID: <8F14FC70-81B4-4D42-B95B-90747714D171@brainspl.at> On Oct 4, 2006, at 8:14 AM, JDL wrote: > On 10/3/06, Ezra Zygmuntowicz wrote: >> Hey Joe- >> >> On Oct 3, 2006, at 6:29 PM, Joe Ruby wrote: >> >>> Hey Ezra, >>> >>> What other gains do you get with virtualizing? >>> >>> Also, would Xen/virtualizing make these easier? >>> - restoring root compromised servers >> >> Yup, you can take snapshots of a VM and restore back to that point in >> time without a fuss. Of course you have to set this up and its up to >> you how often you take snapshots is up to you. >> >>> - transferring everything from an old to new server -- >> >> Yup its pretty much just a few command lines to move a VM from one >> physical box to another physical box *while its running* > > OK, I'll take this a bit further off topic. Ezra, do you plan to > cover Xen in Rails Deployment? > > Also, the blurb on the Pragmatic site indicates that the book is going > to focus on lighttpd. Is that still the case, or is the description > out-of-date? > > -- James The description is out of date. I will of course cover lighty but I will also focus on ngxin and apache2.2 as fornt ends and mongrels as back ends. Although I will cover fcgi as well just to cover the bases. I do cover working on your own VPS but I will not be going into details about configuring Xen itself as it is outside the scope of the book. But who knows maybe in the future or 2.0 or the book I will cover setting up your own Xen environment. I will also post some Xen tutorials on my blog once I get some free time(which could be any year now ;-). Cheers- -Ezra From steven at lumos.us Wed Oct 4 17:50:19 2006 From: steven at lumos.us (Steven Lumos) Date: Wed, 04 Oct 2006 14:50:19 -0700 Subject: [Mongrel] Mongrel woes fixed References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> Message-ID: <86vemzg38k.fsf@bitty.lumos.us> "Zed A. Shaw" writes: > On Sun, 1 Oct 2006 21:38:12 +0200 > Jacob Atzen wrote: > >> Hello all, >> >> For the past couple of weeks I have been spending some time debugging a >> couple of issues I was having with Mongrel when I put load on it. I have >> seen two distinct issues: >> >> 1. Mongrel stopped responding as if in an endless loop. >> 2. Mongrel crashed when severely loaded. >> > > Cool, glad you took the time to figure this out. > >> I believe to have resolved these two issues and have attached patches >> which shows the resolution (simple as it is). Explanation of the patches >> is given below. >> >> The first problem is handled by the patch to sync.rb from the standard >> library. What is happening here is that when sync_unlock is called >> Thread.critical is set to true. Now if the thread is not the >> sync_ex_locker an exception is thrown without Thread.critical being set >> to false. This in turn resulted in a situation where the >> mongrel_sleeper_thread (configurator.rb:270) was the only thread getting >> back on the cpu and Thread.critical stayed true. The patch simply >> ensures that Thread.critical is set to false upon leaving sync.rb. > > Ok, is there a way to fix this without having people backpatch their > ruby? Also, why were you the only one having this problem? I'd > like to know how the error is caused if you could explain it. He's definitely not the only one having this problem. I've been working on it too as I've had time. I--and possibly others--have been wasting time with USR1 trying to figure out what *my* code must have been doing wrong. Once I realized that wasn't helping, I had got as far as commenting out the sleeper thread so that I could get a useful backtrace, but then it looked like it my query that was hanging. I see now that I was stupidly glossing over the most important frame. thread.rb:100:in `lock' oci8.rb:126:in `do_ocicall' oci8.rb:232:in `commit' (eval):3:in `commit' active_record/connection_adapters/oracle_adapter.rb:295:in `commit_db_transaction' active_record/connection_adapters/abstract/database_stateme ... For people who have this problem, the commonality is likely to be (1) the Oracle adapter, (2) actions that create threads. If other (mysql) adapters don't use threads then that may explain it. Steve From zedshaw at zedshaw.com Wed Oct 4 11:20:37 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 4 Oct 2006 08:20:37 -0700 Subject: [Mongrel] Slideshare.net (we use Mongrel) In-Reply-To: References: Message-ID: <20061004082037.4bef089a.zedshaw@zedshaw.com> On Wed, 4 Oct 2006 18:03:43 +0530 "Vishnu Gopal" wrote: > Hi guys :-) > > Just a note to let you know that today we launched Slideshare ( > slideshare.net) into open beta. It's a powerpoint-sharing tool (with a > twist) and the app is served with Mongrel. > > A teaser on techcrunch: > http://www.techcrunch.com/2006/10/04/introducing-slideshare-power-point-youtube/ > > Zed, a huge thanks for developing this server. If anybody needs pointers on > using Mongrel in a high-volume deployment situation, watch > blog.slideshare.net. I'll have a few posts up soon. > You're welcome. You'll have to let me know if there's any improvements I can make or suggestions you have. Can I list your site on the adoptions page? -- 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 zedshaw at zedshaw.com Wed Oct 4 11:22:38 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 4 Oct 2006 08:22:38 -0700 Subject: [Mongrel] Sites that use Mongrel In-Reply-To: References: Message-ID: <20061004082238.d5eb0cbe.zedshaw@zedshaw.com> On Wed, 4 Oct 2006 10:08:05 -0600 "Kirk Haines" wrote: > It would be an interesting topic. I bet there are quite a few. > > I just released one that 1/2 runs on Mongrel. http://direxionfunds.com > > It was released before it was _quite_ ready, but the last of the > content is getting inserted today. I am still waffling on how I will > leave it running longterm. Right now it uses a slightly modified > version of the Mongrel http parser with EventMachine to front IOWA, > all reached via an Apache proxy, but I am also alternately running it > under Mongrel 0.13.4 in its entirety, with an IOWA handler, and > comparing the performance patterns now that real users are hitting the > site. > What modification did you make to the parser? I think you covered this once before but can't find the message where you detailed them. > The site is completely dynamic, with all content and navigation > generated from data inserted into a database via a simple CMS system, > and all fund performance information pulled from a db that is updated > automatically via data feeds. There is also a second, by-login-only > site that sits on top of this one, in the same URL space, so if you > are an investment professional, you login, and then index.html and > other parts of the site show you different things. > > Performance in this setup is better than anything except maybe one > using fcgi (the site should peak at about 200 dynamic reqs/second, > which is WAAAY more than it'll ever get), but this is brain dead > simple to setup and manage, so I like it much more than I like fcgi, > and I can toggle pure Mongrel or Mongrel/EM hybrid operation in about > 2 seconds, too. Good stuff. > > I am pleased with what you have brought to the table with Mongrel, > Zed. Thanks for your continued work. > Nice. I'll put you on the adoptions page if you don't mind. -- 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 wyhaines at gmail.com Wed Oct 4 23:10:28 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 4 Oct 2006 21:10:28 -0600 Subject: [Mongrel] Sites that use Mongrel In-Reply-To: <20061004082238.d5eb0cbe.zedshaw@zedshaw.com> References: <20061004082238.d5eb0cbe.zedshaw@zedshaw.com> Message-ID: On 10/4/06, Zed A. Shaw wrote: > What modification did you make to the parser? I think you covered this > once before but can't find the message where you detailed them. They are very modest. I simplified http_field so that it doesn't change dashes to underscores. I separated the classifier code from the parser code in the extension and moved the classifier into a separate file altogether. I changed it so that the server name, server port, http version, etc... goes into a separate hash from the values that the http parser parses out. That's about it. Just some little things. Kirk From talk2sunder at gmail.com Wed Oct 4 23:59:49 2006 From: talk2sunder at gmail.com (Sunder ) Date: Wed, 4 Oct 2006 20:59:49 -0700 Subject: [Mongrel] Sites that use Mongrel In-Reply-To: References: Message-ID: Add www.gradswanted.com and the soon to be launched www.campuschai.com to the list. I owe it big time to zed, before mongrel, I was suffering in fastcgi land with no end in sight. Lighttpd made it slightly better, but mongrel was paradise. Zed, THANK YOU. Sunder On 10/4/06, Kirk Haines wrote: > > It would be an interesting topic. I bet there are quite a few. > > I just released one that 1/2 runs on Mongrel. http://direxionfunds.com > > It was released before it was _quite_ ready, but the last of the > content is getting inserted today. I am still waffling on how I will > leave it running longterm. Right now it uses a slightly modified > version of the Mongrel http parser with EventMachine to front IOWA, > all reached via an Apache proxy, but I am also alternately running it > under Mongrel 0.13.4 in its entirety, with an IOWA handler, and > comparing the performance patterns now that real users are hitting the > site. > > The site is completely dynamic, with all content and navigation > generated from data inserted into a database via a simple CMS system, > and all fund performance information pulled from a db that is updated > automatically via data feeds. There is also a second, by-login-only > site that sits on top of this one, in the same URL space, so if you > are an investment professional, you login, and then index.html and > other parts of the site show you different things. > > Performance in this setup is better than anything except maybe one > using fcgi (the site should peak at about 200 dynamic reqs/second, > which is WAAAY more than it'll ever get), but this is brain dead > simple to setup and manage, so I like it much more than I like fcgi, > and I can toggle pure Mongrel or Mongrel/EM hybrid operation in about > 2 seconds, too. Good stuff. > > I am pleased with what you have brought to the table with Mongrel, > Zed. Thanks for your continued work. > > > Kirk Haines > _______________________________________________ > 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/20061004/c453d66a/attachment-0001.html From zedshaw at zedshaw.com Wed Oct 4 19:25:19 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 4 Oct 2006 16:25:19 -0700 Subject: [Mongrel] Mongrel pre-release 0.3.13.5(Was: Mongrel woes fixed) In-Reply-To: <20061001193811.GA5663@nezbo.dhcp.aub.dk> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> Message-ID: <20061004162519.62a5491d.zedshaw@zedshaw.com> On Sun, 1 Oct 2006 21:38:12 +0200 Jacob Atzen wrote: > Hello all, > > For the past couple of weeks I have been spending some time debugging a > couple of issues I was having with Mongrel when I put load on it. I have > seen two distinct issues: > > 1. Mongrel stopped responding as if in an endless loop. > 2. Mongrel crashed when severely loaded. Alright, I made the slight change to remove the abort on exception call, and a small tweak to abort if the received size of a body does not match the content-length. I also made a slight clarity change to the USR1 logging so that it reports only the action that is blocking all the other actions. Previously it was more confused that this, so I simplified it. People experiencing problems of either 99% CPU or crashing should grab the pre-release and run your server with it. If you see a stack trace saying the body lengths don't match, send them to me. If you crash, send me the stack trace as well. I'll also be looking at another suggested change from Jacob, but I think this will clean up nicely. And as usual you install with: gem install mongrel --source=http://mongrel.rubyforge.org/releases/ Thanks a bunch folks! -- 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 zedshaw at zedshaw.com Wed Oct 4 19:31:10 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 4 Oct 2006 16:31:10 -0700 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <69a2885c0610031651x286c4752tb6990a70040e8e77@mail.gmail.com> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> <20061003211326.GB38257@apoc.jacobatzen.dk> <69a2885c0610031651x286c4752tb6990a70040e8e77@mail.gmail.com> Message-ID: <20061004163110.b91e54c0.zedshaw@zedshaw.com> On Tue, 3 Oct 2006 16:51:55 -0700 "Jeremy Kemper" wrote: > On 10/3/06, Jacob Atzen wrote: > > > > I'm still not sure why I'm the only one seeing these problems. Maybe > > others are seing them too and just not being aware of them. Maybe they > > only show up when the Mongrels gets severely loaded. Maybe I'm simply > > the only one butchering poor Mongrels for fun in my spare-time? ;-) > > > I see the same behavior with a handler that does some slow, blocking IO > (resolving symlinks on heavily loaded NFS servers). I worked around it by > using more Mongrels instead of more worker threads and by backgrounding one > long-running task which could safely send an HTTP response before > completing. > > It'd be cool if Mongrel forked itself (up to a max # of processes) to > alleviate the issues that arise with Rails handler locking and with > blocking IO due to Ruby's green threads. Mongrel cluster could work but it > feels like overkill when forking would do the job with zero config (minus > Win32). It actually wouldn't be hard to write a simple HttpHandler that was inserted before rails which just called fork to continue the request, but I think it'd require a shift in how the response is processed in Mongrel. The problem with forking servers is they are slow and they end up having the same problems we're seeing with threads just with processes (which eat up ass loads more ram than a dead thread). I'm really more interested in something that's in-between full on 50M forked processes for each request and nasty ruby threading causing problems. Another thought might be to have such a forking handler for Mongrel, but make it selective so that it only forked the troublesome requests. -- 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 zedshaw at zedshaw.com Wed Oct 4 19:34:22 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 4 Oct 2006 16:34:22 -0700 Subject: [Mongrel] Mongrel woes fixed In-Reply-To: <86vemzg38k.fsf@bitty.lumos.us> References: <20061001193811.GA5663@nezbo.dhcp.aub.dk> <20061001163907.56f82b90.zedshaw@zedshaw.com> <86vemzg38k.fsf@bitty.lumos.us> Message-ID: <20061004163422.ddb6051a.zedshaw@zedshaw.com> On Wed, 04 Oct 2006 14:50:19 -0700 Steven Lumos wrote: > "Zed A. Shaw" writes: > > > On Sun, 1 Oct 2006 21:38:12 +0200 > > Jacob Atzen wrote: > > > > Ok, is there a way to fix this without having people backpatch their > > ruby? Also, why were you the only one having this problem? I'd > > like to know how the error is caused if you could explain it. > > He's definitely not the only one having this problem. I've been > working on it too as I've had time. I--and possibly others--have been > wasting time with USR1 trying to figure out what *my* code must have > been doing wrong. Once I realized that wasn't helping, I had got as > far as commenting out the sleeper thread so that I could get a useful > backtrace, but then it looked like it my query that was hanging. I > see now that I was stupidly glossing over the most important frame. > > thread.rb:100:in `lock' > oci8.rb:126:in `do_ocicall' > oci8.rb:232:in `commit' > (eval):3:in `commit' > active_record/connection_adapters/oracle_adapter.rb:295:in `commit_db_transaction' > active_record/connection_adapters/abstract/database_stateme ... > > For people who have this problem, the commonality is likely to be (1) > the Oracle adapter, (2) actions that create threads. If other (mysql) > adapters don't use threads then that may explain it. Ah, but I'm wondering if there's a possible deadlock in oci8.rb when it does that lock call. Ruby's supposed to detect those. Also, if the oci8 driver is kicking up threads to do its requests, and it isn't cleaning them out, then you'll quickly run out of file descriptors. Are you also seeing tons of connections to your oracle db? Like one per request? -- 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 bpauly at gmail.com Thu Oct 5 11:41:26 2006 From: bpauly at gmail.com (Brad Pauly) Date: Thu, 5 Oct 2006 11:41:26 -0400 Subject: [Mongrel] Sites that use Mongrel In-Reply-To: References: Message-ID: I've been meaning to mention that I re-launched www.foundmagazine.com a few months ago. Running mongrel behind apache and all has been well since it went live. I'm told it's getting 50k+ page views a day. The other day it got posted on a popular blog and got 170k page views without a hiccup. Thanks Zed! Cheers, Brad From mail at flydown.org Thu Oct 5 15:53:42 2006 From: mail at flydown.org (Michele) Date: Thu, 5 Oct 2006 21:53:42 +0200 Subject: [Mongrel] Sites that use Mongrel In-Reply-To: References: Message-ID: <57A4C78B-9052-4909-84C7-53F398E72138@flydown.org> I'm currently running two apps with Mongrel: http://16bugs.com/ which is a very simple bug tracker and http://unilife.it/ which is a social networking website for Italian universities. And they're both running smoothly! :) - Michele -- Michele Finotto http://finotto.org/ http://16bugs.com/ On Oct 5, 2006, at 17:41 , Brad Pauly wrote: > I've been meaning to mention that I re-launched www.foundmagazine.com > a few months ago. Running mongrel behind apache and all has been well > since it went live. I'm told it's getting 50k+ page views a day. The > other day it got posted on a popular blog and got 170k page views > without a hiccup. > > Thanks Zed! > > Cheers, > Brad > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From andrew at sophrinix.com Thu Oct 5 19:34:53 2006 From: andrew at sophrinix.com (=?iso-8859-1?Q?andrew?=) Date: Thu, 05 Oct 2006 17:34:53 -0600 Subject: [Mongrel] Site statistics Message-ID: <20061005233453.23093.qmail@server285.com> Hey, I was wondering what everyone else does in regards to getting webalizer or other site statistics software to work with mongrel. I currently have a mongrel cluster running behind apache 2.2 with proxy_mod_balancer, but I"m finding that webalizer isn't too thrilled with that mod. Thanks, Andrew From andrew at sophrinix.com Thu Oct 5 20:11:18 2006 From: andrew at sophrinix.com (=?iso-8859-1?Q?andrew?=) Date: Thu, 05 Oct 2006 18:11:18 -0600 Subject: [Mongrel] webalizer for mongrel? Message-ID: <20061006001118.27051.qmail@server285.com> Hey, I sent out an email a while ago, I am still not seeing it show up. Sorry if this is a double post.. Is there a way to make webalizer work with mongrel? Thanks, Andrew From joeat303 at yahoo.com Fri Oct 6 03:23:15 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Fri, 6 Oct 2006 00:23:15 -0700 (PDT) Subject: [Mongrel] [Slightly OT] Do you use virtualization in production ? Message-ID: <20061006072315.91298.qmail@web38608.mail.mud.yahoo.com> > The description is out of date. I will of course cover lighty but I > will also focus on ngxin and apache2.2 as fornt ends and mongrels as > back ends. Although I will cover fcgi as well just to cover the > bases. I do cover working on your own VPS but I will not be going > into details about configuring Xen itself as it is outside the scope > of the book. But who knows maybe in the future or 2.0 or the book I > will cover setting up your own Xen environment. I will also post some > Xen tutorials on my blog once I get some free time(which could be any > year now ;-). > > Cheers- > -Ezra I look forward to those tutorials! :) I have some more n00b questions, if you don't mind. :) - Is it easy to get Xen working on a server that's already in production (currently functioning as a web, app, and db server)? - Can Xen be installed/setup/used remotely (I have servers at LayeredTech and EV1)? Xen's screenshots show Linux desktops. - Know of any quickstart or "Xen for Dummies" docs/tutorials? I'm currently working my way through Xen's official docs. Thanks, Joe __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From al-mongrelusers at none.at Fri Oct 6 03:56:56 2006 From: al-mongrelusers at none.at (Alexander Lazic) Date: Fri, 6 Oct 2006 09:56:56 +0200 Subject: [Mongrel] Site statistics In-Reply-To: <20061005233453.23093.qmail@server285.com> References: <20061005233453.23093.qmail@server285.com> Message-ID: <20061006075656.GB26560@none.at> Hi, On Don 05.10.2006 17:34, andrew wrote: > >I was wondering what everyone else does in regards to getting webalizer >or other site statistics software to work with mongrel. I currently >have a mongrel cluster running behind apache 2.2 with >proxy_mod_balancer, but I"m finding that webalizer isn't too thrilled >with that mod. I'am not sure if I understand you right but why isn't the apache log enough? Regards Alex From kraemer at webit.de Fri Oct 6 04:07:10 2006 From: kraemer at webit.de (Jens Kraemer) Date: Fri, 6 Oct 2006 10:07:10 +0200 Subject: [Mongrel] Site statistics In-Reply-To: <20061005233453.23093.qmail@server285.com> References: <20061005233453.23093.qmail@server285.com> Message-ID: <20061006080710.GG5467@cordoba.webit.de> On Thu, Oct 05, 2006 at 05:34:53PM -0600, andrew wrote: > Hey, > I was wondering what everyone else does in regards to getting > webalizer or other site statistics software to work with mongrel. > I currently have a mongrel cluster running behind apache 2.2 > with proxy_mod_balancer, but I"m finding that webalizer isn't > too thrilled with that mod. I don't know about webalizer, but I have several Apache/Mongrel sites with awstats statistics. I just configure Apache logging as usual, without anything mongrel specific. What's your exact problem ? 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 me at seebq.com Fri Oct 6 09:26:01 2006 From: me at seebq.com (Charles Brian Quinn) Date: Fri, 6 Oct 2006 09:26:01 -0400 Subject: [Mongrel] Site statistics In-Reply-To: <20061006080710.GG5467@cordoba.webit.de> References: <20061005233453.23093.qmail@server285.com> <20061006080710.GG5467@cordoba.webit.de> Message-ID: <3a2de0cd0610060626t19c33984ic7512afd607b339a@mail.gmail.com> We're using stats fine, too, this is an apache configuration -- bypassing mongrel altogether: Just toss this somewhere apache will pickup, and put in a dns entry for webstats.domain.com to your main web box. ServerName webstats.domain.com ServerAdmin webmaster at domain.com DocumentRoot "/var/www/html/webalizer" ErrorLog /usr/local/apache2/logs/webstats.domain.com-error_log CustomLog /usr/local/apache2/logs/webstats.domain.com-access-combined.log combined Options FollowSymLinks AllowOverride None Order allow,deny Allow from all On 10/6/06, Jens Kraemer wrote: > On Thu, Oct 05, 2006 at 05:34:53PM -0600, andrew wrote: > > Hey, > > I was wondering what everyone else does in regards to getting > > webalizer or other site statistics software to work with mongrel. > > I currently have a mongrel cluster running behind apache 2.2 > > with proxy_mod_balancer, but I"m finding that webalizer isn't > > too thrilled with that mod. > > I don't know about webalizer, but I have several Apache/Mongrel sites > with awstats statistics. I just configure Apache logging as usual, > without anything mongrel specific. > > What's your exact problem ? > > 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 > _______________________________________________ > 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 donaldmarino at mac.com Fri Oct 6 11:58:36 2006 From: donaldmarino at mac.com (Donald Marino) Date: Fri, 6 Oct 2006 09:58:36 -0600 Subject: [Mongrel] Mongrel is crashing under heavy loads Message-ID: Hi We're running mongrel on CentOS 4.2 with Apache httpd 2.2 mod_proxy_balancer, mongrel_cluster-0.2.0, Rails 1.1.6, Ruby 1.8.4, Pg 8.1.4 backend. We are on the verge of going live with our site and I am stress testing the server. What we are seeing is under heavy loads, our mongrels will seg fault and die one by one. Following the advice in a previous thread (http://www.mail- archive.com/mongrel-users at rubyforge.org/msg01734.html), I installed mongrel 0.3.13.5, but the problem remains The line in particular that appears to be breaking is: $mongrel_sleeper_thread = Thread.new { loop { sleep 1 } } Found at line 274 of configurator.rb I do have a core file, but I'm not really proficient with gdb. I can send it along if someone is interested. I'm using JMeter to simulate loads on the server. The mongrels only seem to die under high loads. Anyone have any ideas why this isn't stable for us? We'd like to be able to go live with this setup if we can figure this out. Thanks, Donnie Donald Marino donaldmarino at mac dot com From zedshaw at zedshaw.com Fri Oct 6 08:31:18 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 6 Oct 2006 05:31:18 -0700 Subject: [Mongrel] webalizer for mongrel? In-Reply-To: <20061006001118.27051.qmail@server285.com> References: <20061006001118.27051.qmail@server285.com> Message-ID: <20061006053118.4525a219.zedshaw@zedshaw.com> On Thu, 05 Oct 2006 18:11:18 -0600 "andrew" wrote: > Hey, > > I sent out an email a while ago, I am still not seeing it show up. > Sorry if this is a double post.. > Is there a way to make webalizer work with mongrel? Some folks replied, but I'll give the official answer: no. You should be putting Mongrel behind something like apache which can do the logs much better. -- 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 wyhaines at gmail.com Fri Oct 6 17:55:51 2006 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 6 Oct 2006 15:55:51 -0600 Subject: [Mongrel] Mongrel is crashing under heavy loads In-Reply-To: References: Message-ID: On 10/6/06, Donald Marino wrote: > I'm using JMeter to simulate loads on the server. The mongrels only > seem to die under high loads. > Anyone have any ideas why this isn't stable for us? We'd like to be > able to go live with this setup if we can figure this out. What sort of loads are you calling high loads? High levels of concurrency? How high? Kirk Haines From zedshaw at zedshaw.com Fri Oct 6 11:15:02 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 6 Oct 2006 08:15:02 -0700 Subject: [Mongrel] Mongrel is crashing under heavy loads In-Reply-To: References: Message-ID: <20061006081502.97a174b3.zedshaw@zedshaw.com> On Fri, 6 Oct 2006 09:58:36 -0600 Donald Marino wrote: > Hi > > The line in particular that appears to be breaking is: > > $mongrel_sleeper_thread = Thread.new { loop { sleep 1 } } > > Found at line 274 of configurator.rb Well, there's not a whole lot Mongrel can do to keep Ruby from segfaults. I'd suggest just removing this line or commenting it out for now. What that does is keep a thread going so that Ruby will actually exit when told to (since, for some dumbass reason select() in Ruby needs one thread to actually exit without IO). If you still segfault after this, then you'll have to do the following: 1) grab the ruby source and recompile with debugging turned on (probably requires: CFLAGS="-g" make) 2) run your app until it explodes again and keep the core file. 3) open the core file in gdb and type: backtrace 4) take whatever gdb says is the ruby backtrace and post it to ruby-lang asking for help. Someone there might know (if they don't argue with your for days on end about the merits of OS level VM malloc strategies and how it's not really a bug). If you get ultra stuck, contact me off-list and i'll try to help, but there's probably not much I can do since I'm not a ruby internals expert (more of a death ninja hater really). -- 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 carl.lerche at gmail.com Mon Oct 9 14:40:20 2006 From: carl.lerche at gmail.com (Carl Lerche) Date: Mon, 9 Oct 2006 11:40:20 -0700 Subject: [Mongrel] Log rotation In-Reply-To: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> References: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> Message-ID: You can do something like this in environment.rb config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 50, 4194304) Check the docs for Logger for more information. -carl On 10/1/06, David Vrensk wrote: > Hi mongrel-herders, > > I'm just wondering what fellow railsers use to rotate their logs in an > orderly fashion? I'd like to do something lightweight, i.e. (1) rename the > logfile (2, optional) create a new empty logfile and (3) send a signal to > each mongrel in the cluster and have them understand it's time to reopen > their log file handles. This is what I do with apache and nginx and loads > of other apps. > > Although the question is simple as stated, let me elaborate a little to > avoid having the discussion going the wrong way (rein it in, as it were): > > 1. I'm really only concerned about production.log, since that is the big > file. A solution that lets me rotate mongrel.log too is fine, but not > necessary. > > 2. I know I can send a SIGUSR2 to each mongrel (or do a mongrel_cluster > restart) to restart mongrel, but I'm running on a low-end machine which > takes no less than 30 seconds to start rails, so I'd rather avoid the > overhead. And even if it didn't, I think most of us agree that there's no > real point in stopping out app even for a second just to reopen a file > handle. > > 3. I realise that mongrel isn't rails-bound, so it might not be mongrel's > responsibility to make rails switch log files. In that case, please point > me in another direction and I'll see what I find. > > 4. I see that I can send a SIGHUP to mongrel which might make it do the > right thing, but the caveat "(Internal reload) that might not work so well." > is all but encouraging. > > Seeing as I've come this far, perhaps I should take a step back and ask: > what do fellow mongrel_railsers use for logging? Logger? Log4R? Something > else entirely? And what made you decide on the solution you use? > > Hope you haven't choked on my ramblings, and I look forward to your > collective wisdom! > > /David > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From dee.zsombor at gmail.com Wed Oct 11 03:16:24 2006 From: dee.zsombor at gmail.com (Dee Zsombor) Date: Wed, 11 Oct 2006 10:16:24 +0300 Subject: [Mongrel] Log rotation In-Reply-To: References: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> Message-ID: <452C9A48.9030203@gmail.com> Carl Lerche wrote: > You can do something like this in environment.rb > > config.logger = > Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 50, 4194304) Or use a custom script for well established logrotate. For once this is already used to rotate other logs in the system, and will work correctly unlike the above snippet prone to failure if multiple ruby processes try to rotate at the same time. -- Company - http://primalgrasp.com Thoughts - http://deezsombor.blogspot.com From david at vrensk.com Wed Oct 11 04:27:45 2006 From: david at vrensk.com (David Vrensk) Date: Wed, 11 Oct 2006 10:27:45 +0200 Subject: [Mongrel] Log rotation In-Reply-To: References: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> Message-ID: <81b453920610110127u275765c2i525969ab7f3e53c5@mail.gmail.com> On 10/9/06, Carl Lerche wrote: > > You can do something like this in environment.rb > > config.logger = > Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 50, 4194304) > > Check the docs for Logger for more information. Hi Carl, I will definately investigate that. It seems simple enough, but at the same time it stirs the suspicion that all my mongrels (or really, the railses in the mongrels) are writing to the same file with no locking. I will have to read me some source code. Thanks for the tip! /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061011/ad59411a/attachment.html From david at vrensk.com Wed Oct 11 08:39:43 2006 From: david at vrensk.com (David Vrensk) Date: Wed, 11 Oct 2006 14:39:43 +0200 Subject: [Mongrel] Log rotation In-Reply-To: <452C9A48.9030203@gmail.com> References: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> <452C9A48.9030203@gmail.com> Message-ID: <81b453920610110539x4b454101xa9b3a766871c7be6@mail.gmail.com> On 10/11/06, Dee Zsombor wrote: > > > Or use a custom script for well established logrotate. For once this is > already used to rotate other logs in the system, and will work correctly > unlike the above snippet prone to failure if multiple ruby processes try > to rotate at the same time. Yes, that would be preferrable. But all logrotate does is (1) rename the log file and (2, optional) send a signal to the application to let it know that the log file has been renamed, and hence, the application should close its file handle and open a new one. Rails and Mongrel don't answer to a signal with the semantics of (2) AFAIK. Logrotate can also be used with applications that don't answer to a signal but instead periodically (every five minutes or so) reopen their log file handle. My experiments with Rails in Mongrel indicate that Rails does not do this. But maybe I didn't wait long enough? Either way, I don't want to rely on Rails reopening the log files, since there is no guarantee that different processes will do it at the same time. So, thanks for your suggestion, but I'm afraid it won't solve the problem. /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061011/9d985130/attachment.html From michaelparkin at gmail.com Wed Oct 11 11:06:34 2006 From: michaelparkin at gmail.com (Michael Parkin) Date: Wed, 11 Oct 2006 16:06:34 +0100 Subject: [Mongrel] Mongrel HTTP Header Problem Message-ID: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> Hi, I've recently been trying to setup Mongrel behind Pound so that I can do mutual SSL authentication. I've had a few problems with Pound (documented at [1]), but now have it working correctly. However, I think there is a problem with Mongrel and how it deals with the headers Pound adds to the HTTP header block. One of the extra headers Pound adds is 'X-SSL-certificate' - the full multi-line client certificate in PEM format. As the certificate is spread over multiple lines like this: X-SSL-certificate: -----BEGIN CERTIFICATE----- MIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx ... Yhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3 RA== -----END CERTIFICATE----- ...with a carriage return between each line Mongrel, it seems, cannot handle the line breaks in the header and with this header present returns an internal server error '500'. Looking at RFC 2616 it seems that whitespace such as this _is_ allowed in the header block. Section 4.2 says "Header fields can be extended over multiple lines by preceding each extra line with at least one SP or HT" - which is exactly what Pound does. Therefore, I think the problem may be with Mongrel. I've tested this by doing the following: 1) Sniffed the whole HTTP message sent from Pound -> Mongrel using tcpmon. (Fails - returns 'internal server error' / 500). 2) Replaying the message into Mongrel directly using telnet, cutting out the X-SSL-certificate header. Mongrel responds correctly (200). 3) Added in my own arbitary header with a carriage return in it. Mongrel again returns 500. I turned on debugging with the '-B' option hoping there would be something in the log files, but they're empty. Can anyone else confirm that caarriage returns in HTTP headers is a problem for Mongrel? Many thanks, Michael. [1] http://www.apsis.ch/pound/pound_list/archive/2006/2006-10/1159900707000 From railsinator at gmail.com Wed Oct 11 12:27:55 2006 From: railsinator at gmail.com (Kelly Felkins) Date: Wed, 11 Oct 2006 09:27:55 -0700 Subject: [Mongrel] mongrel_cluster not starting on reboot In-Reply-To: <33841ac70608152022y29a07bces397a4287121e4c6d@mail.gmail.com> References: <33841ac70608151555g248359d8o3414dc2358b3ef42@mail.gmail.com> <33841ac70608151726n292c51fpc38b35dec6f2ff6e@mail.gmail.com> <9271BB62-DAF8-4EC5-9BF1-98BCC19E2D9C@joyent.com> <33841ac70608152022y29a07bces397a4287121e4c6d@mail.gmail.com> Message-ID: > > > Jason, > > I found out Rimuhosting supports console-over-ssh. That is sweet! > Once I logged in I noticed this line: > Where did you notice this? I can't get my mongrels to restart on boot. I'm running debian on rimu, if that's important. Any help is appreciated. -Kelly -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061011/f2b1d5c2/attachment.html From railsinator at gmail.com Wed Oct 11 14:16:31 2006 From: railsinator at gmail.com (Kelly Felkins) Date: Wed, 11 Oct 2006 11:16:31 -0700 Subject: [Mongrel] Getting /etc/mongrel_cluster and startup script to work? In-Reply-To: <447EF533.9030901@fastmail.fm> References: <447CA2EA.8060106@uberhip.com> <50c31cc40605311850u2badb44ctbc258d039a24e725@mail.gmail.com> <447EF533.9030901@fastmail.fm> Message-ID: On 6/1/06, Alison Rowland wrote: snip But on bootup (thanks to my hosting provider's tech support guy for > tipping me off on this), it was throwing this error: > > /usr/bin/env: ruby: No such file or directory > I'm probably having a similar problem, but I don't know where to look. How did your tech support guy determine this? Is this in a log file? Sorry, my sysadmin skills are not the best. -Kelly -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061011/1a55324e/attachment-0001.html From alisonrowland at fastmail.fm Wed Oct 11 15:06:35 2006 From: alisonrowland at fastmail.fm (Alison Rowland) Date: Wed, 11 Oct 2006 12:06:35 -0700 Subject: [Mongrel] Getting /etc/mongrel_cluster and startup script to work? In-Reply-To: References: <447CA2EA.8060106@uberhip.com> <50c31cc40605311850u2badb44ctbc258d039a24e725@mail.gmail.com> <447EF533.9030901@fastmail.fm> Message-ID: <1160593595.6631.273107376@webmail.messagingengine.com> You need to log in via console-over-ssh (you'll find this in your Rimu control panel), and restart your server. Then you'll be able to see its boot process and any error messages thrown. --Alison On Wed, 11 Oct 2006 11:16:31 -0700, "Kelly Felkins" said: > On 6/1/06, Alison Rowland wrote: > snip > > But on bootup (thanks to my hosting provider's tech support guy for > > tipping me off on this), it was throwing this error: > > > > /usr/bin/env: ruby: No such file or directory > > > > I'm probably having a similar problem, but I don't know where to look. > How > did your tech support guy determine this? Is this in a log file? Sorry, > my > sysadmin skills are not the best. > > -Kelly -- Alison Rowland alisonrowland at fastmail.fm From dee.zsombor at gmail.com Wed Oct 11 16:37:45 2006 From: dee.zsombor at gmail.com (Dee Zsombor) Date: Wed, 11 Oct 2006 23:37:45 +0300 Subject: [Mongrel] Log rotation In-Reply-To: <81b453920610110539x4b454101xa9b3a766871c7be6@mail.gmail.com> References: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> <452C9A48.9030203@gmail.com> <81b453920610110539x4b454101xa9b3a766871c7be6@mail.gmail.com> Message-ID: <452D5619.2010205@gmail.com> David Vrensk wrote: > Yes, that would be preferrable. But all logrotate does is (1) rename > the log file and (2, optional) send a signal to the application to let > it know that the log file has been renamed, and hence, the application > should close its file handle and open a new one. Rails and Mongrel > don't answer to a signal with the semantics of (2) AFAIK. The same code you execute upon deploy to bounce your application servers can be used to a similar effect, with no more user noticeable downtime (or risk) as simple deployment. Just have to configure logrotate with a custom post rotate hook. Zsombor -- Company - http://primalgrasp.com Thoughts - http://deezsombor.blogspot.com From zedshaw at zedshaw.com Wed Oct 11 20:17:25 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 11 Oct 2006 17:17:25 -0700 Subject: [Mongrel] Mongrel HTTP Header Problem In-Reply-To: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> References: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> Message-ID: <20061011171725.dbcc8efd.zedshaw@zedshaw.com> On Wed, 11 Oct 2006 16:06:34 +0100 "Michael Parkin" wrote: > Hi, > > I've recently been trying to setup Mongrel behind Pound so that I can > do mutual SSL authentication. I've had a few problems with Pound > (documented at [1]), but now have it working correctly. > So with Pound... > However, I think there is a problem with Mongrel and how it deals with > the headers Pound adds to the HTTP header block. One of the extra > headers Pound adds is 'X-SSL-certificate' - the full multi-line client > certificate in PEM format. As the certificate is spread over multiple > lines like this: > > X-SSL-certificate: -----BEGIN CERTIFICATE----- > MIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx > ... > Yhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3 > RA== > -----END CERTIFICATE----- > You have some need to send the client's certificate in a bizarre header? Ok, before I go about answer your question you should probably explain what it is you're trying to do with this. There might be a simpler way. > ...with a carriage return between each line Mongrel, it seems, cannot > handle the line breaks in the header and with this header present > returns an internal server error '500'. > > Looking at RFC 2616 it seems that whitespace such as this _is_ allowed > in the header block. Section 4.2 says "Header fields can be extended > over multiple lines by preceding each extra line with at least one SP > or HT" - which is exactly what Pound does. Therefore, I think the > problem may be with Mongrel. > That is a horrible bastardization of the RFC and I'd consider it an abuse of the headers, especially since only Pound does this out of *all* the HTTP clients people have used. I'd almost tell them to screw off on principle (especially since they can encode this without the newlines). But, let's look at the Mongrel grammar for headers: field_name = (token -- ":")+ >start_field %write_field; field_value = any* >start_value %write_value; message_header = field_name ":" " "* field_value :> CRLF; Says right there field_value accepts "any*" and it's closed by a CRLF. Probably just have to make the exit stronger so that it can include CR or LF but not both. If you work up a test case that demonstrates it (preferably a patch to the mongrel tests) then I can fix it up. > I've tested this by doing the following: > One thing you didn't do is give me information from the mongrel.log. There should have been BAD CLIENT information in there. You also didn't turn on USR1 logging so that Mongrel dumps the whole request that caused BAD CLIENT errors. If you do send in a test case then include this information too. -- 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 donaldmarino at mac.com Wed Oct 11 17:21:22 2006 From: donaldmarino at mac.com (Donald Marino) Date: Wed, 11 Oct 2006 15:21:22 -0600 Subject: [Mongrel] Mongrel is crashing under heavy loads In-Reply-To: <20061006081502.97a174b3.zedshaw@zedshaw.com> References: <20061006081502.97a174b3.zedshaw@zedshaw.com> Message-ID: Zed,Kirk, Thanks for your replies. I commented out line 274 of configurator.rb and was unable to replicate the crash after that. As far as loads, I suppose it's always relative, I'd say these loads aren't really what most would call 'heavy' But, in the end, those crashes were happening under any load, it was just apparent more quickly under load. I was using up to 5 JMeter clients to simulate loads of 4,8,16,32,64,128, and 256 concurrent users logging in, hitting 8 URLs and logging out, repeatedly. I did this first with 8 mongrel servers on the balancer and then with 16 mongrels. So, for now, we're going to call it good as I can't replicate the 'crash' with that line removed. If I come across this again I'll repost with better incident info. Thanks, Donnie donaldmarino-at-mac-dot-com On Oct 6, 2006, at 9:15 AM, Zed A. Shaw wrote: > On Fri, 6 Oct 2006 09:58:36 -0600 > Donald Marino wrote: > >> Hi > >> >> The line in particular that appears to be breaking is: >> >> $mongrel_sleeper_thread = Thread.new { loop { sleep 1 } } >> >> Found at line 274 of configurator.rb > > > Well, there's not a whole lot Mongrel can do to keep Ruby from > segfaults. I'd suggest just removing this line or commenting it > out for now. What that does is keep a thread going so that Ruby > will actually exit when told to (since, for some dumbass reason > select() in Ruby needs one thread to actually exit without IO). > > If you still segfault after this, then you'll have to do the > following: > > 1) grab the ruby source and recompile with debugging turned on > (probably requires: CFLAGS="-g" make) > 2) run your app until it explodes again and keep the core file. > 3) open the core file in gdb and type: backtrace > 4) take whatever gdb says is the ruby backtrace and post it to ruby- > lang asking for help. Someone there might know (if they don't > argue with your for days on end about the merits of OS level VM > malloc strategies and how it's not really a bug). > > If you get ultra stuck, contact me off-list and i'll try to help, > but there's probably not much I can do since I'm not a ruby > internals expert (more of a death ninja hater really). > > -- > 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 zackchandler at gmail.com Wed Oct 11 18:20:00 2006 From: zackchandler at gmail.com (Zack Chandler) Date: Wed, 11 Oct 2006 15:20:00 -0700 Subject: [Mongrel] mongrel_cluster not starting on reboot In-Reply-To: References: <33841ac70608151555g248359d8o3414dc2358b3ef42@mail.gmail.com> <33841ac70608151726n292c51fpc38b35dec6f2ff6e@mail.gmail.com> <9271BB62-DAF8-4EC5-9BF1-98BCC19E2D9C@joyent.com> <33841ac70608152022y29a07bces397a4287121e4c6d@mail.gmail.com> Message-ID: <33841ac70610111520n6e6559c9lb268145a9be3ab02@mail.gmail.com> Kelly, You probably need to symlink mongrel_cluster_ctl and mongrel_rails to /usr/bin as /usr/local/bin is not in the debian boot path. You can see how I did it here: http://depixelate.com/2006/8/15/switched-to-mongrel I would also recommend using Rimu's console-over-ssh to sniff out the problem. Hope this helps, Zack On 10/11/06, Kelly Felkins wrote: > > > > > Jason, > > > > I found out Rimuhosting supports console-over-ssh. That is sweet! > > Once I logged in I noticed this line: > > > > Where did you notice this? I can't get my mongrels to restart on boot. > > I'm running debian on rimu, if that's important. > > Any help is appreciated. > > -Kelly > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From lists at lastonepicked.com Wed Oct 11 18:40:31 2006 From: lists at lastonepicked.com (HH) Date: Wed, 11 Oct 2006 15:40:31 -0700 Subject: [Mongrel] Upload Progress and Finishing Up Message-ID: I posted this on Rick's Beast forum but got zilch so I am gonna try it here: Ok, I have been fiddling with this trying to integrate it into my app. I believe I?m just having a bit of trouble with the last part? In the example, the upload action doesn?t really return, it renders some ?text?, that basically then invokes a ?cleanup? method on the JavaScript. Well, I want to do a few of my own things when the action finishes so I was thinking, RJS? Well, I?m having trouble. Basically, the JavaScript is being rendered as text in the iFrame (Safari 2.0). I have this code at the end of my upload action: render :update do |page| page << "window.parent.UploadProgress.finish();" page.insert_html :before, 'file_upload_box', :partial => '/collection/file_item', :locals => {:file_item => @new_pd_file} page.visual_effect :fade, "file_item#{@new_pd_file.id}" end The idea is that it calls the JavaScript finish and then it inserts a new TR in my table, showing the item that was just uploaded. Instead I just see the rendered JavaScript in the iFrame. Any ideas why this isn?t working? What am I doing wrong? From msoulier at digitaltorque.ca Wed Oct 11 18:50:02 2006 From: msoulier at digitaltorque.ca (Michael P. Soulier) Date: Wed, 11 Oct 2006 18:50:02 -0400 Subject: [Mongrel] Log rotation In-Reply-To: <452D5619.2010205@gmail.com> References: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> <452C9A48.9030203@gmail.com> <81b453920610110539x4b454101xa9b3a766871c7be6@mail.gmail.com> <452D5619.2010205@gmail.com> Message-ID: <20061011225002.GK27560@tigger.digitaltorque.ca> On 11/10/06 Dee Zsombor said: > The same code you execute upon deploy to bounce your application servers > can be used to a similar effect, with no more user noticeable downtime (or > risk) as simple deployment. Just have to configure logrotate with a > custom post rotate hook. I supervise mongrel_rails via runit. From there, if Rails would log to stdout I could use svlogd which would handle timestamps and rotation on its own. I'm on BSD so for now I've configured newsyslog to rotate the rails logs. Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." --Albert Einstein -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061011/65cc5fbc/attachment.bin From david at vrensk.com Wed Oct 11 20:16:51 2006 From: david at vrensk.com (David Vrensk) Date: Thu, 12 Oct 2006 02:16:51 +0200 Subject: [Mongrel] Log rotation In-Reply-To: <452D5619.2010205@gmail.com> References: <81b453920610011156n3c314496uf3e82ad3e533086a@mail.gmail.com> <452C9A48.9030203@gmail.com> <81b453920610110539x4b454101xa9b3a766871c7be6@mail.gmail.com> <452D5619.2010205@gmail.com> Message-ID: <81b453920610111716g397e711dje14e9bd28f96a691@mail.gmail.com> On 10/11/06, Dee Zsombor wrote: > > David Vrensk wrote: > > > Yes, that would be preferrable. But all logrotate does is (1) rename > > the log file and (2, optional) send a signal to the application to let > > it know that the log file has been renamed, and hence, the application > > should close its file handle and open a new one. Rails and Mongrel > > don't answer to a signal with the semantics of (2) AFAIK. > > The same code you execute upon deploy to bounce your application servers > can be used to a similar effect, with no more user noticeable downtime (or > risk) as simple deployment. Just have to configure logrotate with a > custom post rotate hook. Ah yes. Unfortunately my app runs on a slow VPS, and the restart time is 30 seconds. So I really want Rails to behave like the other puppies. But I guess that I should take the question to the rails list since this isn't a mongrel issue as such. Thank you all for your help! /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061012/5b2c17a8/attachment.html From al-mongrelusers at none.at Thu Oct 12 03:51:00 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Thu, 12 Oct 2006 09:51:00 +0200 Subject: [Mongrel] Mongrel HTTP Header Problem In-Reply-To: <20061011171725.dbcc8efd.zedshaw@zedshaw.com> References: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> <20061011171725.dbcc8efd.zedshaw@zedshaw.com> Message-ID: <20061012075100.GA17990@none.at> Hi, On Mit 11.10.2006 17:17, Zed A. Shaw wrote: >On Wed, 11 Oct 2006 16:06:34 +0100 >"Michael Parkin" wrote: > >> ...with a carriage return between each line Mongrel, it seems, cannot >> handle the line breaks in the header and with this header present >> returns an internal server error '500'. >> >> Looking at RFC 2616 it seems that whitespace such as this _is_ >> allowed in the header block. Section 4.2 says "Header fields can be >> extended over multiple lines by preceding each extra line with at >> least one SP or HT" - which is exactly what Pound does. Therefore, I >> think the problem may be with Mongrel. > >That is a horrible bastardization of the RFC and I'd consider it an >abuse of the headers, especially since only Pound does this out of >*all* the HTTP clients people have used. I'd almost tell them to screw >off on principle (especially since they can encode this without the >newlines). Let's look at http://www.and.org/texts/server-http, I think it's a nice conclusion of the rfc. Regards Aleks From zedshaw at zedshaw.com Thu Oct 12 08:01:30 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 12 Oct 2006 05:01:30 -0700 Subject: [Mongrel] Mongrel HTTP Header Problem In-Reply-To: <20061012075100.GA17990@none.at> References: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> <20061011171725.dbcc8efd.zedshaw@zedshaw.com> <20061012075100.GA17990@none.at> Message-ID: <20061012050130.432d1b30.zedshaw@zedshaw.com> On Thu, 12 Oct 2006 09:51:00 +0200 Aleksandar Lazic wrote: > Hi, > > On Mit 11.10.2006 17:17, Zed A. Shaw wrote: > >On Wed, 11 Oct 2006 16:06:34 +0100 > >"Michael Parkin" wrote: > > > >> ...with a carriage return between each line Mongrel, it seems, cannot > >> handle the line breaks in the header and with this header present > >> returns an internal server error '500'. > >> > >> Looking at RFC 2616 it seems that whitespace such as this _is_ > >> allowed in the header block. Section 4.2 says "Header fields can be > >> extended over multiple lines by preceding each extra line with at > >> least one SP or HT" - which is exactly what Pound does. Therefore, I > >> think the problem may be with Mongrel. > > > >That is a horrible bastardization of the RFC and I'd consider it an > >abuse of the headers, especially since only Pound does this out of > >*all* the HTTP clients people have used. I'd almost tell them to screw > >off on principle (especially since they can encode this without the > >newlines). > > Let's look at http://www.and.org/texts/server-http, I think it's a nice > conclusion of the rfc. > Yeah, too bad guys like me who don't have the baking of 400 such billion dollar companies get any say in these things. As I've said millions of times before, just because the damn RFC says it's allowed doesn't mean people should be allowed to do it. Just nasty. Then again, I also said that it's a simple fix as long as I have a good test case. -- 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 krisleech at interkonect.com Thu Oct 12 05:34:17 2006 From: krisleech at interkonect.com (Kris Leech) Date: Thu, 12 Oct 2006 10:34:17 +0100 Subject: [Mongrel] Mongrel HTTP Header Problem In-Reply-To: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> References: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> Message-ID: <452E0C19.3040503@interkonect.com> Michael Parkin wrote: >Hi, > >I've recently been trying to setup Mongrel behind Pound so that I can >do mutual SSL authentication. I've had a few problems with Pound >(documented at [1]), but now have it working correctly. > >However, I think there is a problem with Mongrel and how it deals with >the headers Pound adds to the HTTP header block. One of the extra >headers Pound adds is 'X-SSL-certificate' - the full multi-line client >certificate in PEM format. As the certificate is spread over multiple >lines like this: > >X-SSL-certificate: -----BEGIN CERTIFICATE----- > MIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx > ... > Yhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3 > RA== > -----END CERTIFICATE----- > > Do you actually need to use the certificate down stream, if not and you just need to know the original request was SSL'd then pound should add X-FORWARD type header instead... >...with a carriage return between each line Mongrel, it seems, cannot >handle the line breaks in the header and with this header present >returns an internal server error '500'. > >Looking at RFC 2616 it seems that whitespace such as this _is_ allowed >in the header block. Section 4.2 says "Header fields can be extended >over multiple lines by preceding each extra line with at least one SP >or HT" - which is exactly what Pound does. Therefore, I think the >problem may be with Mongrel. > >I've tested this by doing the following: > >1) Sniffed the whole HTTP message sent from Pound -> Mongrel using >tcpmon. (Fails - returns 'internal server error' / 500). > >2) Replaying the message into Mongrel directly using telnet, cutting >out the X-SSL-certificate header. Mongrel responds correctly (200). > >3) Added in my own arbitary header with a carriage return in it. >Mongrel again returns 500. > >I turned on debugging with the '-B' option hoping there would be >something in the log files, but they're empty. > >Can anyone else confirm that caarriage returns in HTTP headers is a >problem for Mongrel? > >Many thanks, > >Michael. > >[1] http://www.apsis.ch/pound/pound_list/archive/2006/2006-10/1159900707000 >_______________________________________________ >Mongrel-users mailing list >Mongrel-users at rubyforge.org >http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > From michaelparkin at gmail.com Thu Oct 12 06:18:37 2006 From: michaelparkin at gmail.com (Michael Parkin) Date: Thu, 12 Oct 2006 11:18:37 +0100 Subject: [Mongrel] Mongrel HTTP Header Problem In-Reply-To: <20061011171725.dbcc8efd.zedshaw@zedshaw.com> References: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> <20061011171725.dbcc8efd.zedshaw@zedshaw.com> Message-ID: <1c78e1e70610120318m49941e8k304b9078d198c1f1@mail.gmail.com> Hi Zed, Thanks for the reply. I'm new to Ruby, Mongrel, Rails, etc. So please bear with me... On 10/12/06, Zed A. Shaw wrote: > You have some need to send the client's certificate in a bizarre header? Ok, before I go about answer your question you should probably explain what it is you're trying to do with this. There might be a simpler way. Actually, no - I don't have any use for this header that Pound sends Mongrel. But, AFAIK there's no way to remove it from the headers Pound sends (ok, I could go in an hack Pound's source, but I want to have standard code on my boxes...) > If you work up a test case that demonstrates it (preferably a patch to the mongrel tests) then I can fix it up. ok, as I've said I'm new to Ruby and I'm using developing this application as a way to learn. This may take some time! > One thing you didn't do is give me information from the mongrel.log. There should have been BAD CLIENT information in there. There's nothing in mongrel.log apart from the standard startup blurb. I.e: ** Daemonized, any open files are closed. Look at log/mongrel.pid and log/mongrel.log for info. ** Starting Mongrel listening at 127.0.0.1:3000 ... ** Writing PID file to log/mongrel.pid > You also didn't turn on USR1 logging so that Mongrel dumps the whole request that caused BAD CLIENT errors. If you do send in a test case then include this information too. Thanks for the USR1 tip: when I turn on USR1 I get the output at the bottom of the email. Is it the \r\n\t's in the "X-SSL-certificate" header that's the problem here? Thanks again, Michael. ** USR1 received, toggling $mongrel_debug_client to true Thu Oct 12 11:04:48 +0100 2006: BAD CLIENT (127.0.0.1): Invalid HTTP format, parsing fails. Thu Oct 12 11:04:48 +0100 2006: REQUEST DATA: "GET / HTTP/1.1\r\nUser-Agent: curl/7.13.1 (powerpc-apple-darwin8.0) libcurl/7.13.1 OpenSSL/0.9.7i zlib/1.2.3\r\nHost: 127.0.0.1:3001\r\nPragma: no-cache\r\nAccept: */*\r\nX-Forwarded-Proto: https\r\nX-SSL-Subject: C = xx, O = xx, OU = xx, L = xx, CN = michael parkin\r\nX-SSL-Issuer: C = UK, O = eScience, OU = Authority, CN = CA, emailAddress = ca-operator at grid-support.ac.uk\r\nX-SSL-notBefore: Jun 19 12:10:30 2006 GMT\r\nX-SSL-notAfter: Jun 19 12:10:30 2007 GMT\r\nX-SSL-serial: 8061\r\nX-SSL-certificate: -----BEGIN CERTIFICATE-----\r\n\tMIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx\r\n\tETAPBgNVBAoTCGVTY2llbmNlMRIwEAYDVQQLEwlBdXRob3JpdHkxCzAJBgNVBAMT\r\n\tAkNBMS0wKwYJKoZIhvcNAQkBFh5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMu\r\n\tdWswHhcNMDYwNzI3MTQxMzI4WhcNMDcwNzI3MTQxMzI4WjBbMQswCQYDVQQGEwJV\r\n\tSzERMA8GA1UEChMIZVNjaWVuY2UxEzARBgNVBAsTCk1hbmNoZXN0ZXIxCzAJBgNV\r\n\tBAcTmrsogriqMWLAk1DMRcwFQYDVQQDEw5taWNoYWVsIHBhcmQYJKoZIhvcNAQEB\r\n\tBQADggEPADCCAQoCggEBANPEQBgl1IaKdSS1TbhF3hEXSl72G9J+WC/1R64fAcEF\r\n\tW51rEyFYiIeZGx/BVzwXbeBoNUK41OK65sxGuflMo5gLflbwJtHBRIEKAfVVp3YR\r\n\tgW7cMA/s/XKgL1GEC7rQw8lIZT8RApukCGqOVHSi/F1SiFlPDxuDfmdiNzL31+sL\r\n\t0iwHDdNkGjy5pyBSB8Y79dsSJtCW/iaLB0/n8Sj7HgvvZJ7x0fr+RQjYOUUfrePP\r\n\tu2MSpFyf+9BbC/aXgaZuiCvSR+8Snv3xApQY+fULK/xY8h8Ua51iXoQ5jrgu2SqR\r\n\twgA7BUi3G8LFzMBl8FRCDYGUDy7M6QaHXx1ZWIPWNKsCAwEAAaOCAiQwggIgMAwG\r\n\tA1UdEwEB/wQCMAAwEQYJYIZIAYb4QgEBBAQDAgWgMA4GA1UdDwEB/wQEAwID6DAs\r\n\tBglghkgBhvhCAQ0EHxYdVUsgZS1TY2llbmNlIFVzZXIgQ2VydGlmaWNhdGUwHQYD\r\n\tVR0OBBYEFDTt/sf9PeMaZDHkUIldrDYMNTBZMIGaBgNVHSMEgZIwgY+AFAI4qxGj\r\n\tloCLDdMVKwiljjDastqooXSkcjBwMQswCQYDVQQGEwJVSzERMA8GA1UEChMIZVNj\r\n\taWVuY2UxEjAQBgNVBAsTCUF1dGhvcml0eTELMAkGA1UEAxMCQ0ExLTArBgkqhkiG\r\n\t9w0BCQEWHmNhLW9wZXJhdG9yQGdyaWQtc3VwcG9ydC5hYy51a4IBADApBgNVHRIE\r\n\tIjAggR5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMudWswGQYDVR0gBBIwEDAO\r\n\tBgwrBgEEAdkvAQEBAQYwPQYJYIZIAYb4QgEEBDAWLmh0dHA6Ly9jYS5ncmlkLXN1\r\n\tcHBvcnQuYWMudmT4sopwqlBWsvcHViL2NybC9jYWNybC5jcmwwPQYJYIZIAYb4QgEDBDAWLmh0\r\n\tdHA6Ly9jYS5ncmlkLXN1cHBvcnQuYWMudWsvcHViL2NybC9jYWNybC5jcmwwPwYD\r\n\tVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NhLmdyaWQt5hYy51ay9wdWIv\r\n\tY3JsL2NhY3JsLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAS/U4iiooBENGW/Hwmmd3\r\n\tXCy6Zrt08YjKCzGNjorT98g8uGsqYjSxv/hmi0qlnlHs+k/3Iobc3LjS5AMYr5L8\r\n\tUO7OSkgFFlLHQyC9JzPfmLCAugvzEbyv4Olnsr8hbxF1MbKZoQxUZtMVu29wjfXk\r\n\thTeApBv7eaKCWpSp7MCbvgzm74izKhu3vlDk9w6qVrxePfGgpKPqfHiOoGhFnbTK\r\n\twTC6o2xq5y0qZ03JonF7OJspEd3I5zKY3E+ov7/ZhW6DqT8UFvsAdjvQbXyhV8Eu\r\n\tYhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3\r\n\tRA==\r\n\t-----END CERTIFICATE-----\r\nX-SSL-cipher: AES256-SHA SSLv3 Kx=RSA Au=RSA Enc=AES(256) Mac=SHA1\r\nX-Forwarded-For: xxx.xxx.xxx.xxx\r\n\r\n" --- PARAMS: {"HTTP_X_SSL_NOTBEFORE"=>"Jun 19 12:10:30 2006 GMT", "HTTP_USER_AGENT"=>"curl/7.13.1 (powerpc-apple-darwin8.0) libcurl/7.13.1 OpenSSL/0.9.7i zlib/1.2.3", "HTTP_HOST"=>"127.0.0.1:3001", "HTTP_X_SSL_ISSUER"=>"C = UK, O = eScience, OU = Authority, CN = CA, emailAddress = ca-operator at grid-support.ac.uk", "REQUEST_PATH"=>"/", "HTTP_VERSION"=>"HTTP/1.1", "HTTP_X_SSL_CERTIFICATE"=>"-----BEGIN CERTIFICATE-----", "REQUEST_URI"=>"/", "HTTP_X_SSL_NOTAFTER"=>"Jun 19 12:10:30 2007 GMT", "HTTP_X_FORWARDED_PROTO"=>"https", "HTTP_PRAGMA"=>"no-cache", "HTTP_X_SSL_SERIAL"=>"8071", "HTTP_X_SSL_SUBJECT"=>"C = xx, O = xx, OU = xx, L = xx, CN = michael parkin", "HTTP_ACCEPT"=>"*/*", "REQUEST_METHOD"=>"GET"} From michaelparkin at gmail.com Thu Oct 12 06:22:16 2006 From: michaelparkin at gmail.com (Michael Parkin) Date: Thu, 12 Oct 2006 11:22:16 +0100 Subject: [Mongrel] Mongrel HTTP Header Problem In-Reply-To: <452E0C19.3040503@interkonect.com> References: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> <452E0C19.3040503@interkonect.com> Message-ID: <1c78e1e70610120322u2350e354qf04682e9b9fccbd0@mail.gmail.com> Hi Kris, On 10/12/06, Kris Leech wrote: > Do you actually need to use the certificate down stream, if not and you > just need to know the original request was SSL'd then pound should add > X-FORWARD type header instead... Actually, no I don't need the certificate downstream, but I do need the other SSL information Pound sends (like the X-SSL-Subject, for instance). I haven't figured out how to remove just the X-SSL-certificate header - any ideas? Thanks, Michael. From zedshaw at zedshaw.com Thu Oct 12 10:13:03 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 12 Oct 2006 07:13:03 -0700 Subject: [Mongrel] Mongrel HTTP Header Problem In-Reply-To: <1c78e1e70610120318m49941e8k304b9078d198c1f1@mail.gmail.com> References: <1c78e1e70610110806y6224356aja62078723b365173@mail.gmail.com> <20061011171725.dbcc8efd.zedshaw@zedshaw.com> <1c78e1e70610120318m49941e8k304b9078d198c1f1@mail.gmail.com> Message-ID: <20061012071303.933afbd0.zedshaw@zedshaw.com> On Thu, 12 Oct 2006 11:18:37 +0100 "Michael Parkin" wrote: > Hi Zed, > > Thanks for the reply. I'm new to Ruby, Mongrel, Rails, etc. So please > bear with me... > > On 10/12/06, Zed A. Shaw wrote: > > > You have some need to send the client's certificate in a bizarre header? Ok, before I go about answer your question you should probably explain what it is you're trying to do with this. There might be a simpler way. > > Actually, no - I don't have any use for this header that Pound sends > Mongrel. But, AFAIK there's no way to remove it from the headers Pound > sends (ok, I could go in an hack Pound's source, but I want to have > standard code on my boxes...) > No, there's gotta be a way to turn that off. If pound always sent this then people using pound would have yelled at me sooner. I'd have noticed it too since I test under pound. You've got a config telling pound to do this. > > Thanks for the USR1 tip: when I turn on USR1 I get the output at the > bottom of the email. Is it the \r\n\t's in the "X-SSL-certificate" > header that's the problem here? Ok, I can put this in a test as a raw send. Thanks I'll let you know when I toss this fix in. -- 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 andreas.korth at gmx.net Thu Oct 12 15:57:23 2006 From: andreas.korth at gmx.net (Andreas Korth) Date: Thu, 12 Oct 2006 21:57:23 +0200 Subject: [Mongrel] How to get a decent stack trace? Message-ID: <763F38FA-E9FB-4285-AD3A-8FC457CB64EB@gmx.net> Hi, I just gave Mongrel a try on my Rails app. After running 'mongrel_rails start' everything seems fine. Yet, when I start a request I get the following error message on the console: ERROR: You have a nil object when you didn't expect it! The error occured while evaluating nil.readpartial That's it. The application works fine with Webrick and Apache/fcgid. Mongrel happily serves other Rails apps on my system. Is there a way to get a complete stack trace from Mongrel, so I can figure out what's causing the problem? Thanks, Andy From zedshaw at zedshaw.com Thu Oct 12 19:25:36 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 12 Oct 2006 16:25:36 -0700 Subject: [Mongrel] How to get a decent stack trace? In-Reply-To: <763F38FA-E9FB-4285-AD3A-8FC457CB64EB@gmx.net> References: <763F38FA-E9FB-4285-AD3A-8FC457CB64EB@gmx.net> Message-ID: <20061012162536.0020cb1f.zedshaw@zedshaw.com> On Thu, 12 Oct 2006 21:57:23 +0200 Andreas Korth wrote: > Hi, > > I just gave Mongrel a try on my Rails app. After running > 'mongrel_rails start' everything seems fine. Yet, when I start a > request I get the following error message on the console: > > ERROR: You have a nil object when you didn't expect it! > The error occured while evaluating nil.readpartial > Hmm, that should happen. What version of Mongrel and Ruby. Also, try running your mongrel then do: killall -USR1 mongrel_rails When you do this it toggles "USR1 Debugging" which dumps more stack traces and information. -- 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 zedshaw at zedshaw.com Thu Oct 12 19:52:22 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 12 Oct 2006 16:52:22 -0700 Subject: [Mongrel] How to get a decent stack trace? In-Reply-To: <20061012162536.0020cb1f.zedshaw@zedshaw.com> References: <763F38FA-E9FB-4285-AD3A-8FC457CB64EB@gmx.net> <20061012162536.0020cb1f.zedshaw@zedshaw.com> Message-ID: <20061012165222.8a1aedf8.zedshaw@zedshaw.com> On Thu, 12 Oct 2006 16:25:36 -0700 "Zed A. Shaw" wrote: > On Thu, 12 Oct 2006 21:57:23 +0200 > Andreas Korth wrote: > > > Hi, > > > > I just gave Mongrel a try on my Rails app. After running > > 'mongrel_rails start' everything seems fine. Yet, when I start a > > request I get the following error message on the console: > > > > ERROR: You have a nil object when you didn't expect it! > > The error occured while evaluating nil.readpartial > > > > Hmm, that should happen. What version of Mongrel and Ruby. Also, try running your mongrel then do: > Correction: "should not happen" -- 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 andreas.korth at gmx.net Thu Oct 12 18:14:14 2006 From: andreas.korth at gmx.net (Andreas Korth) Date: Fri, 13 Oct 2006 00:14:14 +0200 Subject: [Mongrel] How to get a decent stack trace? In-Reply-To: <20061012162536.0020cb1f.zedshaw@zedshaw.com> References: <763F38FA-E9FB-4285-AD3A-8FC457CB64EB@gmx.net> <20061012162536.0020cb1f.zedshaw@zedshaw.com> Message-ID: On 13.10.2006, at 01:25, Zed A. Shaw wrote: >> ERROR: You have a nil object when you didn't expect it! >> The error occured while evaluating nil.readpartial > > Hmm, that should happen. You're actually right. If it messes around with the Thread class, this is exactly what it deserves. I'm doing such silly things sometimes, it frightens me. > killall -USR1 mongrel_rails > > When you do this it toggles "USR1 Debugging" which dumps more stack > traces and information. Thanks Zed - that did the trick. Cheers, Andy From DGeorgie at wiley.com Fri Oct 13 15:58:25 2006 From: DGeorgie at wiley.com (DGeorgie at wiley.com) Date: Fri, 13 Oct 2006 15:58:25 -0400 Subject: [Mongrel] Broken installation of mongrel 0.3.13.4 on Sun OS 5.9 Message-ID: Hi, Anyone succeeded in installing Mongrel on Sun Solaris? It looks like the installation is broken. I have started using Mongrel recently and not sure where to look when something is missing. First the file http11.so was not installed in /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib I've resolved that and when tried to start mongrel from the command line I received the following exception: ** Loading settings from config/mongrel_opts.conf (they override command line). ** Starting Mongrel listening at 0.0.0.0:8085 ** Starting Rails with production environment... /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:722:in `register': undefined method `resolve' for nil:Mongrel::URIClassifier (NoMethodError) from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:152:in `uri' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:112:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:134:in `listener' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:98:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:51:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:85:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 from /usr/local/bin/mongrel_rails:18 thanks, Dimitar From johan at textdrive.com Fri Oct 13 18:12:19 2006 From: johan at textdrive.com (Johan Sorensen) Date: Sat, 14 Oct 2006 00:12:19 +0200 Subject: [Mongrel] Broken installation of mongrel 0.3.13.4 on Sun OS 5.9 In-Reply-To: References: Message-ID: On 13 okt 2006, at 21.58, DGeorgie at wiley.com wrote: > Hi, > > Anyone succeeded in installing Mongrel on Sun Solaris? It looks > like the > installation is broken. I have started using Mongrel recently and > not sure > where to look when something is missing. Yes but it can be a bit quirky depending on your setup > First the file http11.so was not installed in > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib Sounds like the make failed. What was the output from gem install? JS From technoweenie at gmail.com Sun Oct 15 10:24:51 2006 From: technoweenie at gmail.com (Rick Olson) Date: Sun, 15 Oct 2006 09:24:51 -0500 Subject: [Mongrel] [ANN] mongrel_send_file gem plugin Message-ID: <48fe25b0610150724o8e621c8g9ea1862889ce51ce@mail.gmail.com> served piping hot fresh from my svn repo: http://svn.techno-weenie.net/projects/mongrel/mongrel_send_file/README == mongrel_send_file GemPlugin This is a simple plugin to handle the sending of secure files from a rails app. Here's the typical process: - Rails app authorizes user to download file - Rails app sets file info in the session, redirects to custom URL like /file/UNIQUE_HASH/filename - Mongrel handler pulls the full filename path and content type from the session using the unique hash, sends it to the user == Usage After installing the gem, you'll need to setup the handler for your Rails app: # config/mongrel_send_file.conf uri "/file/", :handler => plugin("/handlers/sendfile", :session_key => '_my_session_id', :session_files_key => :files), :in_front => true # rails action that sends the file def download # do whatever it is you do to find get the filename/content type @attachment = Attachment.find(params[:id]) # this doesn't matter as long as it's unique filehash = Digest::SHA1.hexdigest( Time.now.to_s.split('//').sort_by { rand }.join ) # initialize session. Use the :session_files_key option here session[:files] ||= {} # set the value for this file with a 5 minute expiration time session[:files][filehash] = [5.minutes.from_now.to_i, @attachment.full_filename, @attachment.content_type] # redirect to the path served by mongrel_send_file redirect_to "/file/#{filehash}/#{@attachment.filename}" end # startup mongrel with this command mongrel_rails -S config/mongrel_send_file.conf == Note I wrote this for a couple Rails apps that use the SqlSessionStore plugin [1]. So, it's very opinionated about how it gets the info from the session. This app should work with any app that runs on Mongrel (not just rails), just monkey patch the SendFile#find_session method. Submit suggestions as patches if you have them too. [1] - http://railsexpress.de/blog/articles/2006/09/15/sqlsessionstore-now-available-as-a-plugin -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From eden.li at gmail.com Sun Oct 15 11:56:44 2006 From: eden.li at gmail.com (Eden Li) Date: Sun, 15 Oct 2006 23:56:44 +0800 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends Message-ID: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> IE6 happily sends unsafe* characters unencoded if you've typed them into the URL bar of your IE6 window. This could happen if you copy & paste a URL from an email or web page. Mongrel doesn't seem to handle these properly. In 0.3.13.3 it would print out something like: Sun Oct 15 23:05:38 CST 2006: BAD CLIENT (192.168.1.2): Invalid HTTP format, parsing fails. 0.3.13.5 seems to ignore the request altogether (not even debug logs say anything). It seems other web servers like LighTPD handle requests like this without issue. Shouldn't mongrel follow suit? It isn't standard and IE7 seems to have fixed this, but IE6 is still a large chunk of the browser market, and I'd like for my users to get something more meaningful than an IE error page if they've accidentally copied something out of an email incorrectly. If there won't be a patch for Mongrel, is there some way I can get LighTPD/pen to escape the request on Mongrel's behalf? * According to rfc2068: unsafe = CTL | SP | <"> | "#" | "%" | "<" | ">" From technoweenie at gmail.com Sun Oct 15 12:31:23 2006 From: technoweenie at gmail.com (Rick Olson) Date: Sun, 15 Oct 2006 11:31:23 -0500 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> Message-ID: <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> On 10/15/06, Eden Li wrote: > IE6 happily sends unsafe* characters unencoded if you've typed them > into the URL bar of your IE6 window. This could happen if you copy & > paste a URL from an email or web page. > > Mongrel doesn't seem to handle these properly. In 0.3.13.3 it would > print out something like: > > Sun Oct 15 23:05:38 CST 2006: BAD CLIENT (192.168.1.2): Invalid > HTTP format, parsing fails. > > 0.3.13.5 seems to ignore the request altogether (not even debug logs > say anything). > > It seems other web servers like LighTPD handle requests like this > without issue. Shouldn't mongrel follow suit? It isn't standard and > IE7 seems to have fixed this, but IE6 is still a large chunk of the > browser market, and I'd like for my users to get something more > meaningful than an IE error page if they've accidentally copied > something out of an email incorrectly. > > If there won't be a patch for Mongrel, is there some way I can get > LighTPD/pen to escape the request on Mongrel's behalf? > > * According to rfc2068: unsafe = CTL | SP | <"> | "#" | "%" | "<" | ">" You could probably write a mongrel handler to cuddle with the params. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From philippe.lachaise at gmail.com Sun Oct 15 13:36:26 2006 From: philippe.lachaise at gmail.com (philippe lachaise) Date: Sun, 15 Oct 2006 19:36:26 +0200 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> Message-ID: >> You could probably write a mongrel handler to cuddle with the params. Aren't people likely to blame it on Mongrel, even if it is most unfair ? The usual conclusion is "this server can't handle that". My gut feeling is that a web server should handle gracefully ill-behaved clients or complain explicitely. (But, since I'm not the one who can write the code, take my remark as a mere whisper ;-) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061015/b7b92634/attachment.html From eden.li at gmail.com Sun Oct 15 13:52:47 2006 From: eden.li at gmail.com (Eden Li) Date: Mon, 16 Oct 2006 01:52:47 +0800 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> Message-ID: <565dbdd40610151052t1df940bap7efc20766f0a2d7c@mail.gmail.com> Any examples out there on how I could do this? The docs on rubyforge are pretty thin in this area. I got as far as authoring a mini gem_plugin, but: $ mongrel_rails start -S config/mongrel.conf ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Loading config/mongrel.conf external config script /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.2/lib/gem_plugin.rb:163:in `create': Plugin category handlers does not exist (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:252:in `plugin' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:337:in `run_config' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:337:in `open' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:337:in `run_config' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:117:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:138:in `listener' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:95:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:51:in `initialize' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:82:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/command.rb:211:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:234 from /usr/bin/mongrel_rails:18 Where mongrel.conf has: uri "/", :handler => plugin("handlers/myplugin"), :in_front => true On 10/16/06, Rick Olson wrote: > You could probably write a mongrel handler to cuddle with the params. From technoweenie at gmail.com Sun Oct 15 15:02:29 2006 From: technoweenie at gmail.com (Rick Olson) Date: Sun, 15 Oct 2006 14:02:29 -0500 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> Message-ID: <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> On 10/15/06, philippe lachaise wrote: > >> You could probably write a mongrel handler to cuddle with the params. > > Aren't people likely to blame it on Mongrel, even if it is most unfair ? > > The usual conclusion is "this server can't handle that". > > My gut feeling is that a web server should handle gracefully ill-behaved > clients or complain explicitely. > > (But, since I'm not the one who can write the code, take my remark as a mere > whisper ;-) That's up to Zed I guess. But, a plugin serves many purposes: - lets you get on with your life since you don't have to wait for a new release - lets others on older versions of mongrel easily upgrade - provides Zed with working code (hopefully) being used in production. i'm sure that says a lot more than a feature request. As much as I dislike the notion, I too think Mongrel should handle this stuff. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From Mongrel-users_RoR_develop at SvenMeyer.com Sun Oct 15 15:11:54 2006 From: Mongrel-users_RoR_develop at SvenMeyer.com (Sven Meyer) Date: Sun, 15 Oct 2006 21:11:54 +0200 Subject: [Mongrel] Mongrel on CentOS 4.3 / RHEL 4.3 64Bit Message-ID: <453287FA.5090202@SvenMeyer.com> I tried to install Rails + Mongrel on CentOS4.3 64Bit (my provider only has the 64 Bit version available). I found out, that I have to install gcc and emacs-common and have to copy the *.h files of the ruby source into a certain directory (see below). But finally I get an error messag when I start mongrel and I have no idea how to solve that problem: wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-docs-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/ri-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-libs-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-mode-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-tcltk-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/irb-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/rdoc-1.8.4-1.c4.x86_64.rpm wget http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-devel-1.8.4-1.c4.x86_64.rpm rpm -ivh ruby-libs-1.8.4-1.c4.x86_64.rpm rpm -ivh ruby-1.8.4-1.c4.x86_64.rpm rpm -ivh ruby-docs-1.8.4-1.c4.x86_64.rpm rpm -ivh irb-1.8.4-1.c4.x86_64.rpm rpm -ivh rdoc-1.8.4-1.c4.x86_64.rpm rpm -ivh ri-1.8.4-1.c4.x86_64.rpm rpm -ivh ruby-tcltk-1.8.4-1.c4.x86_64.rpm yum install emacs-common ... Installing: emacs-common x86_64 21.3-19.EL.4 base 9.7 M ... rpm -ivh ruby-mode-1.8.4-1.c4.x86_64.rpm wget http://rubyforge.org/frs/download.php/11291/rubygems-0.9.0.tgz tar -xzvf rubygems-0.9.0.tgz cd rubygems-0.9.0 ruby setup.rb yum install gcc gem install rails --include-dependencies gem update --system gem update rake gem update rails ************************************************* # gem install momgrel 1. ... > 1 Install required dependency daemons? [Yn] Y Install required dependency gem_plugin? [Yn] Y Building native extensions. This could take a while... can't find header files for ruby. ERROR: While executing gem ... (RuntimeError) ERROR: Failed to build gem native extension. Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4 for inspection. Results logged to /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/ext/http11/gem_make.out ******* If you encounter "can't find header files for ruby" problem, first download the ruby src from ruby-lang, then copy *.h especially ruby.h to the result of Config::CONFIG["archdir"](/usr/lib/ruby/1.8/i586-linux-gnu/ on my machine). Reinstall mongrel, then it's ok. http://www.befittr.com/blog/2006/09/09/configuring-ec2-rails-mongrel-apache-22-and-mysql-5/feed/ *************************************************** because of the above error I'll grab and copy the *.h files of the ruby source ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz tar -xzvf ruby-1.8.4.tar.gz cp ruby-1.8.4/*.h /usr/lib64/ruby/1.8/x86_64-linux gem install daemons gem_plugin mongrel mongrel_cluster --include-dependencies [rails at centos4364m test1]$ mongrel_rails start -p 8080 /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:38: uninitialized constant Mongrel::HttpHandler (NameError) from /usr/lib64/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:10 from /usr/bin/mongrel_rails:18 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061015/a4688ba8/attachment-0001.html From me at seebq.com Sun Oct 15 18:06:56 2006 From: me at seebq.com (Charles Brian Quinn) Date: Sun, 15 Oct 2006 18:06:56 -0400 Subject: [Mongrel] Mongrel on CentOS 4.3 / RHEL 4.3 64Bit In-Reply-To: <453287FA.5090202@SvenMeyer.com> References: <453287FA.5090202@SvenMeyer.com> Message-ID: <3a2de0cd0610151506i3cda19c3t76ea57cbabd3bb5d@mail.gmail.com> I couldn't help but notice that you downloaded the ruby-devel package, but didn't install it.... unless you didn't include that line above.... This would include the development (header) files for you, I believe. Let us know if that helps. On 10/15/06, Sven Meyer wrote: > > I tried to install Rails + Mongrel on CentOS4.3 64Bit (my provider only has > the 64 Bit version available). > I found out, that I have to install gcc and emacs-common and have to copy > the *.h files of the ruby source into a certain directory (see below). > But finally I get an error messag when I start mongrel and I have no idea > how to solve that problem: > > > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-docs-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ri-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-libs-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-mode-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-tcltk-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/irb-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/rdoc-1.8.4-1.c4.x86_64.rpm > wget > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-devel-1.8.4-1.c4.x86_64.rpm > > rpm -ivh ruby-libs-1.8.4-1.c4.x86_64.rpm > rpm -ivh ruby-1.8.4-1.c4.x86_64.rpm > rpm -ivh ruby-docs-1.8.4-1.c4.x86_64.rpm > rpm -ivh irb-1.8.4-1.c4.x86_64.rpm > rpm -ivh rdoc-1.8.4-1.c4.x86_64.rpm > rpm -ivh ri-1.8.4-1.c4.x86_64.rpm > rpm -ivh ruby-tcltk-1.8.4-1.c4.x86_64.rpm > > yum install emacs-common > > ... > > Installing: > emacs-common x86_64 21.3-19.EL.4 base 9.7 > M > ... > > rpm -ivh ruby-mode-1.8.4-1.c4.x86_64.rpm > > wget > http://rubyforge.org/frs/download.php/11291/rubygems-0.9.0.tgz > > tar -xzvf rubygems-0.9.0.tgz > > cd rubygems-0.9.0 > > ruby setup.rb > > yum install gcc > > gem install rails --include-dependencies > > gem update --system > gem update rake > gem update rails > > > ************************************************* > > # gem install momgrel > > 1. ... > > > 1 > Install required dependency daemons? [Yn] Y > Install required dependency gem_plugin? [Yn] Y > Building native extensions. This could take a while... > can't find header files for ruby. > > ERROR: While executing gem ... (RuntimeError) > ERROR: Failed to build gem native extension. > Gem files will remain installed in > /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4 for > inspection. > > > Results logged to > /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/ext/http11/gem_make.out > > ******* > > If you encounter "can't find header files for ruby" problem, first download > the ruby src from ruby-lang, then copy *.h especially ruby.h to the result > of > Config::CONFIG["archdir"](/usr/lib/ruby/1.8/i586-linux-gnu/ > on my machine). Reinstall mongrel, then it's ok. > > http://www.befittr.com/blog/2006/09/09/configuring-ec2-rails-mongrel-apache-22-and-mysql-5/feed/ > > *************************************************** > > because of the above error I'll grab and copy the *.h files of the ruby > source > > ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz > > tar -xzvf ruby-1.8.4.tar.gz > > cp ruby-1.8.4/*.h /usr/lib64/ruby/1.8/x86_64-linux > > gem install daemons gem_plugin mongrel mongrel_cluster > --include-dependencies > > > > [rails at centos4364m test1]$ mongrel_rails start -p 8080 > > /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:38: > uninitialized constant Mongrel::HttpHandler (NameError) > from > /usr/lib64/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from > /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:10 > from /usr/bin/mongrel_rails:18 > > > > > _______________________________________________ > 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 eden.li at gmail.com Sun Oct 15 19:07:25 2006 From: eden.li at gmail.com (Eden Li) Date: Mon, 16 Oct 2006 07:07:25 +0800 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> Message-ID: <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> Hmm. It looks like a plugin can't handle this. The plugin I tested never got its process method called. Tracing through lib/mongrel.rb, the HttpParser#execute method throws an HttpParserError before it has a chance to pass the request off to the plugin. Looks like this'll have to be patched in the Ragel or C code. FWIW, the URI parsing libraries of both Perl and Python, which claim to be RFC compliant, parse these out 'properly' without throwing an error. Also, from rfc2396: The angle-bracket "<" and ">" and double-quote (") characters are excluded because they are often used as the delimiters around URI in text documents and protocol fields. Which makes sense from the standards point of view, but if the request has already gotten to your server, it shouldn't barf on it. On 10/16/06, Rick Olson wrote: > On 10/15/06, philippe lachaise wrote: > > >> You could probably write a mongrel handler to cuddle with the params. > > > > Aren't people likely to blame it on Mongrel, even if it is most unfair ? > > > > The usual conclusion is "this server can't handle that". > > > > My gut feeling is that a web server should handle gracefully ill-behaved > > clients or complain explicitely. > > > > (But, since I'm not the one who can write the code, take my remark as a mere > > whisper ;-) > > That's up to Zed I guess. But, a plugin serves many purposes: > > - lets you get on with your life since you don't have to wait for a new release > - lets others on older versions of mongrel easily upgrade > - provides Zed with working code (hopefully) being used in production. > i'm sure that says a lot more than a feature request. > > As much as I dislike the notion, I too think Mongrel should handle this stuff. > > -- > 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 > From eden.li at gmail.com Sun Oct 15 19:48:16 2006 From: eden.li at gmail.com (Eden Li) Date: Mon, 16 Oct 2006 07:48:16 +0800 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> Message-ID: <565dbdd40610151648t28c43eaub3ccdcb8dd0aae57@mail.gmail.com> Here's a patch of http_parser.rl against r358 that allows these three characters and associated unit tests. On 10/16/06, Eden Li wrote: > Hmm. It looks like a plugin can't handle this. The plugin I tested > never got its process method called. > > Tracing through lib/mongrel.rb, the HttpParser#execute method throws > an HttpParserError before it has a chance to pass the request off to > the plugin. Looks like this'll have to be patched in the Ragel or C > code. > > FWIW, the URI parsing libraries of both Perl and Python, which claim > to be RFC compliant, parse these out 'properly' without throwing an > error. > > Also, from rfc2396: > > The angle-bracket "<" and ">" and double-quote (") characters are > excluded because they are often used as the delimiters around URI in > text documents and protocol fields. > > Which makes sense from the standards point of view, but if the request > has already gotten to your server, it shouldn't barf on it. > > On 10/16/06, Rick Olson wrote: > > On 10/15/06, philippe lachaise wrote: > > > >> You could probably write a mongrel handler to cuddle with the params. > > > > > > Aren't people likely to blame it on Mongrel, even if it is most unfair ? > > > > > > The usual conclusion is "this server can't handle that". > > > > > > My gut feeling is that a web server should handle gracefully ill-behaved > > > clients or complain explicitely. > > > > > > (But, since I'm not the one who can write the code, take my remark as a mere > > > whisper ;-) > > > > That's up to Zed I guess. But, a plugin serves many purposes: > > > > - lets you get on with your life since you don't have to wait for a new release > > - lets others on older versions of mongrel easily upgrade > > - provides Zed with working code (hopefully) being used in production. > > i'm sure that says a lot more than a feature request. > > > > As much as I dislike the notion, I too think Mongrel should handle this stuff. > > > > -- > > 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 -------------- A non-text attachment was scrubbed... Name: ie6urls.diff Type: text/x-patch Size: 5778 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061016/c9dbcff6/attachment.bin From ross.singer at library.gatech.edu Sun Oct 15 19:50:53 2006 From: ross.singer at library.gatech.edu (Ross Singer) Date: Sun, 15 Oct 2006 19:50:53 -0400 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> Message-ID: <23b83f160610151650w77ffdcb4le700018a4f4ab011@mail.gmail.com> This has come up before, btw. -Ross. On 10/15/06, Eden Li wrote: > Hmm. It looks like a plugin can't handle this. The plugin I tested > never got its process method called. > > Tracing through lib/mongrel.rb, the HttpParser#execute method throws > an HttpParserError before it has a chance to pass the request off to > the plugin. Looks like this'll have to be patched in the Ragel or C > code. > > FWIW, the URI parsing libraries of both Perl and Python, which claim > to be RFC compliant, parse these out 'properly' without throwing an > error. > > Also, from rfc2396: > > The angle-bracket "<" and ">" and double-quote (") characters are > excluded because they are often used as the delimiters around URI in > text documents and protocol fields. > > Which makes sense from the standards point of view, but if the request > has already gotten to your server, it shouldn't barf on it. > > On 10/16/06, Rick Olson wrote: > > On 10/15/06, philippe lachaise wrote: > > > >> You could probably write a mongrel handler to cuddle with the params. > > > > > > Aren't people likely to blame it on Mongrel, even if it is most unfair ? > > > > > > The usual conclusion is "this server can't handle that". > > > > > > My gut feeling is that a web server should handle gracefully ill-behaved > > > clients or complain explicitely. > > > > > > (But, since I'm not the one who can write the code, take my remark as a mere > > > whisper ;-) > > > > That's up to Zed I guess. But, a plugin serves many purposes: > > > > - lets you get on with your life since you don't have to wait for a new release > > - lets others on older versions of mongrel easily upgrade > > - provides Zed with working code (hopefully) being used in production. > > i'm sure that says a lot more than a feature request. > > > > As much as I dislike the notion, I too think Mongrel should handle this stuff. > > > > -- > > 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 > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From zedshaw at zedshaw.com Mon Oct 16 05:05:05 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 16 Oct 2006 02:05:05 -0700 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <565dbdd40610151648t28c43eaub3ccdcb8dd0aae57@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> <565dbdd40610151648t28c43eaub3ccdcb8dd0aae57@mail.gmail.com> Message-ID: <20061016020505.50ed39d3.zedshaw@zedshaw.com> On Mon, 16 Oct 2006 07:48:16 +0800 "Eden Li" wrote: > Here's a patch of http_parser.rl against r358 that allows these three > characters and associated unit tests. Rock on! That's what I'm talking about. I'll apply this soon and post up a pre-release. Thanks Eden. -- 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 eden.li at gmail.com Mon Oct 16 02:10:46 2006 From: eden.li at gmail.com (Eden Li) Date: Mon, 16 Oct 2006 14:10:46 +0800 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <23b83f160610151650w77ffdcb4le700018a4f4ab011@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> <23b83f160610151650w77ffdcb4le700018a4f4ab011@mail.gmail.com> Message-ID: <565dbdd40610152310t5a1fae4v2d9da7359534b684@mail.gmail.com> Care to point to the thread? On 10/16/06, Ross Singer wrote: > This has come up before, btw. From Mongrel-users_RoR_develop at SvenMeyer.com Mon Oct 16 05:52:47 2006 From: Mongrel-users_RoR_develop at SvenMeyer.com (Sven Meyer) Date: Mon, 16 Oct 2006 11:52:47 +0200 Subject: [Mongrel] Mongrel on CentOS 4.3 / RHEL 4.3 64Bit In-Reply-To: <3a2de0cd0610151506i3cda19c3t76ea57cbabd3bb5d@mail.gmail.com> References: <453287FA.5090202@SvenMeyer.com> <3a2de0cd0610151506i3cda19c3t76ea57cbabd3bb5d@mail.gmail.com> Message-ID: <4533566F.90305@SvenMeyer.com> Hi Charles many, many thanks for pointing that out to me - I really forgot to install ruby-devel-1.8.4-1.c4.x86_64.rpm - no it's working fine! Problem was, I had to reorder the rpm's while installing, because some were dependent of other ones ... and then I must have forgotten one. ... Maybe I could have done that with one command instead and rpm commad would have figured out the right dependencies itself und would have reordered it automatically? Many thanks again, Sven Charles Brian Quinn wrote: > I couldn't help but notice that you downloaded the ruby-devel package, > but didn't install it.... > > unless you didn't include that line above.... > > This would include the development (header) files for you, I believe. > > Let us know if that helps. > > On 10/15/06, Sven Meyer wrote: > >> I tried to install Rails + Mongrel on CentOS4.3 64Bit (my provider only has >> the 64 Bit version available). >> I found out, that I have to install gcc and emacs-common and have to copy >> the *.h files of the ruby source into a certain directory (see below). >> But finally I get an error messag when I start mongrel and I have no idea >> how to solve that problem: >> >> >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-docs-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/ri-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-libs-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-mode-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-tcltk-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/irb-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/rdoc-1.8.4-1.c4.x86_64.rpm >> wget >> http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-devel-1.8.4-1.c4.x86_64.rpm >> >> rpm -ivh ruby-libs-1.8.4-1.c4.x86_64.rpm >> rpm -ivh ruby-1.8.4-1.c4.x86_64.rpm >> rpm -ivh ruby-docs-1.8.4-1.c4.x86_64.rpm >> rpm -ivh irb-1.8.4-1.c4.x86_64.rpm >> rpm -ivh rdoc-1.8.4-1.c4.x86_64.rpm >> rpm -ivh ri-1.8.4-1.c4.x86_64.rpm >> rpm -ivh ruby-tcltk-1.8.4-1.c4.x86_64.rpm >> >> yum install emacs-common >> >> ... >> >> Installing: >> emacs-common x86_64 21.3-19.EL.4 base 9.7 >> M >> ... >> >> rpm -ivh ruby-mode-1.8.4-1.c4.x86_64.rpm >> >> wget >> http://rubyforge.org/frs/download.php/11291/rubygems-0.9.0.tgz >> >> tar -xzvf rubygems-0.9.0.tgz >> >> cd rubygems-0.9.0 >> >> ruby setup.rb >> >> yum install gcc >> >> gem install rails --include-dependencies >> >> gem update --system >> gem update rake >> gem update rails >> >> >> ************************************************* >> >> # gem install momgrel >> >> 1. ... >> >> > 1 >> Install required dependency daemons? [Yn] Y >> Install required dependency gem_plugin? [Yn] Y >> Building native extensions. This could take a while... >> can't find header files for ruby. >> >> ERROR: While executing gem ... (RuntimeError) >> ERROR: Failed to build gem native extension. >> Gem files will remain installed in >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4 for >> inspection. >> >> >> Results logged to >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/ext/http11/gem_make.out >> >> ******* >> >> If you encounter "can't find header files for ruby" problem, first download >> the ruby src from ruby-lang, then copy *.h especially ruby.h to the result >> of >> Config::CONFIG["archdir"](/usr/lib/ruby/1.8/i586-linux-gnu/ >> on my machine). Reinstall mongrel, then it's ok. >> >> http://www.befittr.com/blog/2006/09/09/configuring-ec2-rails-mongrel-apache-22-and-mysql-5/feed/ >> >> *************************************************** >> >> because of the above error I'll grab and copy the *.h files of the ruby >> source >> >> ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz >> >> tar -xzvf ruby-1.8.4.tar.gz >> >> cp ruby-1.8.4/*.h /usr/lib64/ruby/1.8/x86_64-linux >> >> gem install daemons gem_plugin mongrel mongrel_cluster >> --include-dependencies >> >> >> >> [rails at centos4364m test1]$ mongrel_rails start -p 8080 >> >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:38: >> uninitialized constant Mongrel::HttpHandler (NameError) >> from >> /usr/lib64/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `require' >> from >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:10 >> from /usr/bin/mongrel_rails:18 >> >> >> >> >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >> >> >> > > > From kraemer at webit.de Mon Oct 16 06:14:19 2006 From: kraemer at webit.de (Jens Kraemer) Date: Mon, 16 Oct 2006 12:14:19 +0200 Subject: [Mongrel] Mongrel on CentOS 4.3 / RHEL 4.3 64Bit In-Reply-To: <4533566F.90305@SvenMeyer.com> References: <453287FA.5090202@SvenMeyer.com> <3a2de0cd0610151506i3cda19c3t76ea57cbabd3bb5d@mail.gmail.com> <4533566F.90305@SvenMeyer.com> Message-ID: <20061016101419.GH14271@cordoba.webit.de> On Mon, Oct 16, 2006 at 11:52:47AM +0200, Sven Meyer wrote: > Hi Charles > > many, many thanks for pointing that out to me - I really forgot to install > > ruby-devel-1.8.4-1.c4.x86_64.rpm > > - no it's working fine! > > Problem was, I had to reorder the rpm's while installing, because some were dependent of other ones ... and then I must have forgotten one. ... Maybe I could have done that with one command instead and rpm commad would have figured out the right dependencies itself und would have reordered it automatically? Afaik rpm can't do this, but there should be some higher-level package management tool that is able to do so. Don't know what it's called on cent os. On Debian there are apt or aptitude, which work as frontends to dpkg (which is the debian equivalent to rpm). cheers, 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 ross.singer at library.gatech.edu Mon Oct 16 09:32:44 2006 From: ross.singer at library.gatech.edu (Ross Singer) Date: Mon, 16 Oct 2006 09:32:44 -0400 Subject: [Mongrel] Mongrel can't handle some URLs that IE6 sends In-Reply-To: <565dbdd40610152310t5a1fae4v2d9da7359534b684@mail.gmail.com> References: <565dbdd40610150856t41656c74k9f091b2d49b8fb09@mail.gmail.com> <48fe25b0610150931w473f34d3q5423c6f76eca46b0@mail.gmail.com> <48fe25b0610151202m44773de8k75baab56babb9d2c@mail.gmail.com> <565dbdd40610151607g40223662ia0c948214b1599e0@mail.gmail.com> <23b83f160610151650w77ffdcb4le700018a4f4ab011@mail.gmail.com> <565dbdd40610152310t5a1fae4v2d9da7359534b684@mail.gmail.com> Message-ID: <23b83f160610160632w1d62d111gcee364e98ca09d81@mail.gmail.com> Starts here: http://rubyforge.org/pipermail/mongrel-users/2006-August/001162.html This patch should basically eliminate it, though, I guess :) Which is awesome. -Ross. On 10/16/06, Eden Li wrote: > Care to point to the thread? > > On 10/16/06, Ross Singer wrote: > > This has come up before, btw. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From DGeorgie at wiley.com Mon Oct 16 11:19:10 2006 From: DGeorgie at wiley.com (DGeorgie at wiley.com) Date: Mon, 16 Oct 2006 11:19:10 -0400 Subject: [Mongrel] Broken installation of mongrel 0.3.13.4 on Sun OS 5.9 In-Reply-To: Message-ID: Hi Johan, You were right, The make failed. Someone else was installing mongrel and unfortunately the error message escaped his attention. This morning I have uninstalled and installed Mongrel 0.3.13.4 on Sun OS 5.9. This is the output. I hope it helps to narrow down the cause of the failure. This is the output of gem install mongrel Building native extensions. This could take a while... make: ./install-sh: Command not found make: *** [/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/http11.so] Error 127 ruby extconf.rb install mongrel checking for main() in -lc... yes creating Makefile make gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c http11.c gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c tst_search.c gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c tst_delete.c gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c http11_parser.c gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c tst_init.c gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c tst_grow_node_free_list.c gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c tst_insert.c gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I/usr/local/lib/ruby/1.8/sparc-solaris2.9 -I. -c tst_cleanup.c gcc -Wl,-G -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -o http11.so http11.o tst_search.o tst_delete.o http11_parser.o tst_init.o tst_grow_node_free_list.o tst_insert.o tst_cleanup.o -lc -ldl -lcrypt -lm -lc make install ./install-sh -c -m 0755 http11.so /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib make clean Successfully installed mongrel-0.3.13.4 Installing ri documentation for mongrel-0.3.13.4... Installing RDoc documentation for mongrel-0.3.13.4... Thanks, Dimitar Johan Sorensen Sent by: mongrel-users-bounces at rubyforge.org 10/13/2006 06:12 PM Please respond to mongrel-users at rubyforge.org To mongrel-users at rubyforge.org cc Subject Re: [Mongrel] Broken installation of mongrel 0.3.13.4 on Sun OS 5.9 On 13 okt 2006, at 21.58, DGeorgie at wiley.com wrote: > Hi, > > Anyone succeeded in installing Mongrel on Sun Solaris? It looks > like the > installation is broken. I have started using Mongrel recently and > not sure > where to look when something is missing. Yes but it can be a bit quirky depending on your setup > First the file http11.so was not installed in > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib Sounds like the make failed. What was the output from gem install? JS _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From johan at textdrive.com Mon Oct 16 13:41:33 2006 From: johan at textdrive.com (Johan Sorensen) Date: Mon, 16 Oct 2006 19:41:33 +0200 Subject: [Mongrel] Broken installation of mongrel 0.3.13.4 on Sun OS 5.9 In-Reply-To: References: Message-ID: <04AD9C75-C1FB-4B0C-B8A9-21F145320B8F@textdrive.com> Hi, On 16 okt 2006, at 17.19, DGeorgie at wiley.com wrote: > This is the output of gem install mongrel > Building native extensions. This could take a while... > make: ./install-sh: Command not found > make: *** > [/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/http11.so] > Error > 127 > ruby extconf.rb install mongrel > checking for main() in -lc... yes > creating Makefile Yeah, I get something like that too (it failing to find the proper install bin). Haven't had the time to track it down proper, so I just edit the Makefile (/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/ext/http11/ Makefile if you're using blastwave) and edit the INSTALL var to use the gnu install: INSTALL = /opt/csw/gnu/install -c then make install JS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061016/85cd2aa6/attachment.html From technoweenie at gmail.com Mon Oct 16 23:02:27 2006 From: technoweenie at gmail.com (Rick Olson) Date: Mon, 16 Oct 2006 22:02:27 -0500 Subject: [Mongrel] [ANN] mongrel_send_file gem plugin In-Reply-To: <48fe25b0610150724o8e621c8g9ea1862889ce51ce@mail.gmail.com> References: <48fe25b0610150724o8e621c8g9ea1862889ce51ce@mail.gmail.com> Message-ID: <48fe25b0610162002y49dfaafei7f635e217209913e@mail.gmail.com> > == mongrel_send_file GemPlugin Boy oh boy, I can just feel the excitement! It's on rubyforge now, so ready... set, gem install mongrel_send_file!!!! -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From DGeorgie at wiley.com Tue Oct 17 10:12:53 2006 From: DGeorgie at wiley.com (DGeorgie at wiley.com) Date: Tue, 17 Oct 2006 10:12:53 -0400 Subject: [Mongrel] Broken installation of mongrel 0.3.13.4 on Sun OS 5.9 In-Reply-To: <04AD9C75-C1FB-4B0C-B8A9-21F145320B8F@textdrive.com> Message-ID: Hi Johan, The use of gnu install helped complete the installation but I have different problem now. Mongrel server can start now, but it takes forever to answer to a request. Actually mongrel never finished the response. I cannot load the first page into the browser. >From the load files I can tell mongrel received the request and started processing it: this is the output from mongrel_debug/rails.log --- !map:Mongrel::HttpParams SERVER_NAME: orion.wiley.com PATH_INFO: / HTTP_ACCEPT_ENCODING: gzip,deflate HTTP_USER_AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 SCRIPT_NAME: / SERVER_PROTOCOL: HTTP/1.1 HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5 HTTP_HOST: orion.wiley.com:85 REMOTE_ADDR: 10.4.32.135 SERVER_SOFTWARE: Mongrel 0.3.13.4 HTTP_KEEP_ALIVE: "300" REQUEST_PATH: / HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_VERSION: HTTP/1.1 REQUEST_URI: / SERVER_PORT: "85" GATEWAY_INTERFACE: CGI/1.2 HTTP_ACCEPT: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 HTTP_CONNECTION: keep-alive REQUEST_METHOD: GET and this is from mongrel_debug/files.log Tue Oct 17 09:44:55 EDT 2006 FILES OPEN BEFORE REQUEST / --- /edugen_monitor/autolog/config/../log/production.log: 1 log/mongrel_debug/objects.log: 2 log/mongrel_debug/params.log: 1 log/mongrel_debug/rails.log: 1 log/mongrel_debug/threads.log: 1 log/mongrel_debug/files.log: 1 log/mongrel.pid: 1 It looks like Solaris is not the platform of choice for mongrel. On Fedora Linux it worked flawlessly from the moment I installed it. thanks for the help, Dimitar Johan Sorensen Sent by: mongrel-users-bounces at rubyforge.org 10/16/2006 01:41 PM Please respond to mongrel-users at rubyforge.org To mongrel-users at rubyforge.org cc Subject Re: [Mongrel] Broken installation of mongrel 0.3.13.4 on Sun OS 5.9 Hi, On 16 okt 2006, at 17.19, DGeorgie at wiley.com wrote: This is the output of gem install mongrel Building native extensions. This could take a while... make: ./install-sh: Command not found make: *** [/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/http11.so] Error 127 ruby extconf.rb install mongrel checking for main() in -lc... yes creating Makefile Yeah, I get something like that too (it failing to find the proper install bin). Haven't had the time to track it down proper, so I just edit the Makefile (/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/ext/http11/Makefile if you're using blastwave) and edit the INSTALL var to use the gnu install: INSTALL = /opt/csw/gnu/install -c then make install JS _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From ezmobius at gmail.com Tue Oct 17 19:59:23 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Tue, 17 Oct 2006 16:59:23 -0700 Subject: [Mongrel] [ANN] Merb, Mongrel+Erb Message-ID: <034B814A-4099-4B93-AA91-461B99F6BE19@gmail.com> Hey there folks- I'm happy to announce the first useable release of my new pocket- framework Merb. Merb is a mongrel handler with built in controller and view templating with erb. It has a nice routing system similar to rails but much simpler. It uses some of the code from the camping handler and the rails handler and then some of its own secret sauce to form imho a nice fast little framework. ActiveRecord is supported as shown in the sample app. Merb does not use cgi.rb at all(yay!) but can handle file uploads very well. See the sample app. And it can process concurrent file uploads without blocking. Merb also supports the X-SENDFILE header so you can set that header to a path to a file in your controller and then mongrel will serve it directly and your controller can continue on to the next request. Merb is a pet project of mine but was born out of real life need. I am using it in combination with rails apps that need a lot of file uploads or need to serve some dynamic pages faster then rails will allow. Right now Merb performs very well for a dynamic ruby framework thanks to mongrel being very fast when it doesn't have the Rails Albatross ? on its back. Serving a dynamic templated page thru merb routing and controller with 10 ActiveRecord objects being listed out in the view, merb clocks in at 400req/sec on my macbook and a bit better on a real server. Static files are served as fast as mongrel can. I am using this along side a rails app by rewriting requests to a suburl to the merb mongrel like /foo -> merb handler. I am investigating making it possible to mount merb at a url in mongrel itself along side a rails app but I have to do more testing to see how that affects everything. If you want to play along at home you can do this to get a quick start: $ sudo gem install merb $ gem unpack merb $ cd merb-0.0.3/examples/sample_app # edit the conf/merb_init.rb to add your database password info. # then add a posts table to your db with a title and body column. $ merb start -t Then you can browse to these urls to play around. http://localhost:4000/posts/new or http://localhost:4000/posts/list or http://localhost:4000/uploads/start Here are the relevant links if you want to get involved with Merb development. http://rubyforge.org/frs/?group_id=2383 http://merb.devjavu.com/ http://svn.devjavu.com/merb http://brainspl.at/articles/2006/10/15/merb-gets-cool-routes-and-file- uploads Keep in mind that Merb is only a week or two old and is changing fast! If you want to get in on the ground floor and help me add to the base system then you are most welcome. On the other hand, if Merb kills your children I am not responsible ;) Thanks for playing! Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From _ at whats-your.name Tue Oct 17 20:22:42 2006 From: _ at whats-your.name (carmen) Date: Wed, 18 Oct 2006 00:22:42 +0000 Subject: [Mongrel] [ANN] Merb, Mongrel+Erb In-Reply-To: <034B814A-4099-4B93-AA91-461B99F6BE19@gmail.com> References: <034B814A-4099-4B93-AA91-461B99F6BE19@gmail.com> Message-ID: <20061018002242.GC2551@replic.net> > Merb is a pet project of mine but was born out of real life need. I > am using it in combination with rails apps that need a lot of file > uploads or need to serve some dynamic pages faster then rails will > allow. Right now Merb performs very well for a dynamic ruby framework > thanks to mongrel being very fast when it doesn't have the Rails > Albatross ? on its back did you find performance issues with camping? this sounds quite similar. but i will check it out anywyas (praobly won't port my apps from camping to merb, unless it has some cool advantages like built in DRb for automatic-scaling and nice background-proces integration From ezmobius at gmail.com Tue Oct 17 21:09:03 2006 From: ezmobius at gmail.com (Ezra Zygmuntowicz) Date: Tue, 17 Oct 2006 18:09:03 -0700 Subject: [Mongrel] [ANN] Merb, Mongrel+Erb In-Reply-To: <20061018002242.GC2551@replic.net> References: <034B814A-4099-4B93-AA91-461B99F6BE19@gmail.com> <20061018002242.GC2551@replic.net> Message-ID: <9EFFC495-9768-47A1-BBFF-50D57752DA62@brainspl.at> On Oct 17, 2006, at 5:22 PM, carmen wrote: >> Merb is a pet project of mine but was born out of real life need. I >> am using it in combination with rails apps that need a lot of file >> uploads or need to serve some dynamic pages faster then rails will >> allow. Right now Merb performs very well for a dynamic ruby framework >> thanks to mongrel being very fast when it doesn't have the Rails >> Albatross ? on its back > > did you find performance issues with camping? this sounds quite > similar. but i will check it out anywyas (praobly won't port my > apps from camping to merb, unless it has some cool advantages like > built in DRb for automatic-scaling and nice background-proces > integration Nope I love camping, its great! But I have actually wanted my own framework for a little while now. So when I had a need for the file uploads I started out to just write myself a simple mongrel handler for doing uploads. But then it became fun and I continued on. Now its really starting to shape up. I love camping but I wanted things my own way so I built it. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) From david at amazing.com Tue Oct 17 23:04:08 2006 From: david at amazing.com (David H Dennis) Date: Tue, 17 Oct 2006 23:04:08 -0400 Subject: [Mongrel] Anyone have issues with the Comcast toolbar? In-Reply-To: <20061018002242.GC2551@replic.net> References: <034B814A-4099-4B93-AA91-461B99F6BE19@gmail.com> <20061018002242.GC2551@replic.net> Message-ID: I have a Mongrel cluster balanced using 'balance' at http:// www.amazing.com/ . This morning, I got reports from people saying they could not access the site. They sent me a very odd looking error report, which appears to be from Comcast Cable. The error page has Google ads in it that were associated with my domain. (Until I put up my existing social networking site, I had a eccentric personal web page which talked about Mercedes-Benz automobiles and digital video, among other subjects; the ads were mainly Mercedes and digital video-related). The strange thing is that I asked them to do a nslookup, and they came up with my IP. When I asked them to type the IP into their browser, the same error page came up (although I didn't ask them about the ads.) However, pinging to the IP or web address works fine. And if I telnet to port 80, I get a connection. The domain amazing.amazing.com, where I have my old personal site up, works normally. It's served by Apache. amazing.com is served by Mongrel. This made me wonder if maybe the Comcast toolbar mangles requests in a way Mongrel doesn't like? The alternative is to think that Comcast cares enough about my still brand new low-traffic web site to want to bother blocking it. The site is social networking and does not allow sexual material due to the terms of Google ads. A guy came and posted some sex images which were promptly removed but I suppose it's possible they were noticed. Anyone else have similar issues, and if so, how did you work around them or find out what they were? Many thanks. Best D For reference, here's the text of the Comcast error message: Sorry. We can't find www.amazing.com Try retyping the URL in the browser address bar above. Or, search the Web. Search the Web: Did you mean: www.alazing.com? Sponsored Links Used Mercedes-Benz SL 320 www.CarsDirect.com Find a Used Mercedes In Your Area 400,000 Listings - Updated Daily. Mercedes Benz E300dt www.mbusa.com/pre-owned Search Inventory, Get Warranty Info & More at the Official CPO Site! Canon XH-G1 www.Everyprice.com Find the Right Price! Compare Shops & Purchase Online - Quick & Easy. Powered by Google Web Search Results Amazing Space Collection of web-based activities designed for classroom use, but made available for everyone to enjoy. http://amazing-space.stsci.edu/ - 11k - Cached - Similar pages Amazing Facts -Christian Media Ministry Free Bible Prophecy Lessons; Millennium of Prophecy TV program; Bible answers live radio program; Christian books, Christian audio and video products; ... http://www.amazingfacts.org/ - 22k - Cached - Similar pages Environment Web Directory shortcut to Agriculture - Horticulture, Farming... Animals - Animal Rights, Humane Society... Arts - Art, Music, Photography... ... http://www.webdirectory.com/ - 13k - Cached - Similar pages From _ at whats-your.name Wed Oct 18 00:21:26 2006 From: _ at whats-your.name (carmen) Date: Wed, 18 Oct 2006 04:21:26 +0000 Subject: [Mongrel] Anyone have issues with the Comcast toolbar? In-Reply-To: References: <034B814A-4099-4B93-AA91-461B99F6BE19@gmail.com> <20061018002242.GC2551@replic.net> Message-ID: <20061018042126.GD2551@replic.net> On Tue Oct 17, 2006 at 11:04:08PM -0400, David H Dennis wrote: > I have a Mongrel cluster balanced using 'balance' at http:// > www.amazing.com/ . > > This morning, I got reports from people saying they could not access > the site. They sent me a very odd looking error report, which > appears to be from Comcast Cable. The error page has Google ads in > it that were associated with my domain. (Until I put up my existing > social networking site, I had a eccentric personal web page which > talked about Mercedes-Benz automobiles and digital video, among other > subjects; the ads were mainly Mercedes and digital video-related). > > The strange thing is that I asked them to do a nslookup, and they > came up with my IP. When I asked them to type the IP into their > browser, the same error page came up (although I didn't ask them > about the ads.) However, pinging to the IP or web address works > fine. And if I telnet to port 80, I get a connection. > > The domain amazing.amazing.com, where I have my old personal site up, > works normally. It's served by Apache. amazing.com is served by > Mongrel. This made me wonder if maybe the Comcast toolbar mangles > requests in a way Mongrel doesn't like? > > The alternative is to think that Comcast cares enough about my still > brand new low-traffic web site to want to bother blocking it. > > The site is social networking and does not allow sexual material due > to the terms of Google ads. A guy came and posted some sex images > which were promptly removed but I suppose it's possible they were > noticed. > > Anyone else have similar issues, and if so, how did you work around > them or find out what they were? ive had a lot of issues running basic services for my own usage, on comcast. i mean stuff taht porbalty technically violates the TOS but has about as much functionality as the official-sanctioned 'internet is only WWW and email' clients. stuff like all the ip addresses being in blackholes, so the only way you can send mail is if you forward thru comcast's smtp server as a relay. stuff like setting smb ports = 5190,139,445 in /etc/samba/smb.conf and //a/hd /a smbfs port=5190,password=*** 0 0 in /etc/fstab since both of the default samba ports are blocked stuff like, VOIP calls dont go through with bizarre SIP 'network congestion' errors even witho congestion, via multiple providers on both inbound DID and outbound calls (none thru their ridiculously expensive officially-sanctioned VOIP service, of course) stuff like using more than 50% of your upstream bandwidth causing downstream to be capped to the same speed, on freeBSd or linux with no intermediary firewall/router stuff lke getting in a nasty catch 22 situation where you cant grab an IP address if your MAC address changes, and you have to do a crazy reset-the-modem and dhclient dance until something works as for comcast toolbar mangling your URL, thats a possibility, but i'd also look into apache. i'm convinced proxypass is unescaping my URLs, even though therse no explicit rule stating to do this (they contain http, then escaped versions of : and /s.. ngrep is your friend.. > > Try retyping the URL in the browser address bar above. Or, search the > Web. > > Search the Web: > > > Did you mean: www.alazing.com? > i'd recommend using a DNS server that isn't comcasts, as well.. but i'm guessing that is implemented in the browser rather than smoething more evil.. From jcfischer at gmail.com Wed Oct 18 13:25:16 2006 From: jcfischer at gmail.com (Jens-Christian Fischer) Date: Wed, 18 Oct 2006 19:25:16 +0200 Subject: [Mongrel] Win32 release coming? Message-ID: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> Hi there what's the status of the 0.13.4 release on Windows? I want to wrap up a project in the next 2 weeks and I'd wait for the new release if it's coming in that timeframe. Otherwise I'd stay with the current windows version. thanks Jens-Christian Fischer From wes at sheldahlconsulting.com Wed Oct 18 14:04:00 2006 From: wes at sheldahlconsulting.com (Wes Sheldahl) Date: Wed, 18 Oct 2006 14:04:00 -0400 Subject: [Mongrel] Mongrel on CentOS 4.3 / RHEL 4.3 64Bit In-Reply-To: <4533566F.90305@SvenMeyer.com> References: <453287FA.5090202@SvenMeyer.com> <3a2de0cd0610151506i3cda19c3t76ea57cbabd3bb5d@mail.gmail.com> <4533566F.90305@SvenMeyer.com> Message-ID: When you have a group of rpm's to install, that depend on each other, I think you can get rpm to order them correctly this way. First, put just the rpm's you want to install or upgrade in a directory by themselves. Then cd to that directory, and run: rpm -Uvh *.rpm. At least that's worked for me in the past. Besides letting rpm take care of installing them in the right order, it gives you a longer coffee break while it sorts everything out. ;-) -- Wes Sheldahl Sheldahl Consulting LLC http://www.sheldahlconsulting.com wes at sheldahlconsulting.com On 10/16/06, Sven Meyer wrote: > > Hi Charles > > many, many thanks for pointing that out to me - I really forgot to install > > ruby-devel-1.8.4-1.c4.x86_64.rpm > > - no it's working fine! > > Problem was, I had to reorder the rpm's while installing, because some > were dependent of other ones ... and then I must have forgotten one. ... > Maybe I could have done that with one command instead and rpm commad would > have figured out the right dependencies itself und would have reordered it > automatically? > > Many thanks again, > > Sven > > > > Charles Brian Quinn wrote: > > I couldn't help but notice that you downloaded the ruby-devel package, > > but didn't install it.... > > > > unless you didn't include that line above.... > > > > This would include the development (header) files for you, I believe. > > > > Let us know if that helps. > > > > On 10/15/06, Sven Meyer wrote: > > > >> I tried to install Rails + Mongrel on CentOS4.3 64Bit (my provider > only has > >> the 64 Bit version available). > >> I found out, that I have to install gcc and emacs-common and have to > copy > >> the *.h files of the ruby source into a certain directory (see below). > >> But finally I get an error messag when I start mongrel and I have no > idea > >> how to solve that problem: > >> > >> > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-docs-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ri-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-libs-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-mode-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-tcltk-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/irb-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/rdoc-1.8.4-1.c4.x86_64.rpm > >> wget > >> > http://dev.centos.org/centos/4/testing/x86_64/RPMS/ruby-devel-1.8.4-1.c4.x86_64.rpm > >> > >> rpm -ivh ruby-libs-1.8.4-1.c4.x86_64.rpm > >> rpm -ivh ruby-1.8.4-1.c4.x86_64.rpm > >> rpm -ivh ruby-docs-1.8.4-1.c4.x86_64.rpm > >> rpm -ivh irb-1.8.4-1.c4.x86_64.rpm > >> rpm -ivh rdoc-1.8.4-1.c4.x86_64.rpm > >> rpm -ivh ri-1.8.4-1.c4.x86_64.rpm > >> rpm -ivh ruby-tcltk-1.8.4-1.c4.x86_64.rpm > >> > >> yum install emacs-common > >> > >> ... > >> > >> Installing: > >> emacs-common x86_64 21.3-19.EL.4 > base 9.7 > >> M > >> ... > >> > >> rpm -ivh ruby-mode-1.8.4-1.c4.x86_64.rpm > >> > >> wget > >> http://rubyforge.org/frs/download.php/11291/rubygems-0.9.0.tgz > >> > >> tar -xzvf rubygems-0.9.0.tgz > >> > >> cd rubygems-0.9.0 > >> > >> ruby setup.rb > >> > >> yum install gcc > >> > >> gem install rails --include-dependencies > >> > >> gem update --system > >> gem update rake > >> gem update rails > >> > >> > >> ************************************************* > >> > >> # gem install momgrel > >> > >> 1. ... > >> > >> > 1 > >> Install required dependency daemons? [Yn] Y > >> Install required dependency gem_plugin? [Yn] Y > >> Building native extensions. This could take a while... > >> can't find header files for ruby. > >> > >> ERROR: While executing gem ... (RuntimeError) > >> ERROR: Failed to build gem native extension. > >> Gem files will remain installed in > >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4 for > >> inspection. > >> > >> > >> Results logged to > >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/ext/http11/gem_make.out > >> > >> ******* > >> > >> If you encounter "can't find header files for ruby" problem, first > download > >> the ruby src from ruby-lang, then copy *.h especially ruby.h to the > result > >> of > >> Config::CONFIG["archdir"](/usr/lib/ruby/1.8/i586-linux-gnu/ > >> on my machine). Reinstall mongrel, then it's ok. > >> > >> > http://www.befittr.com/blog/2006/09/09/configuring-ec2-rails-mongrel-apache-22-and-mysql-5/feed/ > >> > >> *************************************************** > >> > >> because of the above error I'll grab and copy the *.h files of the > ruby > >> source > >> > >> ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz > >> > >> tar -xzvf ruby-1.8.4.tar.gz > >> > >> cp ruby-1.8.4/*.h /usr/lib64/ruby/1.8/x86_64-linux > >> > >> gem install daemons gem_plugin mongrel mongrel_cluster > >> --include-dependencies > >> > >> > >> > >> [rails at centos4364m test1]$ mongrel_rails start -p 8080 > >> > >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:38: > >> uninitialized constant Mongrel::HttpHandler (NameError) > >> from > >> /usr/lib64/site_ruby/1.8/rubygems/custom_require.rb:27:in > >> `require' > >> from > >> /usr/lib64/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:10 > >> from /usr/bin/mongrel_rails:18 > >> > >> > >> > >> > >> _______________________________________________ > >> 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/20061018/0d0c470c/attachment-0001.html From luislavena at gmail.com Wed Oct 18 15:49:47 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 18 Oct 2006 16:49:47 -0300 Subject: [Mongrel] Win32 release coming? In-Reply-To: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> References: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> Message-ID: <71166b3b0610181249h1dd44bc2rba58ea6a1bfe9b54@mail.gmail.com> On 10/18/06, Jens-Christian Fischer wrote: > Hi there > > what's the status of the 0.13.4 release on Windows? I want to wrap up > a project in the next 2 weeks and I'd wait for the new release if > it's coming in that timeframe. Otherwise I'd stay with the current > windows version. Hi Jens, I didn't know that Zed hold the win32 release, I could check the last changes and build the gem tonight. Anyway, I'm working on a new mongrel_service implementation (a native service) and also support for clustering from the same service. You plan to test/develop on windows or deploy as production on it? In that case, I hope you could hold on a bit and deploy with the new service schema. Regards, > > thanks > Jens-Christian Fischer > _______________________________________________ > 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 jcfischer at gmail.com Wed Oct 18 16:59:23 2006 From: jcfischer at gmail.com (Jens-Christian Fischer) Date: Wed, 18 Oct 2006 22:59:23 +0200 Subject: [Mongrel] Win32 release coming? In-Reply-To: <71166b3b0610181249h1dd44bc2rba58ea6a1bfe9b54@mail.gmail.com> References: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> <71166b3b0610181249h1dd44bc2rba58ea6a1bfe9b54@mail.gmail.com> Message-ID: <7D9FFB61-58D4-4144-8316-598DB688A74F@gmail.com> > You plan to test/develop on windows or deploy as production on it? In > that case, I hope you could hold on a bit and deploy with the new > service schema. Yes, it's a production environment (single user, embedded system). In that case I'll hold of a bit. Can I help you in testing? From cameron at theworkinggroup.ca Wed Oct 18 17:20:59 2006 From: cameron at theworkinggroup.ca (Cameron Booth) Date: Wed, 18 Oct 2006 16:20:59 -0500 Subject: [Mongrel] Segmentation bug - file_column? Message-ID: <120B3504-CF42-49AA-86D1-0055231CE97F@theworkinggroup.ca> Hi there everybody, We're having mongrel processes slowly die on us, with a segmentation fault. I've seen a few other people mention similar issues. Any info or suggestions would be nice: Error: /var/www/apps/heritage/current/config/../vendor/plugins/file_column/ lib/magick_file_column.rb:7: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [i386-linux] Server: Railsmachine.com standard setup, I think it's CentOS. Mongrel: I just updated _yesterday_ to 0.3.13.4, before that I was on 0.3.13.3 but I wasn't getting this error. I was instead getting the very occasional mongrel going way out of control and taking over enough memory to force a hard reboot to get back to it. (which is why I upgraded) Do you think the problem is in file_column somewhere? The line it mentions is where it is calling ImageMagick: def transform_with_magick if needs_transform? begin img = ::Magick::Image::read(absolute_path).first <-- This is line 7 Thanks in advance for any ideas!! Cameron From zedshaw at zedshaw.com Thu Oct 19 04:09:44 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 19 Oct 2006 01:09:44 -0700 Subject: [Mongrel] Win32 release coming? In-Reply-To: <7D9FFB61-58D4-4144-8316-598DB688A74F@gmail.com> References: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> <71166b3b0610181249h1dd44bc2rba58ea6a1bfe9b54@mail.gmail.com> <7D9FFB61-58D4-4144-8316-598DB688A74F@gmail.com> Message-ID: <20061019010944.566c2da5.zedshaw@zedshaw.com> On Wed, 18 Oct 2006 22:59:23 +0200 Jens-Christian Fischer wrote: > > You plan to test/develop on windows or deploy as production on it? In > > that case, I hope you could hold on a bit and deploy with the new > > service schema. > > Yes, it's a production environment (single user, embedded system). In > that case I'll hold of a bit. Can I help you in testing? I got some stuff I planned on working on during rubyconf with the important people who can help. I'll push out a 0.14 release at that time that has all the stuff. Sorry for the wait. -- 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 zedshaw at zedshaw.com Thu Oct 19 04:11:37 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 19 Oct 2006 01:11:37 -0700 Subject: [Mongrel] Segmentation bug - file_column? In-Reply-To: <120B3504-CF42-49AA-86D1-0055231CE97F@theworkinggroup.ca> References: <120B3504-CF42-49AA-86D1-0055231CE97F@theworkinggroup.ca> Message-ID: <20061019011137.7b48ffc1.zedshaw@zedshaw.com> On Wed, 18 Oct 2006 16:20:59 -0500 Cameron Booth wrote: > Hi there everybody, > > We're having mongrel processes slowly die on us, with a segmentation > fault. I've seen a few other people mention similar issues. Any info > or suggestions would be nice: > Do you think the problem is in file_column somewhere? The line it > mentions is where it is calling ImageMagick: Looks like a bug in ImageMagick that's probably made worse by something Mongrel does (threads or IO possibly). I'd suggest that if you can't keep it running solid then hook up a monit process on the mongrel machine(s) to keep them going. There's a monit sample in the mongrel gem's source under examples you can use as a start. -- 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 zedshaw at zedshaw.com Thu Oct 19 04:15:24 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 19 Oct 2006 01:15:24 -0700 Subject: [Mongrel] Typo in Apache docs causing MSIE problems? Message-ID: <20061019011524.359d1762.zedshaw@zedshaw.com> Someone contacted me earlier today and pointed out this typo in the mongrel apache documentation: "the following line: BrowserMatch bMSIE !no-gzip !gzip-only-text/html must be written instead as: BrowserMatch \bMSIE !no-gzip !gzip-only-text/html The effect of this typo is that files that are not caught by previously listed rules, such as all *.css and *.js files are never deflated for MSIE users - I was just testing my site with different browsers and stumbled onto this issue." Could this be the cause of some folk's problems with MSIE and Apache? -- 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 luislavena at gmail.com Thu Oct 19 01:20:58 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 19 Oct 2006 02:20:58 -0300 Subject: [Mongrel] Win32 release coming? In-Reply-To: <20061019010944.566c2da5.zedshaw@zedshaw.com> References: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> <71166b3b0610181249h1dd44bc2rba58ea6a1bfe9b54@mail.gmail.com> <7D9FFB61-58D4-4144-8316-598DB688A74F@gmail.com> <20061019010944.566c2da5.zedshaw@zedshaw.com> Message-ID: <71166b3b0610182220t703e7a59q7c81d6bb4cebfe8@mail.gmail.com> On 10/19/06, Zed A. Shaw wrote: > On Wed, 18 Oct 2006 22:59:23 +0200 > Jens-Christian Fischer wrote: > > > > You plan to test/develop on windows or deploy as production on it? In > > > that case, I hope you could hold on a bit and deploy with the new > > > service schema. > > > > Yes, it's a production environment (single user, embedded system). In > > that case I'll hold of a bit. Can I help you in testing? > > I got some stuff I planned on working on during rubyconf with the important people who can help. I'll push out a 0.14 release at that time that has all the stuff. > Guess I'm not one of the *important ones*, nor one at RubyConf :-P Out of luck :-( Zed, drop me a line on these topics, could you? Thanks. > Sorry for the wait. > > -- > 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 > -- 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 Oct 19 04:35:15 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 19 Oct 2006 01:35:15 -0700 Subject: [Mongrel] Win32 release coming? In-Reply-To: <71166b3b0610182220t703e7a59q7c81d6bb4cebfe8@mail.gmail.com> References: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> <71166b3b0610181249h1dd44bc2rba58ea6a1bfe9b54@mail.gmail.com> <7D9FFB61-58D4-4144-8316-598DB688A74F@gmail.com> <20061019010944.566c2da5.zedshaw@zedshaw.com> <71166b3b0610182220t703e7a59q7c81d6bb4cebfe8@mail.gmail.com> Message-ID: <20061019013515.023c3047.zedshaw@zedshaw.com> On Thu, 19 Oct 2006 02:20:58 -0300 "Luis Lavena" wrote: > On 10/19/06, Zed A. Shaw wrote: > > On Wed, 18 Oct 2006 22:59:23 +0200 > > Jens-Christian Fischer wrote: > > > > > > You plan to test/develop on windows or deploy as production on it? In > > > > that case, I hope you could hold on a bit and deploy with the new > > > > service schema. > > > > > > Yes, it's a production environment (single user, embedded system). In > > > that case I'll hold of a bit. Can I help you in testing? > > > > I got some stuff I planned on working on during rubyconf with the important people who can help. I'll push out a 0.14 release at that time that has all the stuff. > > > > Guess I'm not one of the *important ones*, nor one at RubyConf :-P > > Out of luck :-( > > Zed, drop me a line on these topics, could you? Thanks. Hehe, no you're important. Actually I was gonna get with you about making you responsible for building the win32 gems. The main things I want to talk with "important people" is: 1) "Universal Binary Gems" (unlikely) 2) Why Ruby threads in services sucks so bad. I'll literally pin someone to the deck and make them look at the code. 3) Why Ruby is soooooooooooooo slow on win32. 4) Why the hell can't I use rsync on rubyforge. Man it is really annoying. 5) There's about 5 or 6 people who have apps with really weird problems (unrelated to win32) that I hope to meet and go through their code in person (free consulting!). That's all :-) Any other requests while I'm there (from anyone)? -- 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 luislavena at gmail.com Thu Oct 19 02:12:44 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 19 Oct 2006 03:12:44 -0300 Subject: [Mongrel] Win32 release coming? In-Reply-To: <20061019013515.023c3047.zedshaw@zedshaw.com> References: <06EB8BA6-9FEB-484B-81B4-E8655E80894B@gmail.com> <71166b3b0610181249h1dd44bc2rba58ea6a1bfe9b54@mail.gmail.com> <7D9FFB61-58D4-4144-8316-598DB688A74F@gmail.com> <20061019010944.566c2da5.zedshaw@zedshaw.com> <71166b3b0610182220t703e7a59q7c81d6bb4cebfe8@mail.gmail.com> <20061019013515.023c3047.zedshaw@zedshaw.com> Message-ID: <71166b3b0610182312o2334768ne16bbed1f2bf593e@mail.gmail.com> On 10/19/06, Zed A. Shaw wrote: > On Thu, 19 Oct 2006 02:20:58 -0300 > "Luis Lavena" wrote: > > > On 10/19/06, Zed A. Shaw wrote: > > > On Wed, 18 Oct 2006 22:59:23 +0200 > > > Jens-Christian Fischer wrote: > > > > > > > > You plan to test/develop on windows or deploy as production on it? In > > > > > that case, I hope you could hold on a bit and deploy with the new > > > > > service schema. > > > > > > > > Yes, it's a production environment (single user, embedded system). In > > > > that case I'll hold of a bit. Can I help you in testing? > > > > > > I got some stuff I planned on working on during rubyconf with the important people who can help. I'll push out a 0.14 release at that time that has all the stuff. > > > > > > > Guess I'm not one of the *important ones*, nor one at RubyConf :-P > > > > Out of luck :-( > > > > Zed, drop me a line on these topics, could you? Thanks. > > Hehe, no you're important. Actually I was gonna get with you about making you responsible for building the win32 gems. Good!, always wanted to feel important! Yeah!, love make gems! ;-) (not lovemaking with gems, hehehe) > > The main things I want to talk with "important people" is: > > 1) "Universal Binary Gems" (unlikely) > 2) Why Ruby threads in services sucks so bad. I'll literally pin someone to the deck and make them look at the code. By services you mean? > 3) Why Ruby is soooooooooooooo slow on win32. Yeah, been exploring alternatives, even collect (or fund raising) 400 dollars for a intel compiler and get a boost... will experiment and let you know. > 4) Why the hell can't I use rsync on rubyforge. Man it is really annoying. > 5) There's about 5 or 6 people who have apps with really weird problems (unrelated to win32) that I hope to meet and go through their code in person (free consulting!). > > That's all :-) > > Any other requests while I'm there (from anyone)? Yeah, could you make a cup of coffe, capuccino, not expresso, standing in your left hand, with both your legs in the air, one of them (your choice) in parallel to the floor and singing "God save the Queen"? That will make my day. Talk to you soon. > > -- > 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 > -- 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 david at vrensk.com Thu Oct 19 03:56:26 2006 From: david at vrensk.com (David Vrensk) Date: Thu, 19 Oct 2006 09:56:26 +0200 Subject: [Mongrel] (Slightly OT) Re: Win32 release coming? Message-ID: <81b453920610190056n68e56583uc0f3fb7d25174afb@mail.gmail.com> On 10/19/06, Zed A. Shaw wrote: > > I got some stuff I planned on working on during rubyconf with the > important people who can help. I'll push out a 0.14 release at that time > that has all the stuff. Yay! 0.14! And us railsers know that the next version number after 0.14.xis 1.0. Can't wait to have that! Also, I think it was in a RoR podcast that DHH said that, in retrospect, he wished he would have labelled Rails "1.0" a year before he did. If he had done that, he reckoned that more people would have picked it up early, and what is now 1.0 could have been 2.0 instead. Think Java: it's a big step from 1.0 to 2.0, but that didn't shake anyone off the bandwagon, so to speak. And yes Zed, I remember your joke in July: "This will also be the last release before 0.4 Enterprise Edition 1.2.". I wouldn't call Mongrel "EE" yet (since that more or less implies that you need to be a MUDCRAP-CE to install it), but considering the number of people who have switched to mongrel on production systems and never looked back, I don't see why you couldn't call the next stable release "1.0". I think that both you and Mongrel deserve that recognition! Many thanks for your work so far, /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061019/0e61dd31/attachment-0001.html From cameron at theworkinggroup.ca Thu Oct 19 12:42:50 2006 From: cameron at theworkinggroup.ca (Cameron Booth) Date: Thu, 19 Oct 2006 11:42:50 -0500 Subject: [Mongrel] Segmentation bug - file_column? In-Reply-To: <20061019011137.7b48ffc1.zedshaw@zedshaw.com> References: <120B3504-CF42-49AA-86D1-0055231CE97F@theworkinggroup.ca> <20061019011137.7b48ffc1.zedshaw@zedshaw.com> Message-ID: On 19-Oct-06, at 3:11 AM, Zed A. Shaw wrote: >> Hi there everybody, >> >> We're having mongrel processes slowly die on us, with a segmentation >> fault. I've seen a few other people mention similar issues. Any info >> or suggestions would be nice: > > > >> Do you think the problem is in file_column somewhere? The line it >> mentions is where it is calling ImageMagick: > > Looks like a bug in ImageMagick that's probably made worse by > something Mongrel does (threads or IO possibly). I'd suggest that > if you can't keep it running solid then hook up a monit process on > the mongrel machine(s) to keep them going. There's a monit sample > in the mongrel gem's source under examples you can use as a start. Thanks for the very quick response Zed. Setting up montoring makes perfect sense... I think I was so embedded in trying to figure things out it didn't cross my mind at all. However, here's my next question - maybe I'm just not understanding it properly, but I don't see the monit(or) script you mention in the / examples dir of the mongrel-0.3.13.4 gem. There is mongrel_simple_ctrl.rb and mongrel_simple_service.rb, but I'm not sure that those are what you meant. Can anybody point me in the right direction? And as other people have mentioned Zed....thanks so much for all the hard work you're putting into this! Cameron -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061019/63fd9dd3/attachment.html From g.vishnu at gmail.com Thu Oct 19 13:33:30 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Thu, 19 Oct 2006 23:03:30 +0530 Subject: [Mongrel] Segmentation bug - file_column? In-Reply-To: References: <120B3504-CF42-49AA-86D1-0055231CE97F@theworkinggroup.ca> <20061019011137.7b48ffc1.zedshaw@zedshaw.com> Message-ID: Monit is here: http://www.tildeslash.com/monit/ It's an external program you can use for monitoring (and relaunching) other processes as well. Search this list for earlier examples on using monit with mongrel. Vish On 10/19/06, Cameron Booth wrote: > > On 19-Oct-06, at 3:11 AM, Zed A. Shaw wrote: > > Hi there everybody, > > > We're having mongrel processes slowly die on us, with a segmentation > > fault. I've seen a few other people mention similar issues. Any info > > or suggestions would be nice: > > > > > > Do you think the problem is in file_column somewhere? The line it > > mentions is where it is calling ImageMagick: > > > Looks like a bug in ImageMagick that's probably made worse by something > Mongrel does (threads or IO possibly). I'd suggest that if you can't keep > it running solid then hook up a monit process on the mongrel machine(s) to > keep them going. There's a monit sample in the mongrel gem's source under > examples you can use as a start. > > > Thanks for the very quick response Zed. Setting up montoring makes perfect > sense... I think I was so embedded in trying to figure things out it didn't > cross my mind at all. > > However, here's my next question - maybe I'm just not understanding it > properly, but I don't see the monit(or) script you mention in the /examples > dir of the mongrel-0.3.13.4 gem. There is mongrel_simple_ctrl.rb and > mongrel_simple_service.rb, but I'm not sure that those are what you meant. > > Can anybody point me in the right direction? > > And as other people have mentioned Zed....thanks so much for all the hard > work you're putting into this! > > Cameron > > _______________________________________________ > 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/20061019/76c5148d/attachment.html From cameron at theworkinggroup.ca Thu Oct 19 14:43:41 2006 From: cameron at theworkinggroup.ca (Cameron Booth) Date: Thu, 19 Oct 2006 13:43:41 -0500 Subject: [Mongrel] Segmentation bug - file_column? In-Reply-To: References: <120B3504-CF42-49AA-86D1-0055231CE97F@theworkinggroup.ca> <20061019011137.7b48ffc1.zedshaw@zedshaw.com> Message-ID: Vish, thanks for clearing that up. Monit looks to be nicely done (at a quick glance), I'll definitely look at setting it up. I found your earlier posts explaining the setup process to, so I should be good! Cameron On 19-Oct-06, at 12:33 PM, Vishnu Gopal wrote: > Monit is here: http://www.tildeslash.com/monit/ It's an external > program you can use for monitoring (and relaunching) other > processes as well. Search this list for earlier examples on using > monit with mongrel. > > Vish > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061019/8474354d/attachment.html From jan.svitok at gmail.com Thu Oct 19 17:09:35 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Thu, 19 Oct 2006 23:09:35 +0200 Subject: [Mongrel] Gem plugins on win32 mongrel_service Message-ID: <8d9b3d920610191409p1aeb8884o89002071e29f08af@mail.gmail.com> Hi, why are the gemplugins commented out in mongrel_service? What was the problem with them? I'm curiuos because I've used them without problems since the revision 338 (-win32 suffix patch, 31/08). However, my site is a small internal one, so it doesn't mean any heavy testing. Jano From cjwoodward at gmail.com Thu Oct 19 18:24:13 2006 From: cjwoodward at gmail.com (Carl Woodward) Date: Fri, 20 Oct 2006 08:24:13 +1000 Subject: [Mongrel] Mongrel::HttpHandlerPlugin Message-ID: Hi, I'm trying to write a file upload monitor for mongrel that uses juggernaut to alert the browser of a change. I'm writing a plugin that uses Mongrel::HttpHandlerPlugin but it looks like the only method that gets called is process and that is only when the upload has finished. I'm setting the following: @request_notify = true But I am still only getting process to come through. Any ideas? -- Carl Woodward From zedshaw at zedshaw.com Thu Oct 19 21:28:56 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 19 Oct 2006 18:28:56 -0700 Subject: [Mongrel] Gem plugins on win32 mongrel_service In-Reply-To: <8d9b3d920610191409p1aeb8884o89002071e29f08af@mail.gmail.com> References: <8d9b3d920610191409p1aeb8884o89002071e29f08af@mail.gmail.com> Message-ID: <20061019182856.451b2842.zedshaw@zedshaw.com> On Thu, 19 Oct 2006 23:09:35 +0200 "Jan Svitok" wrote: > Hi, > > why are the gemplugins commented out in mongrel_service? What was the > problem with them? > > I'm curiuos because I've used them without problems since the revision > 338 (-win32 suffix patch, 31/08). However, my site is a small internal > one, so it doesn't mean any heavy testing. I believe they jammed up the mongrel service. Another topic I plan to talk about at rubyconf (why would loading gems cause the service to eat it?). -- 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 zedshaw at zedshaw.com Thu Oct 19 22:15:24 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 19 Oct 2006 19:15:24 -0700 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: References: Message-ID: <20061019191524.9ec489a9.zedshaw@zedshaw.com> On Fri, 20 Oct 2006 08:24:13 +1000 "Carl Woodward" wrote: > Hi, > > I'm trying to write a file upload monitor for mongrel that uses > juggernaut to alert the browser of a change. I'm writing a plugin that > uses Mongrel::HttpHandlerPlugin but it looks like the only method that > gets called is process and that is only when the upload has finished. > I'm setting the following: > > @request_notify = true > > But I am still only getting process to come through. > > Any ideas? Did you check out the existing mongrel_upload_progress code works? I'd base your work on that before striking out on your own. -- 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 cjwoodward at gmail.com Thu Oct 19 19:44:59 2006 From: cjwoodward at gmail.com (Carl Woodward) Date: Fri, 20 Oct 2006 09:44:59 +1000 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: References: Message-ID: Hi everyone, I believe I have found the problem. In mongrel.rb (current stable release) line 568: --------------- notifier = handlers[0].request_notify ? handlers[0] : nil request = HttpRequest.new(params, client, notifier) --------------- >From what i can see, plugins that set request_notify will never be notified. Should HttpRequest.initialize take an array of notifiers? That way you can just change the notifier code to be: request = HttpRequest.new(params, client, notifiers.select { |notifier| notifier.request_notify }) I have changed the code very simply to get my plugin to work: notifiers = handlers.select { |handler| handler.request_notify } notifier = notifiers.empty? ? nil : notifiers[0] request = HttpRequest.new(params, client, notifier) This is a very simple change that will get me through for the moment but I am interested to get feedback from the masters on whether I am just being stupid. Any help would be greatly appreciated? Thanks, Carl. On 10/20/06, Carl Woodward wrote: > Hi, > > I'm trying to write a file upload monitor for mongrel that uses > juggernaut to alert the browser of a change. I'm writing a plugin that > uses Mongrel::HttpHandlerPlugin but it looks like the only method that > gets called is process and that is only when the upload has finished. > I'm setting the following: > > @request_notify = true > > But I am still only getting process to come through. > > Any ideas? > > -- > Carl Woodward > -- Carl Woodward 0412218979 cjwoodward at gmail.com From cjwoodward at gmail.com Thu Oct 19 19:49:54 2006 From: cjwoodward at gmail.com (Carl Woodward) Date: Fri, 20 Oct 2006 09:49:54 +1000 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: <20061019191524.9ec489a9.zedshaw@zedshaw.com> References: <20061019191524.9ec489a9.zedshaw@zedshaw.com> Message-ID: Hi Zed, I'm using that code as a base but I couldn't get it to work. I think that the email that I sent before explains why it wouldn't work for me unless I'm doing something stupid in the config then it should work now. I.E. have a read of the last email. Cheers, Carl. On 10/20/06, Zed A. Shaw wrote: > On Fri, 20 Oct 2006 08:24:13 +1000 > "Carl Woodward" wrote: > > > Hi, > > > > I'm trying to write a file upload monitor for mongrel that uses > > juggernaut to alert the browser of a change. I'm writing a plugin that > > uses Mongrel::HttpHandlerPlugin but it looks like the only method that > > gets called is process and that is only when the upload has finished. > > I'm setting the following: > > > > @request_notify = true > > > > But I am still only getting process to come through. > > > > Any ideas? > > Did you check out the existing mongrel_upload_progress code works? I'd base your work on that before striking out on your own. > > > -- > 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 > -- Carl Woodward 0412218979 cjwoodward at gmail.com From luislavena+mongrel at gmail.com Thu Oct 19 19:50:04 2006 From: luislavena+mongrel at gmail.com (Luis Lavena) Date: Thu, 19 Oct 2006 20:50:04 -0300 Subject: [Mongrel] Gem plugins on win32 mongrel_service In-Reply-To: <71166b3b0610191537q65b6bccfx4f33707cb91676d0@mail.gmail.com> References: <8d9b3d920610191409p1aeb8884o89002071e29f08af@mail.gmail.com> <71166b3b0610191537q65b6bccfx4f33707cb91676d0@mail.gmail.com> Message-ID: <71166b3b0610191650g7b26ebd9xa6cf5949e2d12308@mail.gmail.com> On 10/19/06, Jan Svitok wrote: > Hi, > > why are the gemplugins commented out in mongrel_service? What was the > problem with them? That's because when creating the service, doing the loading of the remaining plugins crashed the service. > > I'm curiuos because I've used them without problems since the revision > 338 (-win32 suffix patch, 31/08). However, my site is a small internal > one, so it doesn't mean any heavy testing. > Anyway, was back a few revision ago (the problem isn't related to gems but with win32-service). Feel free to svn checkout and package the gem again. - Hide quoted text - > Jano > _______________________________________________ > 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 technoweenie at gmail.com Thu Oct 19 20:03:48 2006 From: technoweenie at gmail.com (Rick Olson) Date: Thu, 19 Oct 2006 19:03:48 -0500 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: <20061019191524.9ec489a9.zedshaw@zedshaw.com> References: <20061019191524.9ec489a9.zedshaw@zedshaw.com> Message-ID: <48fe25b0610191703y3c2de369q8521fbba3aab0e51@mail.gmail.com> On 10/19/06, Zed A. Shaw wrote: > On Fri, 20 Oct 2006 08:24:13 +1000 > "Carl Woodward" wrote: > > > Hi, > > > > I'm trying to write a file upload monitor for mongrel that uses > > juggernaut to alert the browser of a change. I'm writing a plugin that > > uses Mongrel::HttpHandlerPlugin but it looks like the only method that > > gets called is process and that is only when the upload has finished. > > I'm setting the following: > > > > @request_notify = true > > > > But I am still only getting process to come through. > > > > Any ideas? > > Did you check out the existing mongrel_upload_progress code works? I'd base your work on that before striking out on your own. It should work just fine. You just need to write a custom action to return the status for juggernaut though. I'm not sure how you prefer to do that. The MUP example in the docs show a rails action to return custom javascript code for an iframe... -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From cjwoodward at gmail.com Thu Oct 19 21:25:39 2006 From: cjwoodward at gmail.com (Carl Woodward) Date: Fri, 20 Oct 2006 11:25:39 +1000 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: <48fe25b0610191703y3c2de369q8521fbba3aab0e51@mail.gmail.com> References: <20061019191524.9ec489a9.zedshaw@zedshaw.com> <48fe25b0610191703y3c2de369q8521fbba3aab0e51@mail.gmail.com> Message-ID: Hi Rick, I actually think I found a bug in mongrel, see a couple of emails back. I would be really interested in your feedback? Thanks, Carl. On 10/20/06, Rick Olson wrote: > On 10/19/06, Zed A. Shaw wrote: > > On Fri, 20 Oct 2006 08:24:13 +1000 > > "Carl Woodward" wrote: > > > > > Hi, > > > > > > I'm trying to write a file upload monitor for mongrel that uses > > > juggernaut to alert the browser of a change. I'm writing a plugin that > > > uses Mongrel::HttpHandlerPlugin but it looks like the only method that > > > gets called is process and that is only when the upload has finished. > > > I'm setting the following: > > > > > > @request_notify = true > > > > > > But I am still only getting process to come through. > > > > > > Any ideas? > > > > Did you check out the existing mongrel_upload_progress code works? I'd base your work on that before striking out on your own. > > It should work just fine. You just need to write a custom action to > return the status for juggernaut though. I'm not sure how you prefer > to do that. The MUP example in the docs show a rails action to return > custom javascript code for an iframe... > > -- > 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 > -- Carl Woodward 0412218979 cjwoodward at gmail.com From technoweenie at gmail.com Thu Oct 19 21:57:15 2006 From: technoweenie at gmail.com (Rick Olson) Date: Thu, 19 Oct 2006 20:57:15 -0500 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: References: <20061019191524.9ec489a9.zedshaw@zedshaw.com> <48fe25b0610191703y3c2de369q8521fbba3aab0e51@mail.gmail.com> Message-ID: <48fe25b0610191857u4aa6257chc82a1d1778c8c30a@mail.gmail.com> On 10/19/06, Carl Woodward wrote: > Hi Rick, I actually think I found a bug in mongrel, see a couple of > emails back. I would be really interested in your feedback? > I think the idea is you use :in_front => true to put your filter w/ a notifier in the front. Or, you can use #detect instead of select, which returns the first match. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From schwuk at gmail.com Fri Oct 20 12:13:04 2006 From: schwuk at gmail.com (Dave Murphy) Date: Fri, 20 Oct 2006 17:13:04 +0100 Subject: [Mongrel] win32-service weirdness Message-ID: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> I've got my application running under Windows with mongrel perfectly, so it was time to convert it to a service. service::install works fine, but service:start gives me some "One moment, start pending" and then lots of "One moment, stopped". After a bit of digging I found this in the service.log: ** Starting Mongrel in production mode at :3000 ** Starting Rails in environment production ... c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing': uninitialized constant Enum (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.13.0-win32/lib/RMagick.rb:28 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/gruff-0.2.4/lib/gruff/base.rb:18 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/gruff-0.2.4/lib/gruff.rb:3 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `require' ... 7 levels... from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:750:in `initialize' from c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:52:in `service_init' from c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:153 from c:/ruby/bin/mongrel_service:18 It's only the service that has a problem - running the app via mongrel works fine. cheers, -- Dave Murphy (Schwuk) http://schwuk.com From schwuk at gmail.com Fri Oct 20 12:19:34 2006 From: schwuk at gmail.com (Dave Murphy) Date: Fri, 20 Oct 2006 17:19:34 +0100 Subject: [Mongrel] win32-service weirdness In-Reply-To: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> References: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> Message-ID: <2e60a9e60610200919h234b2a25o38e26d5e177c97be@mail.gmail.com> Sorry - the title should have been "mongrel_service weirdness". -- Dave Murphy (Schwuk) http://schwuk.com From luislavena at gmail.com Fri Oct 20 12:54:08 2006 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 20 Oct 2006 13:54:08 -0300 Subject: [Mongrel] win32-service weirdness In-Reply-To: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> References: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> Message-ID: <71166b3b0610200954p7d2e825fv877f55a9fc8fa556@mail.gmail.com> On 10/20/06, Dave Murphy wrote: > I've got my application running under Windows with mongrel perfectly, > so it was time to convert it to a service. service::install works > fine, but service:start gives me some "One moment, start pending" and > then lots of "One moment, stopped". > I have seen this... mongrel_service is too informative... > After a bit of digging I found this in the service.log: > > ** Starting Mongrel in production mode at :3000 > ** Starting Rails in environment production ... > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in > `const_missing': uninitialized constant Enum (NameError) > from c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.13.0-win32/lib/RMagick.rb:28 > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `require' > from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in > `require' > from c:/ruby/lib/ruby/gems/1.8/gems/gruff-0.2.4/lib/gruff/base.rb:18 > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in > `require' > from c:/ruby/lib/ruby/gems/1.8/gems/gruff-0.2.4/lib/gruff.rb:3 > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in `require' > ... 7 levels... > from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:750:in > `initialize' > from c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:52:in > `service_init' > from c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:153 > from c:/ruby/bin/mongrel_service:18 > > It's only the service that has a problem - running the app via mongrel > works fine. > Other weirdness of mongrel_service. I wish could kill it right now, but can't. This happens with all your rails applications? For what I see, rmagick is used, please try in a service (rails app) without rmagick and check if it work. Also, what OS and SP are you using? ruby? (official build, one-click installer, what). > cheers, > -- > Dave Murphy (Schwuk) > http://schwuk.com > _______________________________________________ > 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 schwuk at gmail.com Fri Oct 20 14:14:11 2006 From: schwuk at gmail.com (Dave Murphy) Date: Fri, 20 Oct 2006 19:14:11 +0100 Subject: [Mongrel] win32-service weirdness In-Reply-To: <71166b3b0610200954p7d2e825fv877f55a9fc8fa556@mail.gmail.com> References: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> <71166b3b0610200954p7d2e825fv877f55a9fc8fa556@mail.gmail.com> Message-ID: <2e60a9e60610201114wf810113hcd7a1a640ec171a5@mail.gmail.com> On 20/10/06, Luis Lavena wrote: > This happens with all your rails applications? For what I see, rmagick > is used, please try in a service (rails app) without rmagick and check > if it work. rmagick (via gruff) is used, and it works fine with mongrel just not mongrel_service. I'll sort out a test for a non-rmagick app. I deciphered that rmagick was causing mongrel_service to fail, but not enough information was given for me to figure out why. > Also, what OS and SP are you using? > ruby? (official build, one-click installer, what). XP Pro SP2, One-Click 1.8.4-20, Rails 1.1.6. -- Dave Murphy (Schwuk) http://schwuk.com From luislavena at gmail.com Fri Oct 20 15:12:17 2006 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 20 Oct 2006 16:12:17 -0300 Subject: [Mongrel] win32-service weirdness In-Reply-To: <2e60a9e60610201114wf810113hcd7a1a640ec171a5@mail.gmail.com> References: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> <71166b3b0610200954p7d2e825fv877f55a9fc8fa556@mail.gmail.com> <2e60a9e60610201114wf810113hcd7a1a640ec171a5@mail.gmail.com> Message-ID: <71166b3b0610201212n2bcdca20o7760047e62af2b07@mail.gmail.com> On 10/20/06, Dave Murphy wrote: > On 20/10/06, Luis Lavena wrote: > > This happens with all your rails applications? For what I see, rmagick > > is used, please try in a service (rails app) without rmagick and check > > if it work. > > rmagick (via gruff) is used, and it works fine with mongrel just not > mongrel_service. I'll sort out a test for a non-rmagick app. > > I deciphered that rmagick was causing mongrel_service to fail, but not > enough information was given for me to figure out why. > Please take in consideration that services run under SYSTEM account, something that could brake things on files/dll/programs with wrong permissions (NTFS). > > Also, what OS and SP are you using? > > ruby? (official build, one-click installer, what). > > XP Pro SP2, One-Click 1.8.4-20, Rails 1.1.6. > -- > Dave Murphy (Schwuk) > http://schwuk.com > _______________________________________________ > 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 Marc.Love at herbank.com Fri Oct 20 19:20:35 2006 From: Marc.Love at herbank.com (Marc Love) Date: Fri, 20 Oct 2006 16:20:35 -0700 Subject: [Mongrel] Apache/Mongrel Question Message-ID: <4538F753.2DB1.006D.0@herbank.com> I'm setting up a new server in anticipation of switching from lighttpd+fcgi. My application isn't completely imported yet, so I don't expect it to work. For instance right now when pulling up my app from localhost I get my Ruby/Rails MySQL error message. But when I pull it up from a remote computer I get a proxy error from Apache: ====================== Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /. Reason: Error reading from remote server Additionally, a 502 Bad Gateway error was encountered while trying to use an ErrorDocument to handle the request. ====================== Is there a reason why I get this instead of the Ruby/Rails error? -Marc ==================DISCLAIMER================================ This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies of it from your system. The sender accepts no responsibility for viruses and it is your responsibility to scan attachments (if any). No contracts may be concluded on behalf of the sender by means of email communications unless expressly stated to the contrary. ==================DISCLAIMER================================ From schwuk at gmail.com Fri Oct 20 20:10:31 2006 From: schwuk at gmail.com (Dave Murphy) Date: Sat, 21 Oct 2006 01:10:31 +0100 Subject: [Mongrel] win32-service weirdness In-Reply-To: <71166b3b0610201212n2bcdca20o7760047e62af2b07@mail.gmail.com> References: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> <71166b3b0610200954p7d2e825fv877f55a9fc8fa556@mail.gmail.com> <2e60a9e60610201114wf810113hcd7a1a640ec171a5@mail.gmail.com> <71166b3b0610201212n2bcdca20o7760047e62af2b07@mail.gmail.com> Message-ID: <2e60a9e60610201710j2f5ad393ubed5773734ca85af@mail.gmail.com> Oh how quickly you forget! I've been spoilt by developing under Linux... a quick reboot of the Windows Server and the problem vanished! -- Dave Murphy (Schwuk) http://schwuk.com From jgeiger at gmail.com Fri Oct 20 20:18:22 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Fri, 20 Oct 2006 19:18:22 -0500 Subject: [Mongrel] Apache/Mongrel Question In-Reply-To: <4538F753.2DB1.006D.0@herbank.com> References: <4538F753.2DB1.006D.0@herbank.com> Message-ID: <466af3440610201718r4c59c7d6g57b411b3dcbac84e@mail.gmail.com> You're getting this error because apache isn't finding anything on the other end of the proxy. For example, if you're doing: ProxyPass / 127.0.0.1:3000/ 127.0.0.1:3000 isn't responding, so apache can't pass the request off. On 10/20/06, Marc Love wrote: > I'm setting up a new server in anticipation of switching from lighttpd+fcgi. My application isn't completely imported yet, so I don't expect it to work. For instance right now when pulling up my app from localhost I get my Ruby/Rails MySQL error message. But when I pull it up from a remote computer I get a proxy error from Apache: > > ====================== > Proxy Error > > The proxy server received an invalid response from an upstream server. > The proxy server could not handle the request GET /. > > Reason: Error reading from remote server > > Additionally, a 502 Bad Gateway error was encountered while trying to use an ErrorDocument to handle the request. > ====================== > > Is there a reason why I get this instead of the Ruby/Rails error? > > -Marc > > > > ==================DISCLAIMER================================ > This email may contain confidential and privileged material for the sole use of the intended recipient. > Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies of it from your system. > The sender accepts no responsibility for viruses and it is your responsibility to scan attachments (if any). > No contracts may be concluded on behalf of the sender by means of email communications unless expressly stated to the contrary. > ==================DISCLAIMER================================ > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From technoweenie at gmail.com Fri Oct 20 20:21:47 2006 From: technoweenie at gmail.com (Rick Olson) Date: Fri, 20 Oct 2006 19:21:47 -0500 Subject: [Mongrel] Apache/Mongrel Question In-Reply-To: <4538F753.2DB1.006D.0@herbank.com> References: <4538F753.2DB1.006D.0@herbank.com> Message-ID: <48fe25b0610201721h48202ee6i41a0c12ce0c75360@mail.gmail.com> On 10/20/06, Marc Love wrote: > I'm setting up a new server in anticipation of switching from lighttpd+fcgi. My application isn't completely imported yet, so I don't expect it to work. For instance right now when pulling up my app from localhost I get my Ruby/Rails MySQL error message. But when I pull it up from a remote computer I get a proxy error from Apache: > > ====================== > Proxy Error > > The proxy server received an invalid response from an upstream server. > The proxy server could not handle the request GET /. > > Reason: Error reading from remote server > > Additionally, a 502 Bad Gateway error was encountered while trying to use an ErrorDocument to handle the request. > ====================== > > Is there a reason why I get this instead of the Ruby/Rails error? your rails app is dead, that's why. "The proxy server received an invalid response from an upstream server." upstream server == mongrel -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From Marc.Love at herbank.com Fri Oct 20 20:48:27 2006 From: Marc.Love at herbank.com (Marc Love) Date: Fri, 20 Oct 2006 17:48:27 -0700 Subject: [Mongrel] Apache/Mongrel Question In-Reply-To: <466af3440610201718r4c59c7d6g57b411b3dcbac84e@mail.gmail.com> References: <4538F753.2DB1.006D.0@herbank.com> <466af3440610201718r4c59c7d6g57b411b3dcbac84e@mail.gmail.com> Message-ID: <45390BEB.2DB1.006D.0@herbank.com> I don't understand why Apache would find something when I'm accessing it on the localhost but wouldn't find something when I'm accessing it from a remote computer. I'm using mod_proxy_balancer, so Apache is passing off the requests to the mongrel_cluster, right? Regardless of where the request is coming from. So why would I get a Rails error message on the localhost, but an Apache error on a remote host? >>> "Joey Geiger" 10/20/2006 5:18 PM >>> You're getting this error because apache isn't finding anything on the other end of the proxy. For example, if you're doing: ProxyPass / 127.0.0.1:3000/ 127.0.0.1:3000 isn't responding, so apache can't pass the request off. On 10/20/06, Marc Love wrote: > I'm setting up a new server in anticipation of switching from lighttpd+fcgi. My application isn't completely imported yet, so I don't expect it to work. For instance right now when pulling up my app from localhost I get my Ruby/Rails MySQL error message. But when I pull it up from a remote computer I get a proxy error from Apache: > > ====================== > Proxy Error > > The proxy server received an invalid response from an upstream server. > The proxy server could not handle the request GET /. > > Reason: Error reading from remote server > > Additionally, a 502 Bad Gateway error was encountered while trying to use an ErrorDocument to handle the request. > ====================== > > Is there a reason why I get this instead of the Ruby/Rails error? > > -Marc > > > > ==================DISCLAIMER================================ > This email may contain confidential and privileged material for the sole use of the intended recipient. > Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies of it from your system. > The sender accepts no responsibility for viruses and it is your responsibility to scan attachments (if any). > No contracts may be concluded on behalf of the sender by means of email communications unless expressly stated to the contrary. > ==================DISCLAIMER================================ > _______________________________________________ > 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 ==================DISCLAIMER================================ This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies of it from your system. The sender accepts no responsibility for viruses and it is your responsibility to scan attachments (if any). No contracts may be concluded on behalf of the sender by means of email communications unless expressly stated to the contrary. ==================DISCLAIMER================================ From luislavena at gmail.com Sat Oct 21 00:25:59 2006 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 21 Oct 2006 01:25:59 -0300 Subject: [Mongrel] win32-service weirdness In-Reply-To: <2e60a9e60610201710j2f5ad393ubed5773734ca85af@mail.gmail.com> References: <2e60a9e60610200913j6a23b936w64a01de13229dced@mail.gmail.com> <71166b3b0610200954p7d2e825fv877f55a9fc8fa556@mail.gmail.com> <2e60a9e60610201114wf810113hcd7a1a640ec171a5@mail.gmail.com> <71166b3b0610201212n2bcdca20o7760047e62af2b07@mail.gmail.com> <2e60a9e60610201710j2f5ad393ubed5773734ca85af@mail.gmail.com> Message-ID: <71166b3b0610202125i650836b6rc3e9b7af178e32e8@mail.gmail.com> On 10/20/06, Dave Murphy wrote: > Oh how quickly you forget! I've been spoilt by developing under > Linux... a quick reboot of the Windows Server and the problem > vanished! Another satisfied customer! Yeah! One of the joys of windows... reboot! ;-) > -- > Dave Murphy (Schwuk) > http://schwuk.com > _______________________________________________ > 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 anatol.pomozov at gmail.com Sat Oct 21 01:34:13 2006 From: anatol.pomozov at gmail.com (Anatol Pomozov) Date: Sat, 21 Oct 2006 09:34:13 +0400 Subject: [Mongrel] Apache/Mongrel Question In-Reply-To: <45390BEB.2DB1.006D.0@herbank.com> References: <4538F753.2DB1.006D.0@herbank.com> <466af3440610201718r4c59c7d6g57b411b3dcbac84e@mail.gmail.com> <45390BEB.2DB1.006D.0@herbank.com> Message-ID: <3665a1a00610202234n628e0580w95eb394f7429a1a5@mail.gmail.com> Hi Mark. See here http://blog.pomozov.info/posts/apache-mongrel-and-proxy-error.htmlI think this is your case. On 10/21/06, Marc Love wrote: > > I don't understand why Apache would find something when I'm accessing it > on the localhost but wouldn't find something when I'm accessing it from a > remote computer. > > I'm using mod_proxy_balancer, so Apache is passing off the requests to the > mongrel_cluster, right? Regardless of where the request is coming from. So > why would I get a Rails error message on the localhost, but an Apache error > on a remote host? > > >>> "Joey Geiger" 10/20/2006 5:18 PM >>> > You're getting this error because apache isn't finding anything on the > other end of the proxy. > > For example, if you're doing: > > ProxyPass / 127.0.0.1:3000/ > > 127.0.0.1:3000 isn't responding, so apache can't pass the request off. > > On 10/20/06, Marc Love wrote: > > I'm setting up a new server in anticipation of switching from > lighttpd+fcgi. My application isn't completely imported yet, so I don't > expect it to work. For instance right now when pulling up my app from > localhost I get my Ruby/Rails MySQL error message. But when I pull it up > from a remote computer I get a proxy error from Apache: > > > > ====================== > > Proxy Error > > > > The proxy server received an invalid response from an upstream server. > > The proxy server could not handle the request GET /. > > > > Reason: Error reading from remote server > > > > Additionally, a 502 Bad Gateway error was encountered while trying to > use an ErrorDocument to handle the request. > > ====================== > > > > Is there a reason why I get this instead of the Ruby/Rails error? > > > > -Marc > > > > > > > > ==================DISCLAIMER================================ > > This email may contain confidential and privileged material for the sole > use of the intended recipient. > > Any review or distribution by others is strictly prohibited. If you are > not the intended recipient, please contact the sender and delete all copies > of it from your system. > > The sender accepts no responsibility for viruses and it is your > responsibility to scan attachments (if any). > > No contracts may be concluded on behalf of the sender by means of email > communications unless expressly stated to the contrary. > > ==================DISCLAIMER================================ > > _______________________________________________ > > 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 > > > > ==================DISCLAIMER================================ > This email may contain confidential and privileged material for the sole > use of the intended recipient. > Any review or distribution by others is strictly prohibited. If you are > not the intended recipient, please contact the sender and delete all copies > of it from your system. > The sender accepts no responsibility for viruses and it is your > responsibility to scan attachments (if any). > No contracts may be concluded on behalf of the sender by means of email > communications unless expressly stated to the contrary. > ==================DISCLAIMER================================ > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- anatol (http://feeds.feedburner.com/apomozov-eng) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061021/8dd6656e/attachment.html From eden.li at gmail.com Sat Oct 21 01:59:34 2006 From: eden.li at gmail.com (Eden Li) Date: Sat, 21 Oct 2006 13:59:34 +0800 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: <48fe25b0610191857u4aa6257chc82a1d1778c8c30a@mail.gmail.com> References: <20061019191524.9ec489a9.zedshaw@zedshaw.com> <48fe25b0610191703y3c2de369q8521fbba3aab0e51@mail.gmail.com> <48fe25b0610191857u4aa6257chc82a1d1778c8c30a@mail.gmail.com> Message-ID: <565dbdd40610202259k50359588n55e90092fd1ace76@mail.gmail.com> > I think the idea is you use :in_front => true to put your filter w/ a > notifier in the front. Or, you can use #detect instead of select, > which returns the first match. So you can only have one handler with a notifier? Is this intended? What will happen if there are two :in_fronts? Last one wins? Not to be nitpicky, but this smells like a bug or at least should be documented? From eden.li at gmail.com Sat Oct 21 03:45:59 2006 From: eden.li at gmail.com (Eden Li) Date: Sat, 21 Oct 2006 15:45:59 +0800 Subject: [Mongrel] Mongrel::HttpHandlerPlugin In-Reply-To: <565dbdd40610202259k50359588n55e90092fd1ace76@mail.gmail.com> References: <20061019191524.9ec489a9.zedshaw@zedshaw.com> <48fe25b0610191703y3c2de369q8521fbba3aab0e51@mail.gmail.com> <48fe25b0610191857u4aa6257chc82a1d1778c8c30a@mail.gmail.com> <565dbdd40610202259k50359588n55e90092fd1ace76@mail.gmail.com> Message-ID: <565dbdd40610210045k4abece1cqe823731273284ed9@mail.gmail.com> Silly me... it does appear to be documented: http://mongrel.rubyforge.org/rdoc/classes/Mongrel/HttpHandler.html#M000070 On 10/21/06, Eden Li wrote: > > I think the idea is you use :in_front => true to put your filter w/ a > > notifier in the front. Or, you can use #detect instead of select, > > which returns the first match. > > So you can only have one handler with a notifier? Is this intended? > What will happen if there are two :in_fronts? Last one wins? > > Not to be nitpicky, but this smells like a bug or at least should be documented? From cdcarter at gmail.com Sat Oct 21 23:39:12 2006 From: cdcarter at gmail.com (Chris Carter) Date: Sat, 21 Oct 2006 22:39:12 -0500 Subject: [Mongrel] Daemonize Problems Message-ID: <86987bdf0610212039m22bda930l89e28f7312e3c45c@mail.gmail.com> Hi all, I wrote a mongrel handler/script that I would like to be daemonizable. At first I tried adding the daemonize line to my configurator, but i was always getting 404's and the log was nto being written to. So I added a call to Daemonize.daemonize('mongrel.log') at the top, and cut the daemonizer line. It still 404s and the log file is still not being written to. How does the daemonizer work? How can i make it work with my code? If interested, you can check the project out at metacampsite.com/mongrel. Thanks! -- Chris Carter concentrationstudios.com brynmawrcs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061021/92fcc0ce/attachment.html From eule at space.ch Sun Oct 22 10:30:05 2006 From: eule at space.ch (Kaspar Schiess) Date: Sun, 22 Oct 2006 16:30:05 +0200 Subject: [Mongrel] --user and --group switch broken in TRUNK Message-ID: It seems that a recent code cleanup broke --user and --group switch in the trunk. Mongrel essentially ignores these commands. This applies to everyone who has installed gem install mongrel --source=http://mongrel.rubyforge.org/releases/ recently. I have attached a patch to revert to some old working code. best regards, kaspar -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 061021-user-switch.patch Url: http://rubyforge.org/pipermail/mongrel-users/attachments/20061022/047bde91/attachment.ksh From wayneeseguin at gmail.com Sun Oct 22 16:53:23 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Sun, 22 Oct 2006 16:53:23 -0400 Subject: [Mongrel] Configuration Error? Message-ID: I'm trying to get a rails app running with this configuration: Mongrel, Apache 2.2, mod_proxy load balancer and Rails 1.1.6 error I have a rails app on another server working with (apparantly) the same configuration and it runs fine so I'm stumped. I'm wondering if anyone has any insight into the error I have pasted below. It seems to be one of those errors that is a side effect of something else, possibly a misconfiguration on my part. Thanks!!! ~Wayne ======================================================================== ** Daemonized, any open files are closed. Look at /home/project/ shared/log/mongrel.1080.pid and /home/project/shared/log/mongrel. 1081.log for info. ** Starting Mongrel listening at 127.0.0.1:1081 ** Starting Rails with production environment... /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb: 280:in `send': undefined method `cache_template_loading=' for ActionController::Base:Class (NoMethodError) from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/ initializer.rb:280:in `initialize_framework_settings' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/ initializer.rb:279:in `initialize_framework_settings' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/ initializer.rb:276:in `initialize_framework_settings' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/ initializer.rb:93:in `process' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/ initializer.rb:42:in `run' from /home/project/current/config/environment.rb:10 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:27:in `require' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/ mongrel/rails.rb:161:in `rails' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/ mongrel_rails:112:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/ mongrel/configurator.rb:134:in `listener' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/ mongrel_rails:98:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/ mongrel/configurator.rb:51:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/ mongrel_rails:85:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/ mongrel/command.rb:211:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/ mongrel_rails:231 from /usr/local/bin/mongrel_rails:18 From eden.li at gmail.com Sun Oct 22 17:16:46 2006 From: eden.li at gmail.com (Eden Li) Date: Mon, 23 Oct 2006 05:16:46 +0800 Subject: [Mongrel] GzipFilter gemplugin now available Message-ID: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> This GemPlugin will gzip your HTTP responses from mongrel if the client says that it supports it (eg, most modern browsers). I've tested it in IE6, Firefox 1.5 and Firefox 2.0RC3 Install: gem install gzip_filter --source http://edenli.com Configure (assuming rails): cd RAILS_ROOT echo 'uri "/", :handler => plugin("/handlers/gzipfilter")' >> config/mongrel.conf Run: mongrel_rails start -S config/mongrel.conf If you want to use this with a cluster, add "config_script: config/mongrel.conf" to your config/mongrel_cluster.yml file. Somewhat related: I also patched the deflatefilter against mongrel 0.13.5 to work with IE and (probably) Safari. It's available here if you want to use the deflate encoding instead (savings difference is miniscule): http://rubyforge.org/tracker/?func=detail&aid=6275&group_id=1306&atid=5147 From zedshaw at zedshaw.com Sun Oct 22 21:39:37 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 22 Oct 2006 18:39:37 -0700 Subject: [Mongrel] GzipFilter gemplugin now available In-Reply-To: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> References: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> Message-ID: <20061022183937.859f2ac5.zedshaw@zedshaw.com> On Mon, 23 Oct 2006 05:16:46 +0800 "Eden Li" wrote: > This GemPlugin will gzip your HTTP responses from mongrel if the > client says that it supports it (eg, most modern browsers). I've > tested it in IE6, Firefox 1.5 and Firefox 2.0RC3 Nice, thanks for this. > Somewhat related: > I also patched the deflatefilter against mongrel 0.13.5 to work with > IE and (probably) Safari. It's available here if you want to use the > deflate encoding instead (savings difference is miniscule): > http://rubyforge.org/tracker/?func=detail&aid=6275&group_id=1306&atid=5147 Ah, so you figured it out. I'll take a look and try to apply it for the next release. -- 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 zedshaw at zedshaw.com Sun Oct 22 21:33:01 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 22 Oct 2006 18:33:01 -0700 Subject: [Mongrel] --user and --group switch broken in TRUNK In-Reply-To: References: Message-ID: <20061022183301.49768a9a.zedshaw@zedshaw.com> On Sun, 22 Oct 2006 16:30:05 +0200 Kaspar Schiess wrote: > It seems that a recent code cleanup broke --user and --group switch in > the trunk. Mongrel essentially ignores these commands. This applies to > everyone who has installed > > gem install mongrel --source=http://mongrel.rubyforge.org/releases/ > > recently. I have attached a patch to revert to some old working code. Thanks Kaspar, I'll apply this. -- 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 zedshaw at zedshaw.com Sun Oct 22 21:38:19 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 22 Oct 2006 18:38:19 -0700 Subject: [Mongrel] Configuration Error? In-Reply-To: References: Message-ID: <20061022183819.86e89420.zedshaw@zedshaw.com> On Sun, 22 Oct 2006 16:53:23 -0400 "Wayne E. Seguin" wrote: > I'm trying to get a rails app running with this configuration: > > Mongrel, Apache 2.2, mod_proxy load balancer and Rails 1.1.6 error > > > I have a rails app on another server working with (apparantly) the > same configuration and it runs fine so I'm stumped. > > I'm wondering if anyone has any insight into the error I have pasted > below. > > It seems to be one of those errors that is a side effect of something > else, possibly a misconfiguration on my part. Looks like you might have created a method named "send", but that's a Ruby reserved method. If you do this all sorts of bad things happen. But, that's just from a quick glance. -- 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 jeroen at supercool.nl Mon Oct 23 02:27:49 2006 From: jeroen at supercool.nl (Jeroen Houben) Date: Mon, 23 Oct 2006 08:27:49 +0200 Subject: [Mongrel] GzipFilter gemplugin now available In-Reply-To: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> References: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> Message-ID: <453C60E5.4060504@supercool.nl> Eden Li wrote: > This GemPlugin will gzip your HTTP responses from mongrel if the > client says that it supports it (eg, most modern browsers). Is this is only meant for apps that just use mongrel and nothing in front of it? I would assume you can just switch on output compression in Apache, if you're using that. But maybe I'm missing something here.. Jeroen From eden.li at gmail.com Mon Oct 23 03:13:42 2006 From: eden.li at gmail.com (Eden Li) Date: Mon, 23 Oct 2006 15:13:42 +0800 Subject: [Mongrel] GzipFilter gemplugin now available In-Reply-To: <453C60E5.4060504@supercool.nl> References: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> <453C60E5.4060504@supercool.nl> Message-ID: <565dbdd40610230013p41cc4f68s812450abd18b0e29@mail.gmail.com> Pretty much, but that seems to be a common setup. I use pen to load balance across a mongrel cluster, so mongrel is serving up my rails app directly. Nowhere is apache in the picture. On 10/23/06, Jeroen Houben wrote: > Is this is only meant for apps that just use mongrel and nothing in > front of it? I would assume you can just switch on output compression in > Apache, if you're using that. But maybe I'm missing something here.. From technoweenie at gmail.com Mon Oct 23 03:25:53 2006 From: technoweenie at gmail.com (Rick Olson) Date: Mon, 23 Oct 2006 02:25:53 -0500 Subject: [Mongrel] GzipFilter gemplugin now available In-Reply-To: <453C60E5.4060504@supercool.nl> References: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> <453C60E5.4060504@supercool.nl> Message-ID: <48fe25b0610230025x43562168x840b42447c5e0ef2@mail.gmail.com> On 10/23/06, Jeroen Houben wrote: > Eden Li wrote: > > This GemPlugin will gzip your HTTP responses from mongrel if the > > client says that it supports it (eg, most modern browsers). > > Is this is only meant for apps that just use mongrel and nothing in > front of it? I would assume you can just switch on output compression in > Apache, if you're using that. But maybe I'm missing something here.. > Does apache gzip dynamic requests? I don't think lighttpd did in my experience. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From al-mongrelusers at none.at Mon Oct 23 04:07:59 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Mon, 23 Oct 2006 10:07:59 +0200 Subject: [Mongrel] GzipFilter gemplugin now available In-Reply-To: <48fe25b0610230025x43562168x840b42447c5e0ef2@mail.gmail.com> References: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> <453C60E5.4060504@supercool.nl> <48fe25b0610230025x43562168x840b42447c5e0ef2@mail.gmail.com> Message-ID: <20061023080758.GA13373@none.at> On Mon 23.10.2006 02:25, Rick Olson wrote: >On 10/23/06, Jeroen Houben wrote: >> >> Is this is only meant for apps that just use mongrel and nothing in >> front of it? I would assume you can just switch on output compression >> in Apache, if you're using that. But maybe I'm missing something >> here.. >> > >Does apache gzip dynamic requests? I don't think lighttpd did in my >experience. Since 2.x the mod_deflate is integrated and can be configured to deliver some content compressed: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html Lighty can also compress the content: http://trac.lighttpd.net/trac/wiki/Mod_Deflate and of course nginx also ;-): http://wiki.codemongers.com/NginxHttpGzipModule Hth Aleks From technoweenie at gmail.com Mon Oct 23 04:23:18 2006 From: technoweenie at gmail.com (Rick Olson) Date: Mon, 23 Oct 2006 03:23:18 -0500 Subject: [Mongrel] GzipFilter gemplugin now available In-Reply-To: <20061023080758.GA13373@none.at> References: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> <453C60E5.4060504@supercool.nl> <48fe25b0610230025x43562168x840b42447c5e0ef2@mail.gmail.com> <20061023080758.GA13373@none.at> Message-ID: <48fe25b0610230123l3243e37eu6f8cccb4872f4078@mail.gmail.com> > Since 2.x the mod_deflate is integrated and can be configured to deliver > some content compressed: > > http://httpd.apache.org/docs/2.0/mod/mod_deflate.html > > Lighty can also compress the content: > > http://trac.lighttpd.net/trac/wiki/Mod_Deflate > > and of course nginx also ;-): > > http://wiki.codemongers.com/NginxHttpGzipModule > > Hth > > Aleks ah, well there you go. there are a few cases where you're not behind one of those and you may need something like this. Hell, I hacked up a quick regex/rewrite plugin for the same reason (http://svn.techno-weenie.net/projects/mongrel/mongrel_pattern_recognition/). that's why I love mongrel :) -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From al-mongrelusers at none.at Mon Oct 23 05:07:47 2006 From: al-mongrelusers at none.at (Aleksandar Lazic) Date: Mon, 23 Oct 2006 11:07:47 +0200 Subject: [Mongrel] GzipFilter gemplugin now available In-Reply-To: <48fe25b0610230123l3243e37eu6f8cccb4872f4078@mail.gmail.com> References: <565dbdd40610221416q2da514ccrccf26125293564cb@mail.gmail.com> <453C60E5.4060504@supercool.nl> <48fe25b0610230025x43562168x840b42447c5e0ef2@mail.gmail.com> <20061023080758.GA13373@none.at> <48fe25b0610230123l3243e37eu6f8cccb4872f4078@mail.gmail.com> Message-ID: <20061023090747.GA19420@none.at> On Mon 23.10.2006 03:23, Rick Olson wrote: >Aleksandar Lazic wrote: [snipp] >> and of course nginx also ;-): >> >> http://wiki.codemongers.com/NginxHttpGzipModule >> >> Hth >> >> Aleks > >ah, well there you go. there are a few cases where you're not behind >one of those and you may need something like this. Hell, I hacked up a >quick regex/rewrite plugin for the same reason >(http://svn.techno-weenie.net/projects/mongrel/mongrel_pattern_recognition/). >that's why I love mongrel :) Yep sometimes one tool is enough ;-) Regards Aleks From wayneeseguin at gmail.com Mon Oct 23 09:37:00 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Mon, 23 Oct 2006 09:37:00 -0400 Subject: [Mongrel] Configuration Error? Message-ID: > Looks like you might have created a method named "send", but that's a Ruby reserved method. If you do this all sorts of bad things happen.. > > But, that's just from a quick glance. I wish this were the case because it would be an easy fix. When I run mongrel_rails on my local development machine it runs fine but on the production server I get that error message... This leads me to believe that it's a configuration error on my part on the server however I'm unsure as to where to look. Thanks! ~Wayne From eden.li at gmail.com Mon Oct 23 10:34:37 2006 From: eden.li at gmail.com (Eden Li) Date: Mon, 23 Oct 2006 22:34:37 +0800 Subject: [Mongrel] Configuration Error? In-Reply-To: References: Message-ID: <565dbdd40610230734v3c28a420h6a9e025f661d9a13@mail.gmail.com> Try running mongrel_rails start -e production on your development machine (make sure your config/database.yml is configured properly). To me, it looks like there's some caching problems somewhere in your app. On 10/23/06, Wayne E. Seguin wrote: > > > Looks like you might have created a method named "send", but > that's a Ruby reserved method. If you do this all sorts of bad > things happen.. > > > > But, that's just from a quick glance. > > > I wish this were the case because it would be an easy fix. > > When I run mongrel_rails on my local development machine it runs fine > but on the production server I get that error message... > This leads me to believe that it's a configuration error on my part > on the server however I'm unsure as to where to look. Thanks! > > ~Wayne > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From stonelists at gmail.com Mon Oct 23 12:37:56 2006 From: stonelists at gmail.com (Andrew Stone) Date: Mon, 23 Oct 2006 12:37:56 -0400 Subject: [Mongrel] Configuration Error? In-Reply-To: References: Message-ID: Out of curiosity, do you use migrations? Look at your migration class names and make sure it doesn't conflict with any "reserved" class names. I now prepend all my migration classes with Migration because this one bit me before. Not the exact error, but similar results. -- Andrew Stone -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061023/de582003/attachment.html From me at seebq.com Mon Oct 23 14:47:00 2006 From: me at seebq.com (Charles Brian Quinn) Date: Mon, 23 Oct 2006 14:47:00 -0400 Subject: [Mongrel] Updated Apache Best Practices Doc fixes Message-ID: <3a2de0cd0610231147q7c1d64b7u9fda2113ff1289a4@mail.gmail.com> 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. I also added some success stories from Martins, Phillip Hallstrom, and Jens Kraemer -- and the REMOTE_USER pass instructions from Jon Reads. Patch attached. Enjoy, and thanks everyone who contributed, please e-mail me if you're missing, or have contributions/success stories. cheers, -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com -------------- next part -------------- A non-text attachment was scrubbed... Name: updated_apache_page.diff Type: application/octet-stream Size: 7505 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061023/02d13dec/attachment.obj From wayneeseguin at gmail.com Mon Oct 23 21:29:33 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Mon, 23 Oct 2006 21:29:33 -0400 Subject: [Mongrel] Configuration Error? Message-ID: Andrew, Yes I do use migrations extensively and I do prepend all of the class names with Create, Add, Remove etc. Thank you VERY much for the heads up but this does not appear to be cause the error :( Thanks! Eden, This does indeed give a new error: ======================================================================== ================================== > mongrel_rails start -e production ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with production environment... /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/ active_support/dependencies.rb:123:in `const_missing': uninitialized constant Cacher (NameError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/ lib/active_support/dependencies.rb:131:in `const_missing' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/ lib/active_support/inflector.rb:161:in `constantize' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/ lib/active_support/core_ext/string/inflections.rb:59:in `constantize' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/ lib/active_record/observer.rb:24:in `observers=' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/ lib/active_record/observer.rb:22:in `each' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/ lib/active_record/observer.rb:22:in `observers=' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/ initializer.rb:280:in `send' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/ initializer.rb:280:in `initialize_framework_settings' ... 19 levels... from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/ mongrel/command.rb:211:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/ mongrel_rails:231 from /usr/local/bin/mongrel_rails:18:in `load' from /usr/local/bin/mongrel_rails:18 ======================================================================== ================================== So if it is a caching issue then did I configure something improperly somewhere? Any further insight is GREATLY appreciated. Thank you very much!!! ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061023/b878d022/attachment-0001.html From wayneeseguin at gmail.com Mon Oct 23 22:07:45 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Mon, 23 Oct 2006 22:07:45 -0400 Subject: [Mongrel] Configuration Error? Message-ID: The last email I sent wasn't entirely correct, the error is the same on my local when trying production environment: mongrel_rails start -e production ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with production environment... /Users/wayne/public_html/project/config/../vendor/rails/railties/lib/ initializer.rb:280:in `send': undefined method `cache_template_loading=' for ActionController::Base:Class (NoMethodError) from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:280:in `initialize_framework_settings' from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:279:in `each' from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:279:in `initialize_framework_settings' from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:276:in `each' from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:276:in `initialize_framework_settings' from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:93:in `process' from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:42:in `send' from /Users/wayne/public_html/project/config/../vendor/rails/ railties/lib/initializer.rb:42:in `run' ... 12 levels... from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/ mongrel/command.rb:211:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/ mongrel_rails:231 from /usr/local/bin/mongrel_rails:18:in `load' from /usr/local/bin/mongrel_rails:18 From wilsonb at gmail.com Mon Oct 23 22:14:52 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Mon, 23 Oct 2006 22:14:52 -0400 Subject: [Mongrel] Configuration Error? In-Reply-To: References: Message-ID: On 10/22/06, Wayne E. Seguin wrote: > ======================================================================== > ** Daemonized, any open files are closed. Look at /home/project/ > shared/log/mongrel.1080.pid and /home/project/shared/log/mongrel. > 1081.log for info. > ** Starting Mongrel listening at 127.0.0.1:1081 > ** Starting Rails with production environment... > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb: > 280:in `send': undefined method `cache_template_loading=' for > ActionController::Base:Class (NoMethodError) Check your production.rb and/or environment.rb Do you have a "config.observers =" line in there? From wayneeseguin at gmail.com Mon Oct 23 22:17:00 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Mon, 23 Oct 2006 22:17:00 -0400 Subject: [Mongrel] Configuration Error? Message-ID: <38D63C86-8CE1-4817-8A2F-C004C89F9202@gmail.com> Found it. It was a configuration issue. This line was in the projects environment file: production.rb file for some reason: config.action_controller.cache_template_loading = true Which I'm guessing is a planned rails 1.2 feature? I've removed ( commented ;) ) this for now from the code base. Thanks to all those who had suggestions! From wayneeseguin at gmail.com Mon Oct 23 22:33:10 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Mon, 23 Oct 2006 22:33:10 -0400 Subject: [Mongrel] Configuration Error? In-Reply-To: References: Message-ID: <4028A46A-099C-4865-8E93-11B5F3AD5DF4@gmail.com> Actually, yes I do. Why? Thanks Wilson!!! ~Wayne On Oct 23, 2006, at 22:14 , Wilson Bilkovich wrote: > On 10/22/06, Wayne E. Seguin wrote: >> ===================================================================== >> === >> ** Daemonized, any open files are closed. Look at /home/project/ >> shared/log/mongrel.1080.pid and /home/project/shared/log/mongrel. >> 1081.log for info. >> ** Starting Mongrel listening at 127.0.0.1:1081 >> ** Starting Rails with production environment... >> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb: >> 280:in `send': undefined method `cache_template_loading=' for >> ActionController::Base:Class (NoMethodError) > > Check your production.rb and/or environment.rb > Do you have a "config.observers =" line in there? > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From zedshaw at zedshaw.com Tue Oct 24 02:39:25 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 23 Oct 2006 23:39:25 -0700 Subject: [Mongrel] [WARN] Got 99% CPU? Message-ID: <20061023233925.64563a13.zedshaw@zedshaw.com> Hey folks, I ran into a few people at RubyConf who were having 99% CPU issues. Please contact me if you meet the following criteria: 1. You are running a production site. 2. You are experiencing 99% CPU errors. 3. This is frequent enough that you cannot manage it. Thank you. Please contact me off-list about it. -- 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 jamie at dangosaur.us Tue Oct 24 11:16:51 2006 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Tue, 24 Oct 2006 11:16:51 -0400 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <20061023233925.64563a13.zedshaw@zedshaw.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> Message-ID: <36AA8FC3-2569-4D4F-8D65-FD36FC45863D@dangosaur.us> I'm not having a CPU problem, but I was just installing and messing around with Mephisto 0.7.0 and noticed the ruby process was consuming around 150 megs after an hour or so. I shut it down and restarted and started clicking around the blog. The memory usage climbed steadily as I clicked. (This occurred in both production and dev modes.) I shut it down again and started WEBRick. Memory hit about 39 megs and just stayed there. Mac OS Tiger latest update Ruby 1.8.4 (MacPorts) Rails Edge Mephisto 0.7.0 Mongrel 0.3.13.4 Jamie On Oct 24, 2006, at 2:39 AM, Zed A. Shaw wrote: > Hey folks, > > I ran into a few people at RubyConf who were having 99% CPU > issues. Please contact me if you meet the following criteria: > > 1. You are running a production site. > 2. You are experiencing 99% CPU errors. > 3. This is frequent enough that you cannot manage it. > > Thank you. Please contact me off-list about it. > > -- > 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 technoweenie at gmail.com Tue Oct 24 11:56:34 2006 From: technoweenie at gmail.com (Rick Olson) Date: Tue, 24 Oct 2006 10:56:34 -0500 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <36AA8FC3-2569-4D4F-8D65-FD36FC45863D@dangosaur.us> References: <20061023233925.64563a13.zedshaw@zedshaw.com> <36AA8FC3-2569-4D4F-8D65-FD36FC45863D@dangosaur.us> Message-ID: <48fe25b0610240856q476465a4r77d076518891233@mail.gmail.com> On 10/24/06, Jamie Orchard-Hays wrote: > I'm not having a CPU problem, but I was just installing and messing > around with Mephisto 0.7.0 and noticed the ruby process was consuming > around 150 megs after an hour or so. I shut it down and restarted and > started clicking around the blog. The memory usage climbed steadily > as I clicked. (This occurred in both production and dev modes.) I > shut it down again and started WEBRick. Memory hit about 39 megs and > just stayed there. > > Mac OS Tiger latest update > Ruby 1.8.4 (MacPorts) > Rails Edge > Mephisto 0.7.0 > Mongrel 0.3.13.4 > Mephisto hovers at around 50-60MB depending on how big the site is. This is from my experience on mephistoblog.com and riding rails. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From jamie at dangosaur.us Tue Oct 24 12:16:44 2006 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Tue, 24 Oct 2006 12:16:44 -0400 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <48fe25b0610240856q476465a4r77d076518891233@mail.gmail.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> <36AA8FC3-2569-4D4F-8D65-FD36FC45863D@dangosaur.us> <48fe25b0610240856q476465a4r77d076518891233@mail.gmail.com> Message-ID: Mine just kept going up. It had been at 150 or 160 when I restarted. I saw it go past 60 both times I tried it out. I'll play with it again and see what happens (if it goes over 100). That seems huge, considering I've got a vanilla installation running. If you or Zed want me to try anything in particular, just let me know. Jamie On Oct 24, 2006, at 11:56 AM, Rick Olson wrote: > On 10/24/06, Jamie Orchard-Hays wrote: >> I'm not having a CPU problem, but I was just installing and messing >> around with Mephisto 0.7.0 and noticed the ruby process was consuming >> around 150 megs after an hour or so. I shut it down and restarted and >> started clicking around the blog. The memory usage climbed steadily >> as I clicked. (This occurred in both production and dev modes.) I >> shut it down again and started WEBRick. Memory hit about 39 megs and >> just stayed there. >> >> Mac OS Tiger latest update >> Ruby 1.8.4 (MacPorts) >> Rails Edge >> Mephisto 0.7.0 >> Mongrel 0.3.13.4 >> > > Mephisto hovers at around 50-60MB depending on how big the site is. > This is from my experience on mephistoblog.com and riding rails. > > -- > 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 From Marc.Love at herbank.com Tue Oct 24 12:59:05 2006 From: Marc.Love at herbank.com (Marc Love) Date: Tue, 24 Oct 2006 09:59:05 -0700 Subject: [Mongrel] Apache/Mongrel Question In-Reply-To: <3665a1a00610202234n628e0580w95eb394f7429a1a5@mail.gmail.com> References: <4538F753.2DB1.006D.0@herbank.com> <466af3440610201718r4c59c7d6g57b411b3dcbac84e@mail.gmail.com> <45390BEB.2DB1.006D.0@herbank.com> <3665a1a00610202234n628e0580w95eb394f7429a1a5@mail.gmail.com> Message-ID: <453DE3E8.2DB1.006D.0@herbank.com> Thanks Anatol, I'm implemented your suggested fix, but it doesn't appear to solve the problem. Is there something wrong with my apache configuration?: # vi /etc/apache2/httpd.conf.local # Fix for Apache bug 39499 SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 ServerName herb DocumentRoot /srv/www/apps/intranet/current/public Options FollowSymLinks AllowOverride None Order allow,deny Allow from all RewriteEngine On # If there is a maintenance.html file in the public # directory, all requests will get rerouted to this file. RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Rewrite index to check for static index.html RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached pages with .html extensions RewriteRule ^([^.]+)$ $1.html [QSA] # All dynamic requests get sent directly to the mongrel cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] # This is required to convince Rails (via mod_proxy_balancer) that # we're actually using HTTPS. # RequestHeader set X_FORWARDED_PROTO 'https' # Deflate when possible AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html ErrorLog /srv/logs/apache_errors.log # Configure mongrel_cluster BalancerMember http://127.0.0.1:8000 BalancerMember http://127.0.0.1:8001 BalancerMember http://127.0.0.1:8002 Listen 8080 # Map the subversion server DAV svn SVNPath /svn Order deny,allow Deny from all Allow from 127.0.0.1 Allow from [removed] Allow from [removed] SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 Allow from [removed] Allow from [removed] # Map the mod_proxy_balancer manager for http access SetHandler balancer-manager Order deny,allow Deny from all Allow from 127.0.0.1 Allow from [removed] Allow from [removed] >>> "Anatol Pomozov" 10/20/2006 10:34 PM >>> Hi Mark. See here http://blog.pomozov.info/posts/apache-mongrel-and-proxy-error.htmlI think this is your case. On 10/21/06, Marc Love wrote: > > I don't understand why Apache would find something when I'm accessing it > on the localhost but wouldn't find something when I'm accessing it from a > remote computer. > > I'm using mod_proxy_balancer, so Apache is passing off the requests to the > mongrel_cluster, right? Regardless of where the request is coming from. So > why would I get a Rails error message on the localhost, but an Apache error > on a remote host? > > >>> "Joey Geiger" 10/20/2006 5:18 PM >>> > You're getting this error because apache isn't finding anything on the > other end of the proxy. > > For example, if you're doing: > > ProxyPass / 127.0.0.1:3000/ > > 127.0.0.1:3000 isn't responding, so apache can't pass the request off. > > On 10/20/06, Marc Love wrote: > > I'm setting up a new server in anticipation of switching from > lighttpd+fcgi. My application isn't completely imported yet, so I don't > expect it to work. For instance right now when pulling up my app from > localhost I get my Ruby/Rails MySQL error message. But when I pull it up > from a remote computer I get a proxy error from Apache: > > > > ====================== > > Proxy Error > > > > The proxy server received an invalid response from an upstream server. > > The proxy server could not handle the request GET /. > > > > Reason: Error reading from remote server > > > > Additionally, a 502 Bad Gateway error was encountered while trying to > use an ErrorDocument to handle the request. > > ====================== > > > > Is there a reason why I get this instead of the Ruby/Rails error? > > > > -Marc > > > > > > > > ==================DISCLAIMER================================ > > This email may contain confidential and privileged material for the sole > use of the intended recipient. > > Any review or distribution by others is strictly prohibited. If you are > not the intended recipient, please contact the sender and delete all copies > of it from your system. > > The sender accepts no responsibility for viruses and it is your > responsibility to scan attachments (if any). > > No contracts may be concluded on behalf of the sender by means of email > communications unless expressly stated to the contrary. > > ==================DISCLAIMER================================ > > _______________________________________________ > > 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 > > > > ==================DISCLAIMER================================ > This email may contain confidential and privileged material for the sole > use of the intended recipient. > Any review or distribution by others is strictly prohibited. If you are > not the intended recipient, please contact the sender and delete all copies > of it from your system. > The sender accepts no responsibility for viruses and it is your > responsibility to scan attachments (if any). > No contracts may be concluded on behalf of the sender by means of email > communications unless expressly stated to the contrary. > ==================DISCLAIMER================================ > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- anatol (http://feeds.feedburner.com/apomozov-eng) ==================DISCLAIMER================================ This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies of it from your system. The sender accepts no responsibility for viruses and it is your responsibility to scan attachments (if any). No contracts may be concluded on behalf of the sender by means of email communications unless expressly stated to the contrary. ==================DISCLAIMER================================ From wilsonb at gmail.com Tue Oct 24 13:11:22 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Tue, 24 Oct 2006 13:11:22 -0400 Subject: [Mongrel] Configuration Error? In-Reply-To: <4028A46A-099C-4865-8E93-11B5F3AD5DF4@gmail.com> References: <4028A46A-099C-4865-8E93-11B5F3AD5DF4@gmail.com> Message-ID: On 10/23/06, Wayne E. Seguin wrote: > On Oct 23, 2006, at 22:14 , Wilson Bilkovich wrote: > > > On 10/22/06, Wayne E. Seguin wrote: > >> ===================================================================== > > Check your production.rb and/or environment.rb > > Do you have a "config.observers =" line in there? > > _______________________________________________ > > Actually, yes I do. > Why? > If you load observers during the 'config' process, and the code in those observers requires the full Rails environment to be loaded, the boot process will fail. This is easier to do than it sounds, because you are often observing ActiveRecord classes, and those will not have been loaded yet. Your second stack trace looked a lot like the one you get when encountering this problem. From mi-mongrel at moensolutions.com Tue Oct 24 14:05:49 2006 From: mi-mongrel at moensolutions.com (Michael Moen) Date: Tue, 24 Oct 2006 11:05:49 -0700 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <20061023233925.64563a13.zedshaw@zedshaw.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> Message-ID: <6D512575-24AF-4319-96C7-7A064A093EB9@moensolutions.com> Zed- We're seeing processes go off and become "dead", they continue to accept connections, but the don't do anything useful. We had manually applied your one-liner from r356 and the problem went down quite a bit. We are still seeing an occasional process drift off and now we are getting a trace in the log. I'm responding to this here as it is a production site and a fairly high volume one http://jibjab.com , but we are not seeing high CPU usage, in fact the dead processes aren't using any to speak of. Thanks in advance for you time and any tips on how we can track this down. Michael Trace follows: Thread # is too old, killing. Tue Oct 24 15:19:15 UTC 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' /usr/lib/ruby/1.8/sync.rb:183:in `sync_unlock' /usr/lib/ruby/1.8/sync.rb:231:in `synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb: 83:in `process'knownLocker: Thread(#) not locked.> /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in `process_client'r/lib/ruby/1.8/sync.rb:63:in `Fail' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in `process_client'r/lib/ruby/1.8/sync.rb:231:in `synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/ configurator.rb:267:in `run'lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/ lib/mongrel.rb:686:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/ configurator.rb:266:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb: 211:in `run'/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/ mongrel_rails:231 /usr/bin/mongrel_rails:18 On Oct 23, 2006, at 11:39 PM, Zed A. Shaw wrote: > Hey folks, > > I ran into a few people at RubyConf who were having 99% CPU > issues. Please contact me if you meet the following criteria: > > 1. You are running a production site. > 2. You are experiencing 99% CPU errors. > 3. This is frequent enough that you cannot manage it. > > Thank you. Please contact me off-list about it. > > -- > 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 zedshaw at zedshaw.com Tue Oct 24 18:10:10 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 24 Oct 2006 15:10:10 -0700 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <6D512575-24AF-4319-96C7-7A064A093EB9@moensolutions.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> <6D512575-24AF-4319-96C7-7A064A093EB9@moensolutions.com> Message-ID: <20061024151010.6a388905.zedshaw@zedshaw.com> On Tue, 24 Oct 2006 11:05:49 -0700 Michael Moen wrote: > Zed- We're seeing processes go off and become "dead", they continue > to accept connections, but the don't do anything useful. > > We had manually applied your one-liner from r356 and the problem went > down quite a bit. We are still seeing an occasional process drift off > and now we are getting a trace in the log. > Go grab the 0.3.13.5 pre-release and run it under USR1 debugging in production. It's got a tweak to the debugging output so that you can better understand what action is blocking the mongrel. Something like this: $ gem install mongrel --source=http://mongrel.rubyforge.org/releases $ $ killall -USR1 mongrel_rails Then, you're looking for lines in mongrel.log: Tue Oct 24 15:07:07 PDT 2006: 0 threads sync_waiting for /test, 1 still active in Mongrel. > I'm responding to this here as it is a production site and a fairly > high volume one http://jibjab.com , but we are not seeing high CPU > usage, in fact the dead processes aren't using any to speak of. Yep, this sounds like you have a particular Rails action that is blocking the process. What kinds of things is your Rails application doing? -- 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 mi-mongrel at moensolutions.com Tue Oct 24 16:27:01 2006 From: mi-mongrel at moensolutions.com (Michael Moen) Date: Tue, 24 Oct 2006 13:27:01 -0700 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <20061024151010.6a388905.zedshaw@zedshaw.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> <6D512575-24AF-4319-96C7-7A064A093EB9@moensolutions.com> <20061024151010.6a388905.zedshaw@zedshaw.com> Message-ID: <3B4A76C8-EEFB-477F-8054-E488AF3FDA2D@moensolutions.com> On Oct 24, 2006, at 3:10 PM, Zed A. Shaw wrote: > Go grab the 0.3.13.5 pre-release and run it under USR1 debugging in > production. It's got a tweak to the debugging output so that you > can better understand what action is blocking the mongrel. > Something like this: > > $ gem install mongrel --source=http://mongrel.rubyforge.org/releases > $ > $ killall -USR1 mongrel_rails > > Then, you're looking for lines in mongrel.log: > > Tue Oct 24 15:07:07 PDT 2006: 0 threads sync_waiting for /test, 1 > still active > in Mongrel. Here's a handful of the ones we logged yesterday, as you can see it wasn't in a happy state. I'll run off and grab the pre-release for one of the boxes and give it another spin. Mon Oct 23 21:35:33 UTC 2006: 331 threads sync_waiting for /, 337 still active in mongrel. Mon Oct 23 21:35:44 UTC 2006: 332 threads sync_waiting for /health/ db, 338 still active in mongrel. Mon Oct 23 21:36:05 UTC 2006: 334 threads sync_waiting for /, 340 still active in mongrel. Mon Oct 23 21:36:21 UTC 2006: 335 threads sync_waiting for /feeds/ player/22722/27312, 341 still active in mongrel. Mon Oct 23 21:36:34 UTC 2006: 337 threads sync_waiting for /usage/ 207205/2, 343 still active in mongrel. Mon Oct 23 21:36:52 UTC 2006: 339 threads sync_waiting for /, 345 still active in mongrel. Mon Oct 23 21:37:16 UTC 2006: 341 threads sync_waiting for /feeds/ gse_player/232062, 347 still active in mongrel. Mon Oct 23 21:37:31 UTC 2006: 343 threads sync_waiting for / great_sketch_experiment/register/, 349 still active in mongrel. > Yep, this sounds like you have a particular Rails action that is > blocking the process. What kinds of things is your Rails > application doing? I was trying to track something down in there yesterday based on the FAQ, but it looks like it's all over? Maybe I'm reading it wrong or maybe I need to have it enabled before it goes bad and see who's the first to complain?. As for what the site is doing, for the above actions, nothing special. The tricky bits are Ferret search over DRb, File uploads (which could be causing problems, it's not using m_u_p yet), now that a take some time to think about it (it's been hectic around here) I'm going to guess my next task is m_u_p. Thanks again- Michael From zedshaw at zedshaw.com Tue Oct 24 20:35:16 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 24 Oct 2006 17:35:16 -0700 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <3B4A76C8-EEFB-477F-8054-E488AF3FDA2D@moensolutions.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> <6D512575-24AF-4319-96C7-7A064A093EB9@moensolutions.com> <20061024151010.6a388905.zedshaw@zedshaw.com> <3B4A76C8-EEFB-477F-8054-E488AF3FDA2D@moensolutions.com> Message-ID: <20061024173516.bb4832ba.zedshaw@zedshaw.com> On Tue, 24 Oct 2006 13:27:01 -0700 Michael Moen wrote: > On Oct 24, 2006, at 3:10 PM, Zed A. Shaw wrote: > > Go grab the 0.3.13.5 pre-release and run it under USR1 debugging in > > production. It's got a tweak to the debugging output so that you > > can better understand what action is blocking the mongrel. > > Something like this: > > > > $ gem install mongrel --source=http://mongrel.rubyforge.org/releases > > $ > > $ killall -USR1 mongrel_rails > > > > Then, you're looking for lines in mongrel.log: > > > > Tue Oct 24 15:07:07 PDT 2006: 0 threads sync_waiting for /test, 1 > > still active > > in Mongrel. > > Here's a handful of the ones we logged yesterday, as you can see it > wasn't in a happy state. I'll run off and grab the pre-release for > one of the boxes and give it another spin. Is this with the 0.3.13.5 pre-release? It looks like you don't have the change that makes it clearer what is blocking (or that it's not really working well). -- 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 zedshaw at zedshaw.com Tue Oct 24 21:43:03 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 24 Oct 2006 18:43:03 -0700 Subject: [Mongrel] [ANN] Change In Versioning Policy Message-ID: <20061024184303.fa44b259.zedshaw@zedshaw.com> I'm going to make a change to how Mongrel is versioned to help out folks packaging it and tracking it as a pre-release. Previously I just did whatever was simplest, but now I'm going to do a slightly different approach. This is open for comment and suggestions. Here's the new rules: 1) There are only official and pre-releases. This doesn't change. 2) The version number is only 3 digits: X.Y.Z 3) The pre-releases will change the Z number for each release. 4) The official releases will change the Y number and reset the Z number to 0. This will break everyone's fantasy of having a 0.4 (it might be 0.948585 :-), but it'll make it easier to track in the future. Additionally, I'll start doing a svn tag for each pre-release and official release. Thanks a bunch. -- 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 Tue Oct 24 21:50:23 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 24 Oct 2006 18:50:23 -0700 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK Message-ID: <20061024185023.144dd621.zedshaw@zedshaw.com> Time for some all time pimpage folks. Me and Matt Pelletier wrote a small PDF book on Mongrel entitled: "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" since we really wanted you to know what it was about. It's published by Addison Wesley Professional, has just over 100 pages of goodness, and is available for $14.99 at: http://safari.oreilly.com/0321483502 The book covers all the major topics related to Mongrel, but does it in a quick fast way so you can get the idea, get a working setup going, and then do more research for advanced stuff. We also tried to make it funny as hell. I'm sure many people will love it, and a few will hate it for this reason. :-) A main thing this book covers is how to write your own Mongrel handlers, but it also goes over security, deployment, how Mongrel works, and many other topics. Let me know what you think of the book if you buy it. Thanks for your time! -- 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 mongrel at philip.pjkh.com Tue Oct 24 20:15:32 2006 From: mongrel at philip.pjkh.com (Philip Hallstrom) Date: Tue, 24 Oct 2006 19:15:32 -0500 (CDT) Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061024185023.144dd621.zedshaw@zedshaw.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> Message-ID: <20061024191416.W7554@bravo.pjkh.com> Zed - If I purchase the PDF version, are updates going to be available similar to the PP books? I admit I'm not familiar OReilly's setup so if it's blatantly obvious on their site just let me know. Thanks -philip On Tue, 24 Oct 2006, Zed A. Shaw wrote: > Time for some all time pimpage folks. > > Me and Matt Pelletier wrote a small PDF book on Mongrel entitled: "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" since we really wanted you to know what it was about. It's published by Addison Wesley Professional, has just over 100 pages of goodness, and is available for $14.99 at: > > http://safari.oreilly.com/0321483502 > > The book covers all the major topics related to Mongrel, but does it in a quick fast way so you can get the idea, get a working setup going, and then do more research for advanced stuff. > > We also tried to make it funny as hell. I'm sure many people will love it, and a few will hate it for this reason. :-) > > A main thing this book covers is how to write your own Mongrel handlers, but it also goes over security, deployment, how Mongrel works, and many other topics. > > Let me know what you think of the book if you buy it. > > Thanks for your time! > > -- > 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 matt at eastmedia.com Tue Oct 24 21:20:11 2006 From: matt at eastmedia.com (Matt Pelletier) Date: Tue, 24 Oct 2006 21:20:11 -0400 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061024191416.W7554@bravo.pjkh.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> <20061024191416.W7554@bravo.pjkh.com> Message-ID: On Oct 24, 2006, at 8:15 PM, Philip Hallstrom wrote: > Zed - > > If I purchase the PDF version, are updates going to be available > similar > to the PP books? I admit I'm not familiar OReilly's setup so if it's > blatantly obvious on their site just let me know. > Philip, Good question. We'll ask the publisher for the specifics and let you know. Thanks! Matt > Thanks -philip > > On Tue, 24 Oct 2006, Zed A. Shaw wrote: > >> Time for some all time pimpage folks. >> >> Me and Matt Pelletier wrote a small PDF book on Mongrel entitled: >> "Mongrel: Serving, Deploying, and Extending Your Ruby >> Applications" since we really wanted you to know what it was >> about. It's published by Addison Wesley Professional, has just >> over 100 pages of goodness, and is available for $14.99 at: >> >> http://safari.oreilly.com/0321483502 >> >> The book covers all the major topics related to Mongrel, but does >> it in a quick fast way so you can get the idea, get a working >> setup going, and then do more research for advanced stuff. >> >> We also tried to make it funny as hell. I'm sure many people will >> love it, and a few will hate it for this reason. :-) >> >> A main thing this book covers is how to write your own Mongrel >> handlers, but it also goes over security, deployment, how Mongrel >> works, and many other topics. >> >> Let me know what you think of the book if you buy it. >> >> Thanks for your time! >> >> -- >> 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 >> > _______________________________________________ > 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 -- Mongrel book with Zed Shaw http://identity.eastmedia.com -- OpenID, Identity 2.0 From jeroen at supercool.nl Wed Oct 25 02:27:34 2006 From: jeroen at supercool.nl (Jeroen Houben) Date: Wed, 25 Oct 2006 08:27:34 +0200 Subject: [Mongrel] rails app breaks after pg restart Message-ID: <453F03D6.2000008@supercool.nl> Hi, Disclaimer: I'm pretty sure this isn't a mongrel issue, as I'm pretty sure I had the same problem back in the lighty-fastcgi days.. After a postgres restart, my rails apps crash with this error: ActiveRecord::StatementInvalid (PGError: FATAL: terminating connection due to a dministrator command server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. : SELECT count(*) AS count_all FROM matches ): Strange thing is, after a do a page refresh everything works again. It's like the connections are re-established and all is well. But I have to do it for each application that is running, really annoying.. Does anybody know what is going on here? Jeroen From g.vishnu at gmail.com Wed Oct 25 09:35:28 2006 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Wed, 25 Oct 2006 19:05:28 +0530 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> <20061024191416.W7554@bravo.pjkh.com> Message-ID: Just finished reading it and have to say that it was entertaining(?) reading a 'guide' which frequently calls its reader a moron, an idiot, a dumbass and then finally tells him to get his panties out of a bunch. Zed is true to form as always. It has my must-read vote btw for anybody interested in deployment. Later, Vish On 10/25/06, Matt Pelletier wrote: > > > On Oct 24, 2006, at 8:15 PM, Philip Hallstrom wrote: > > > Zed - > > > > If I purchase the PDF version, are updates going to be available > > similar > > to the PP books? I admit I'm not familiar OReilly's setup so if it's > > blatantly obvious on their site just let me know. > > > > Philip, > > Good question. We'll ask the publisher for the specifics and let you > know. Thanks! > > Matt > > > Thanks -philip > > > > On Tue, 24 Oct 2006, Zed A. Shaw wrote: > > > >> Time for some all time pimpage folks. > >> > >> Me and Matt Pelletier wrote a small PDF book on Mongrel entitled: > >> "Mongrel: Serving, Deploying, and Extending Your Ruby > >> Applications" since we really wanted you to know what it was > >> about. It's published by Addison Wesley Professional, has just > >> over 100 pages of goodness, and is available for $14.99 at: > >> > >> http://safari.oreilly.com/0321483502 > >> > >> The book covers all the major topics related to Mongrel, but does > >> it in a quick fast way so you can get the idea, get a working > >> setup going, and then do more research for advanced stuff. > >> > >> We also tried to make it funny as hell. I'm sure many people will > >> love it, and a few will hate it for this reason. :-) > >> > >> A main thing this book covers is how to write your own Mongrel > >> handlers, but it also goes over security, deployment, how Mongrel > >> works, and many other topics. > >> > >> Let me know what you think of the book if you buy it. > >> > >> Thanks for your time! > >> > >> -- > >> 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 > >> > > _______________________________________________ > > 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 -- Mongrel book with Zed Shaw > 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/20061025/7ca91220/attachment.html From mi-mongrel at moensolutions.com Wed Oct 25 11:05:13 2006 From: mi-mongrel at moensolutions.com (Michael Moen) Date: Wed, 25 Oct 2006 08:05:13 -0700 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <20061024173516.bb4832ba.zedshaw@zedshaw.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> <6D512575-24AF-4319-96C7-7A064A093EB9@moensolutions.com> <20061024151010.6a388905.zedshaw@zedshaw.com> <3B4A76C8-EEFB-477F-8054-E488AF3FDA2D@moensolutions.com> <20061024173516.bb4832ba.zedshaw@zedshaw.com> Message-ID: <3070F24F-3010-4877-ACFA-9FBC858CBCF0@moensolutions.com> On Oct 24, 2006, at 5:35 PM, Zed A. Shaw wrote: > Is this with the 0.3.13.5 pre-release? It looks like you don't > have the change that makes it clearer what is blocking (or that > it's not really working well). Sorry- That was .13.4. I have 0.3.14 on one box currently, what's the stability like in the pre-release? Is it safe to run across the entire cluster? Problem is since we the r356 change it happens a lot less and only running it on a single box could take a long time to show its face. Thanks again- From jacob at jacobatzen.dk Wed Oct 25 11:38:15 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Wed, 25 Oct 2006 17:38:15 +0200 Subject: [Mongrel] [ANN] Change In Versioning Policy In-Reply-To: <20061024184303.fa44b259.zedshaw@zedshaw.com> References: <20061024184303.fa44b259.zedshaw@zedshaw.com> Message-ID: <20061025153815.GA48934@apoc.jacobatzen.dk> On Tue, Oct 24, 2006 at 06:43:03PM -0700, Zed A. Shaw wrote: > I'm going to make a change to how Mongrel is versioned to help out folks packaging it and tracking it as a pre-release. Previously I just did whatever was simplest, but now I'm going to do a slightly different approach. This is open for comment and suggestions. > > Here's the new rules: > > 1) There are only official and pre-releases. This doesn't change. > 2) The version number is only 3 digits: X.Y.Z > 3) The pre-releases will change the Z number for each release. > 4) The official releases will change the Y number and reset the Z number to 0. Maybe I don't understand what is meant by pre-release, but I have a few issues: - If a bugfix is needed for 0.4.0 what would it be called? 0.4.1 does not seem to be a possibility as it may already have been released as pre-release to 0.5. - Users might get confused about this scheme, as it contradicts the usual scheme were the Z value indicates a minor update, say 0.3.Z+1 is a minor update of 0.3.Z. With the proposed scheme I assume 0.3.1 could add features or break compability with 0.3.0. - I am not convinced that the various packaging systems out there will be really happy about this scheme, though this is just a feeling. That's just my 2 cents, hope you can use it. -- Cheers, - Jacob Atzen From wilsonb at gmail.com Wed Oct 25 11:51:38 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Wed, 25 Oct 2006 11:51:38 -0400 Subject: [Mongrel] rails app breaks after pg restart In-Reply-To: <453F03D6.2000008@supercool.nl> References: <453F03D6.2000008@supercool.nl> Message-ID: On 10/25/06, Jeroen Houben wrote: > Hi, > > Disclaimer: I'm pretty sure this isn't a mongrel issue, as I'm pretty > sure I had the same problem back in the lighty-fastcgi days.. > > After a postgres restart, my rails apps crash with this error: > > ActiveRecord::StatementInvalid (PGError: FATAL: terminating connection > due to a > dministrator command > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > : SELECT count(*) AS count_all FROM matches ): > > Strange thing is, after a do a page refresh everything works again. It's > like the connections are re-established and all is well. But I have to > do it for each application that is running, really annoying.. Does > anybody know what is going on here? > Yep. The Postgres connection adapter in Rails doesn't have the 'smart reconnect' code that was added to the Oracle adapter. The Oracle one contains a list of all the possible 'safe to reconnect' OCI error codes, and just goes ahead and does it if it encounters one of those. It would probably be fairly straightforward to add that feature to the postgres adapter. From luislavena at gmail.com Wed Oct 25 12:22:31 2006 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 25 Oct 2006 13:22:31 -0300 Subject: [Mongrel] [ANN] Change In Versioning Policy In-Reply-To: <20061025153815.GA48934@apoc.jacobatzen.dk> References: <20061024184303.fa44b259.zedshaw@zedshaw.com> <20061025153815.GA48934@apoc.jacobatzen.dk> Message-ID: <71166b3b0610250922m63f2ac60ocb8ce088334beb3@mail.gmail.com> On 10/25/06, Jacob Atzen wrote: > On Tue, Oct 24, 2006 at 06:43:03PM -0700, Zed A. Shaw wrote: > > I'm going to make a change to how Mongrel is versioned to help out folks packaging it and tracking it as a pre-release. Previously I just did whatever was simplest, but now I'm going to do a slightly different approach. This is open for comment and suggestions. > > > > Here's the new rules: > > > > 1) There are only official and pre-releases. This doesn't change. > > 2) The version number is only 3 digits: X.Y.Z > > 3) The pre-releases will change the Z number for each release. > > 4) The official releases will change the Y number and reset the Z number to 0. > > Maybe I don't understand what is meant by pre-release, but I have a few > issues: > > - If a bugfix is needed for 0.4.0 what would it be called? 0.4.1 does > not seem to be a possibility as it may already have been released as > pre-release to 0.5. > > - Users might get confused about this scheme, as it contradicts the > usual scheme were the Z value indicates a minor update, say 0.3.Z+1 is a > minor update of 0.3.Z. With the proposed scheme I assume 0.3.1 could > add features or break compability with 0.3.0. > > - I am not convinced that the various packaging systems out there will > be really happy about this scheme, though this is just a feeling. > > That's just my 2 cents, hope you can use it. > Jacob has a point here. The X.Y.Z scheme of versioning for most software is: Mayor, Minor, bugfix/build When you add features, but not a rewrite or complete redesign, you increment the minor version. As different example, GNOME mark all their unstable releases with odd numbers (2.17) and the stables with even (2.16) For any of the releases, stable or unstable (pre-releases) they do bugfixing (using the X.Y.Z scheme). In contrast, Subversion do bug fixing with the Z, and use the Minor to maintain backward compatibility between releases... A 1.3.x client could connect 1.3.x servers or 1.4.x, but will not take advantage of the new functionality. If versions range are 1.3-1.4 everything will be good, but no guarantees of support between 1.1.x server (or 1.2.x) with a 1.4.x client (or vice versa). I often name my releases: Stables: X.Y.Z where Z is the bugfix / release part in case when pack a LOT of fixes between our release milestone. Unstable: Here we plan enhancements in another branch outside trunk, and label the releases: X.Y-builddate So if last stable was 0.3.2 our pre-release/beta is 0.4-20061025. Anyway, we don't package prereleases every day, so is easy to determine which pre-release we are talking about. Also, in this case, as Zed did, will leave all the pre-releases outside rubyforge to reduce clutter during gems updates. > -- > Cheers, > - Jacob Atzen As Jacob said, this are also my 2 cents :-) 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 From brad at bradediger.com Wed Oct 25 12:47:48 2006 From: brad at bradediger.com (Brad Ediger) Date: Wed, 25 Oct 2006 11:47:48 -0500 Subject: [Mongrel] [ANN] Change In Versioning Policy In-Reply-To: <20061025153815.GA48934@apoc.jacobatzen.dk> References: <20061024184303.fa44b259.zedshaw@zedshaw.com> <20061025153815.GA48934@apoc.jacobatzen.dk> Message-ID: <3CCDCA54-F669-4EA5-BE9E-20C0CA0963B4@bradediger.com> On Oct 25, 2006, at 10:38 AM, Jacob Atzen wrote: > On Tue, Oct 24, 2006 at 06:43:03PM -0700, Zed A. Shaw wrote: >> I'm going to make a change to how Mongrel is versioned to help out >> folks packaging it and tracking it as a pre-release. Previously I >> just did whatever was simplest, but now I'm going to do a slightly >> different approach. This is open for comment and suggestions. >> >> Here's the new rules: >> >> 1) There are only official and pre-releases. This doesn't change. >> 2) The version number is only 3 digits: X.Y.Z >> 3) The pre-releases will change the Z number for each release. >> 4) The official releases will change the Y number and reset the Z >> number to 0. > > Maybe I don't understand what is meant by pre-release, but I have a > few > issues: > > - If a bugfix is needed for 0.4.0 what would it be called? 0.4.1 does > not seem to be a possibility as it may already have been released as > pre-release to 0.5. > > - Users might get confused about this scheme, as it contradicts the > usual scheme were the Z value indicates a minor update, say 0.3.Z > +1 is a > minor update of 0.3.Z. With the proposed scheme I assume 0.3.1 could > add features or break compability with 0.3.0. I kind of agree here. Why not just 0.3.4pre1, pre2, etc.? From jeroen at supercool.nl Wed Oct 25 13:25:11 2006 From: jeroen at supercool.nl (Jeroen Houben) Date: Wed, 25 Oct 2006 19:25:11 +0200 Subject: [Mongrel] rails app breaks after pg restart In-Reply-To: References: <453F03D6.2000008@supercool.nl> Message-ID: <453F9DF7.7090106@supercool.nl> Wilson Bilkovich wrote: > On 10/25/06, Jeroen Houben wrote: >> Hi, >> >> Disclaimer: I'm pretty sure this isn't a mongrel issue, as I'm pretty >> sure I had the same problem back in the lighty-fastcgi days.. >> >> After a postgres restart, my rails apps crash with this error: >> >> ActiveRecord::StatementInvalid (PGError: FATAL: terminating connection >> due to a >> dministrator command >> server closed the connection unexpectedly >> This probably means the server terminated abnormally >> before or while processing the request. >> : SELECT count(*) AS count_all FROM matches ): >> >> Strange thing is, after a do a page refresh everything works again. It's >> like the connections are re-established and all is well. But I have to >> do it for each application that is running, really annoying.. Does >> anybody know what is going on here? >> > > Yep. The Postgres connection adapter in Rails doesn't have the 'smart > reconnect' code that was added to the Oracle adapter. > The Oracle one contains a list of all the possible 'safe to reconnect' > OCI error codes, and just goes ahead and does it if it encounters one > of those. > > It would probably be fairly straightforward to add that feature to the > postgres adapter. Right. Thanks for the update. I'd have a go at adding it myself but I guess it's written in C, that rules me out :( Jeroen From zedshaw at zedshaw.com Wed Oct 25 16:25:43 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 25 Oct 2006 13:25:43 -0700 Subject: [Mongrel] [ANN] Change In Versioning Policy In-Reply-To: <20061025153815.GA48934@apoc.jacobatzen.dk> References: <20061024184303.fa44b259.zedshaw@zedshaw.com> <20061025153815.GA48934@apoc.jacobatzen.dk> Message-ID: <20061025132543.8c49d339.zedshaw@zedshaw.com> On Wed, 25 Oct 2006 17:38:15 +0200 Jacob Atzen wrote: > On Tue, Oct 24, 2006 at 06:43:03PM -0700, Zed A. Shaw wrote: > > Maybe I don't understand what is meant by pre-release, but I have a few > issues: > > - If a bugfix is needed for 0.4.0 what would it be called? 0.4.1 does > not seem to be a possibility as it may already have been released as > pre-release to 0.5. > The idea is that I want to get toward 1.0 for the final production stable release. Many people have said that it's mostly 1.0 quality for them and it'd be an easier sell if I just labeled it that. Rather than just pull a Subversion team manuever and call 0.3.3.245 the "1.0" version on a magic release, I'm going to shorten the version number. So, in short a bugfix will just be 0.5. That's it. When we hit 1.0 the scheme will change. > - Users might get confused about this scheme, as it contradicts the > usual scheme were the Z value indicates a minor update, say 0.3.Z+1 is a > minor update of 0.3.Z. With the proposed scheme I assume 0.3.1 could > add features or break compability with 0.3.0. > Yep, that's why I sent it out for comments. I think most folks just gem install, and they watch the list for my announcements, so the version number isn't as important to them as seeing it increase and knowing what one is being installed. Also, I *never* release something that breaks everything and just rely on a version number to warn people. If I did say a 0.6 that broke everyone's apps, it'd be announced for a long time before hand. > - I am not convinced that the various packaging systems out there will > be really happy about this scheme, though this is just a feeling. > > That's just my 2 cents, hope you can use it. Thanks. -- 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 wilsonb at gmail.com Wed Oct 25 14:08:26 2006 From: wilsonb at gmail.com (Wilson Bilkovich) Date: Wed, 25 Oct 2006 14:08:26 -0400 Subject: [Mongrel] rails app breaks after pg restart In-Reply-To: <453F9DF7.7090106@supercool.nl> References: <453F03D6.2000008@supercool.nl> <453F9DF7.7090106@supercool.nl> Message-ID: On 10/25/06, Jeroen Houben wrote: > Wilson Bilkovich wrote: > > On 10/25/06, Jeroen Houben wrote: > >> Hi, > >> > >> Disclaimer: I'm pretty sure this isn't a mongrel issue, as I'm pretty > >> sure I had the same problem back in the lighty-fastcgi days.. > >> > >> After a postgres restart, my rails apps crash with this error: > >> > >> ActiveRecord::StatementInvalid (PGError: FATAL: terminating connection > >> due to a > >> dministrator command > >> server closed the connection unexpectedly > >> This probably means the server terminated abnormally > >> before or while processing the request. > >> : SELECT count(*) AS count_all FROM matches ): > >> > >> Strange thing is, after a do a page refresh everything works again. It's > >> like the connections are re-established and all is well. But I have to > >> do it for each application that is running, really annoying.. Does > >> anybody know what is going on here? > >> > > > > Yep. The Postgres connection adapter in Rails doesn't have the 'smart > > reconnect' code that was added to the Oracle adapter. > > The Oracle one contains a list of all the possible 'safe to reconnect' > > OCI error codes, and just goes ahead and does it if it encounters one > > of those. > > > > It would probably be fairly straightforward to add that feature to the > > postgres adapter. > > Right. Thanks for the update. I'd have a go at adding it myself but I > guess it's written in C, that rules me out :( > Nope. It's all Ruby. Check out a copy of Rails, and look in: /activerecord/lib/active_record/connection_adapters/ To see how the Oracle adapter does it, open the oracle_adapter file, and look for LOST_CONNECTION_ERROR_CODES. From zedshaw at zedshaw.com Wed Oct 25 18:07:20 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 25 Oct 2006 15:07:20 -0700 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack Message-ID: <20061025150720.3b0eb770.zedshaw@zedshaw.com> This is important so please read this message very carefully. There is a DoS for Ruby's cgi.rb that is easily exploitable. The attack involves sending a malformed multipart MIME body in an HTTP request. The full explanation of the attack as well as how to fix it RIGHT NOW is given below. Most of the work was done by Jeremy Kemper and Jamis Buck. They did all the work of building the hot fix gem you'll install and getting the right people to finally agree to get this out. The original report is attached to this message so you can read it in full. I'm putting this fix into the Mongrel pre-release process to give Matz time to get an official release out. If he doesn't within the next few days then I'll turn this into an official Mongrel release. FULL DISCLOSURE There has been an exploitable bug in the Ruby CGI library named cgi.rb which allows: Anyone on the Internet to... Send a single HTTP request to... Any Ruby program (NOT just Mongrel) using... cgi.rb multipart parsing with... A malformed MIME body that... Causes the Ruby process to go into a 99% CPU infinite loop killing it. I broke this down so that it's as clear as possible, and so you don't miss that it's for ANY program using cgi.rb mime parsing. Not just Rails and Mongrel. What happens is that the final MIME boundary is sometimes given as: -ASDFADSFASFD-- Rather than: --ADFADSFADSF-- And this causes cgi.rb to go into an infinite loop waiting for more input that isn't coming. This is caused by any system that reads directly from an input stream that returns "" rather than EOF. The fix described below has a full exploit/tester script demonstrating the defect. It also doesn't matter if you have file uploads on your site or not. I can point this script at your site on any URI and cause a DoS on your site. WHO'S AFFECTED Currently, the following servers are affected: * Mongrel -- Reads from a socket so gets "" rather than EOF. * Litespeed -- Affected but has an internal timeout that nails the process. * CGI Standalone -- Impacted since reading from a normal input stream. * Any other custom server using the above similar operations. Looks like FastCGI's FCGIInputStream, WEBrick and mod_ruby are not vulnerable since they either read from a domain socket or don't use normal cgi.rb. THE FIX Everyone using Mongrel can get the fix immediately by installing the latest pre-release version 0.3.14: sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases Win32 people and anyone who can't upgrade that way can get the fix by doing this: 1) gem install cgi_multipart_eof_fix --source=http://mongrel.rubyforge.org/releases 2) Edit your environment.rb to have: require 'cgi_multipart_eof_fix' 3) Restart your services. People using other frameworks can get the fix by simply requiring rubygems and this fix in some start-up location for your framework. THE PATCH If you can't do the hot fix gem install, then there is also a patch for cgi.rb attached to this e-mail. You can apply the patch with the following process: 1) Find the original cgi.rb file in your install. Mine's in /usr/lib/ruby/1.8 2) cd /usr/lib/ruby/1.8 3) sudo patch < ~/cgi_multipart_eof_fix.patch You can look at the patch. It's literally changing one line, so you can edit by hand if you get really desperate. FUTURE DEFECTS Based on how the cgi.rb file is coded it's most likely that there will be more of these kinds of defects in the future. If you find a defect like this, then please don't flip out. Just report it to me or anyone else, and I'll cook up another one of these hot fix releases rather than wait for an official fix. I promise immediate turn-around from now on using a hot-fix gem if I can't get an official fix within a few days. Suggestions on how to do a more standardized hot-fix release process are much appreciated. Flame wars about screwing goats or the merits of full-disclosure are not appreciated. GETTING HELP I'll be in the Mongrel lingr room: http://www.lingr.com/room/3yXhqKbfPy8 And on irc.freenode.org in #rubyonrails, #rails-security, and #ruby-lang fielding questions and helping people. If I don't answer right away then wait a bit. I'll also answer help e-mails directly if you can't access any of the above. --- Zed A. Shaw -------------- next part -------------- A non-text attachment was scrubbed... Name: Jeremy_Kemper_DoS_report.txt Type: application/octet-stream Size: 904 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061025/09b5f29a/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: cgi_multipart_eof_fix.patch Type: application/octet-stream Size: 378 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061025/09b5f29a/attachment-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: ChangeLog Type: application/octet-stream Size: 3868 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061025/09b5f29a/attachment-0002.obj From zedshaw at zedshaw.com Wed Oct 25 18:55:07 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 25 Oct 2006 15:55:07 -0700 Subject: [Mongrel] [WARN] Got 99% CPU? In-Reply-To: <3070F24F-3010-4877-ACFA-9FBC858CBCF0@moensolutions.com> References: <20061023233925.64563a13.zedshaw@zedshaw.com> <6D512575-24AF-4319-96C7-7A064A093EB9@moensolutions.com> <20061024151010.6a388905.zedshaw@zedshaw.com> <3B4A76C8-EEFB-477F-8054-E488AF3FDA2D@moensolutions.com> <20061024173516.bb4832ba.zedshaw@zedshaw.com> <3070F24F-3010-4877-ACFA-9FBC858CBCF0@moensolutions.com> Message-ID: <20061025155507.ea8107b8.zedshaw@zedshaw.com> On Wed, 25 Oct 2006 08:05:13 -0700 Michael Moen wrote: > > On Oct 24, 2006, at 5:35 PM, Zed A. Shaw wrote: > > Is this with the 0.3.13.5 pre-release? It looks like you don't > > have the change that makes it clearer what is blocking (or that > > it's not really working well). > > Sorry- That was .13.4. I have 0.3.14 on one box currently, what's the > stability like in the pre-release? Is it safe to run across the > entire cluster? Problem is since we the r356 change it happens a lot > less and only running it on a single box could take a long time to > show its face. Should be good for you to run the latest pre-release I just, but definitely test it on a staging server first. Main thing that you'll want to check is that if you use mongrel_upload_progress then just quickly make sure it works, and look for any EOFError reports in mongrel.log. -- 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 Wed Oct 25 19:07:11 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 25 Oct 2006 16:07:11 -0700 Subject: [Mongrel] [ANN] Change In Versioning Policy In-Reply-To: <20061025132543.8c49d339.zedshaw@zedshaw.com> References: <20061024184303.fa44b259.zedshaw@zedshaw.com> <20061025153815.GA48934@apoc.jacobatzen.dk> <20061025132543.8c49d339.zedshaw@zedshaw.com> Message-ID: <20061025160711.3ce69d88.zedshaw@zedshaw.com> On Wed, 25 Oct 2006 13:25:43 -0700 "Zed A. Shaw" wrote: > On Wed, 25 Oct 2006 17:38:15 +0200 > Jacob Atzen wrote: > > The idea is that I want to get toward 1.0 for the final production stable release. Many people have said that it's mostly 1.0 quality for them and it'd be an easier sell if I just labeled it that. Rather than just pull a Subversion team manuever and call 0.3.3.245 the "1.0" version on a magic release, I'm going to shorten the version number. OOPS! Big correction on the above. It'd be "easier to sell" to their BOSS. I don't sell Mongrel. -- 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 jacob at jacobatzen.dk Wed Oct 25 16:19:46 2006 From: jacob at jacobatzen.dk (Jacob Atzen) Date: Wed, 25 Oct 2006 22:19:46 +0200 Subject: [Mongrel] [ANN] Change In Versioning Policy In-Reply-To: <20061025132543.8c49d339.zedshaw@zedshaw.com> References: <20061024184303.fa44b259.zedshaw@zedshaw.com> <20061025153815.GA48934@apoc.jacobatzen.dk> <20061025132543.8c49d339.zedshaw@zedshaw.com> Message-ID: <20061025201946.GA66744@apoc.jacobatzen.dk> On Wed, Oct 25, 2006 at 01:25:43PM -0700, Zed A. Shaw wrote: > On Wed, 25 Oct 2006 17:38:15 +0200 > Jacob Atzen wrote: > > > On Tue, Oct 24, 2006 at 06:43:03PM -0700, Zed A. Shaw wrote: > > > > Maybe I don't understand what is meant by pre-release, but I have a few > > issues: > > > > - If a bugfix is needed for 0.4.0 what would it be called? 0.4.1 does > > not seem to be a possibility as it may already have been released as > > pre-release to 0.5. > > > > The idea is that I want to get toward 1.0 for the final production > stable release. Many people have said that it's mostly 1.0 quality > for them and it'd be an easier sell if I just labeled it that. Rather > than just pull a Subversion team manuever and call 0.3.3.245 the "1.0" > version on a magic release, I'm going to shorten the version number. > > So, in short a bugfix will just be 0.5. That's it. When we hit 1.0 > the scheme will change. In that case my issues are without merit. Btw. I like the idea of numbering the pre-releases. It's been kinda messy to tell which pre-release one was using previously. -- Thanks, - Jacob Atzen From jeremy at bitsweat.net Wed Oct 25 16:29:33 2006 From: jeremy at bitsweat.net (Jeremy Kemper) Date: Wed, 25 Oct 2006 13:29:33 -0700 Subject: [Mongrel] [Rails] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <20061025150721.23db9eb2.zedshaw@zedshaw.com> References: <20061025150721.23db9eb2.zedshaw@zedshaw.com> Message-ID: <69a2885c0610251329rc19d096l161609feda7ed861@mail.gmail.com> On 10/25/06, Zed A. Shaw wrote: > > There is a DoS for Ruby's cgi.rb that is easily exploitable. The attack > involves sending a malformed multipart MIME body in an HTTP request. The > full explanation of the attack as well as how to fix it RIGHT NOW is given > below. > > I'm putting this fix into the Mongrel pre-release process to give Matz > time to get an official release out. If he doesn't within the next few days > then I'll turn this into an official Mongrel release. To underline and bold: you're unaffected if you're in production on FastCGI. The vulnerability has been reported to security at ruby-lang.org and the various OS distros. Matz fixed it in 1.8 CVS but hasn't backported, hence the full disclosure and hotfix now. Track it at http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5467(should be up shortly). jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061025/d8ddcfb1/attachment-0001.html From zedshaw at zedshaw.com Wed Oct 25 19:48:58 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 25 Oct 2006 16:48:58 -0700 Subject: [Mongrel] [ANN] Change In Versioning Policy In-Reply-To: <20061025201946.GA66744@apoc.jacobatzen.dk> References: <20061024184303.fa44b259.zedshaw@zedshaw.com> <20061025153815.GA48934@apoc.jacobatzen.dk> <20061025132543.8c49d339.zedshaw@zedshaw.com> <20061025201946.GA66744@apoc.jacobatzen.dk> Message-ID: <20061025164858.9d1efa4c.zedshaw@zedshaw.com> On Wed, 25 Oct 2006 22:19:46 +0200 Jacob Atzen wrote: > On Wed, Oct 25, 2006 at 01:25:43PM -0700, Zed A. Shaw wrote: > > On Wed, 25 Oct 2006 17:38:15 +0200 > > Jacob Atzen wrote: > Btw. I like the idea of numbering the pre-releases. It's been kinda > messy to tell which pre-release one was using previously. This pre-release has been tagged, but not sure if it's the Kosher way to do it for svn. I use svk so sometimes I'm shooting blind. It should be /tags/mongrel-0.3.14 Let me know if it's not good. -- 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 ian at blenke.com Wed Oct 25 19:51:58 2006 From: ian at blenke.com (Ian C. Blenke) Date: Wed, 25 Oct 2006 19:51:58 -0400 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <20061025150720.3b0eb770.zedshaw@zedshaw.com> References: <20061025150720.3b0eb770.zedshaw@zedshaw.com> Message-ID: <453FF89E.9030909@blenke.com> Zed A. Shaw wrote: >There is a DoS for Ruby's cgi.rb that is easily exploitable. The attack involves sending a malformed multipart MIME body in an HTTP request. The full explanation of the attack as well as how to fix it RIGHT NOW is given below. > > Another quick fix is to download the latest cgi.rb from the Ruby CVS repository and install that as your system cgi.rb: # wget -O cgi.rb 'http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/cgi.rb?rev=1.91;content-type=application%2Fx-ruby' # install -m 644 cgi.rb /usr/lib/ruby/1.8/cgi.rb You will still get spinners, however (though the malformed boundary spinners do seem to go away). Using 0.3.13.5 + the revision 356 patch (not really sure how necessary that was), along with replacing cgi.rb, has solved most of our mongrel woes. Also, if you're not using monit yet, seriously consider embracing it now. - Ian C. Blenke http://ian.blenke.com/ PS. In our testing, we did see WEBrick affected by this as well. It is not just Mongrel. FCGI appears to weather this particular problem just fine. From zedshaw at zedshaw.com Thu Oct 26 04:14:00 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 26 Oct 2006 01:14:00 -0700 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <453FF89E.9030909@blenke.com> References: <20061025150720.3b0eb770.zedshaw@zedshaw.com> <453FF89E.9030909@blenke.com> Message-ID: <20061026011400.b8712bc5.zedshaw@zedshaw.com> On Wed, 25 Oct 2006 19:51:58 -0400 "Ian C. Blenke" wrote: > Zed A. Shaw wrote: > > >There is a DoS for Ruby's cgi.rb that is easily exploitable. The attack involves sending a malformed multipart MIME body in an HTTP request. The full explanation of the attack as well as how to fix it RIGHT NOW is given below. > Using 0.3.13.5 + the revision 356 patch (not really sure how necessary > that was), along with replacing cgi.rb, has solved most of our mongrel woes. > If you ever get desperate for a previous pre-release of Mongrel, you can just go here: http://mongrel.rubyforge.org/releases/gems/ And find almost everything for all time. BTW, how was 0.3.14 pre-release for you? I've got reports it somehow breaks X-Sendfile support. -- 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 ian at blenke.com Thu Oct 26 10:11:36 2006 From: ian at blenke.com (Ian C. Blenke) Date: Thu, 26 Oct 2006 10:11:36 -0400 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <20061026011400.b8712bc5.zedshaw@zedshaw.com> References: <20061025150720.3b0eb770.zedshaw@zedshaw.com> <453FF89E.9030909@blenke.com> <20061026011400.b8712bc5.zedshaw@zedshaw.com> Message-ID: <4540C218.1050801@blenke.com> Zed A. Shaw wrote: >If you ever get desperate for a previous pre-release of Mongrel, you can just go here: > >http://mongrel.rubyforge.org/releases/gems/ > >And find almost everything for all time. > > Yes. I've done this on occasion, that is a _very_ useful resource. Thank you for leaving it up! >BTW, how was 0.3.14 pre-release for you? I've got reports it somehow breaks X-Sendfile support. > > We haven't experienced a problem with it yet. In lingr chat, Evan mentioned his problem was with apache2.2, camping, and 0.3.14. We're using debian ruby 1.8.4-1, apache 2.2.3, mod_proxy_balancer, no camping, and mongrel 0.3.13.5 (is this pre-0.3.14?) plus the patch for svn rev 356, and ruby cvs cgi.rb rev 1.19. I haven't seen any missing file errors in the apache logs since the upgrade from 0.3.13.3. - Ian C. Blenke http://ian.blenke.com/ From ian at blenke.com Thu Oct 26 10:23:50 2006 From: ian at blenke.com (Ian C. Blenke) Date: Thu, 26 Oct 2006 10:23:50 -0400 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <4540C218.1050801@blenke.com> References: <20061025150720.3b0eb770.zedshaw@zedshaw.com> <453FF89E.9030909@blenke.com> <20061026011400.b8712bc5.zedshaw@zedshaw.com> <4540C218.1050801@blenke.com> Message-ID: <4540C4F6.8080604@blenke.com> Ian C. Blenke wrote: > We're using debian ruby 1.8.4-1, apache 2.2.3, mod_proxy_balancer, no > camping, and mongrel 0.3.13.5 (is this pre-0.3.14?) plus the patch for > svn rev 356, and ruby cvs cgi.rb rev 1.19. I haven't seen any missing > file errors in the apache logs since the upgrade from 0.3.13.3. It just occurred to me, we're serving public/ files statically from apache2.2 without involving mongrel at all. In this case, anything in public/ would be sent directly without the need for mongrel to do an X-Sendfile direction to Apache. # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] If I comment out the RewriteCond, and shunt all requests to mongrel, I don't see any missing static content or errors in the logs, but then again I haven't done anything special to enable sendfile support (is there a gem I should install for mongrel to use to help test this?) It looks like Coda Hale has experienced this, and is suggesting that folks do _not_ use sendfile if you can have something else test for static content and send it instead: http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/ Unless this has changed recently... (as most things rails tend to do) - Ian C. Blenke http://ian.blenke.com From zedshaw at zedshaw.com Thu Oct 26 17:00:17 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 26 Oct 2006 14:00:17 -0700 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <4540C218.1050801@blenke.com> References: <20061025150720.3b0eb770.zedshaw@zedshaw.com> <453FF89E.9030909@blenke.com> <20061026011400.b8712bc5.zedshaw@zedshaw.com> <4540C218.1050801@blenke.com> Message-ID: <20061026140017.d8460a34.zedshaw@zedshaw.com> On Thu, 26 Oct 2006 10:11:36 -0400 "Ian C. Blenke" wrote: > Zed A. Shaw wrote: > > We're using debian ruby 1.8.4-1, apache 2.2.3, mod_proxy_balancer, no > camping, and mongrel 0.3.13.5 (is this pre-0.3.14?) plus the patch for > svn rev 356, and ruby cvs cgi.rb rev 1.19. I haven't seen any missing > file errors in the apache logs since the upgrade from 0.3.13.3. What's this "patch for svn rev 356" you speak of? Is it something I should include? -- 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 jamesludlow at gmail.com Thu Oct 26 14:11:18 2006 From: jamesludlow at gmail.com (JDL) Date: Thu, 26 Oct 2006 13:11:18 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: <20061024185023.144dd621.zedshaw@zedshaw.com> References: <20061024185023.144dd621.zedshaw@zedshaw.com> Message-ID: On 10/24/06, Zed A. Shaw wrote: > Time for some all time pimpage folks. > > Me and Matt Pelletier wrote a small PDF book on Mongrel entitled: "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" since we really wanted you to know what it was about. It's published by Addison Wesley Professional, has just over 100 pages of goodness, and is available for $14.99 at: > > http://safari.oreilly.com/0321483502 I just added this to my Safari bookshelf and look forward to reading it. It only took up a half slot too, so that's a bonus. -- James From todd.fisher at gmail.com Thu Oct 26 14:52:35 2006 From: todd.fisher at gmail.com (Todd Fisher) Date: Thu, 26 Oct 2006 14:52:35 -0400 Subject: [Mongrel] shutdown listener Message-ID: I start up an external process when I start my rails environment. I currently do this in config/environment.rb by forking a process and recording it's process id in log/foo.pid, I'd like to kill that process when I close mongrel. Is there an API in mongrel for responding to the shutdown event? Or do I need to listen for the term signal and do my clean up that way? Thanks, Todd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061026/da45937b/attachment.html From jgeiger at gmail.com Thu Oct 26 15:46:22 2006 From: jgeiger at gmail.com (Joey Geiger) Date: Thu, 26 Oct 2006 14:46:22 -0500 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> Message-ID: <466af3440610261246s4eab48bdj5ff6851ac83fb31e@mail.gmail.com> I bought it, printed out a few chapters to read over. I was a bit disappointed in the Performance chapter, since you mention what you "should" be doing, but there isn't an quick example. I think something like that might be helpful for someone who's never done it before. Otherwise the idea is easy to follow. On 10/26/06, JDL wrote: > On 10/24/06, Zed A. Shaw wrote: > > Time for some all time pimpage folks. > > > > Me and Matt Pelletier wrote a small PDF book on Mongrel entitled: "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" since we really wanted you to know what it was about. It's published by Addison Wesley Professional, has just over 100 pages of goodness, and is available for $14.99 at: > > > > http://safari.oreilly.com/0321483502 > > I just added this to my Safari bookshelf and look forward to reading > it. It only took up a half slot too, so that's a bonus. > > -- James > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From zedshaw at zedshaw.com Thu Oct 26 18:55:50 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 26 Oct 2006 15:55:50 -0700 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> Message-ID: <20061026155550.d356bc76.zedshaw@zedshaw.com> On Thu, 26 Oct 2006 13:11:18 -0500 JDL wrote: > On 10/24/06, Zed A. Shaw wrote: > > Time for some all time pimpage folks. > > > > Me and Matt Pelletier wrote a small PDF book on Mongrel entitled: "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" since we really wanted you to know what it was about. It's published by Addison Wesley Professional, has just over 100 pages of goodness, and is available for $14.99 at: > > > > http://safari.oreilly.com/0321483502 > > I just added this to my Safari bookshelf and look forward to reading > it. It only took up a half slot too, so that's a bonus. > Nice, thanks James. Be sure to tell me what you think. -- 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 Oct 26 18:57:11 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 26 Oct 2006 15:57:11 -0700 Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK In-Reply-To: References: <20061024185023.144dd621.zedshaw@zedshaw.com> <20061024191416.W7554@bravo.pjkh.com> Message-ID: <20061026155711.8f3d5931.zedshaw@zedshaw.com> On Wed, 25 Oct 2006 19:05:28 +0530 "Vishnu Gopal" wrote: > Just finished reading it and have to say that it was entertaining(?) reading > a 'guide' which frequently calls its reader a moron, an idiot, a dumbass > and then finally tells him to get his panties out of a bunch. > > Zed is true to form as always. > > It has my must-read vote btw for anybody interested in deployment. Well, I figured I couldn't let my regular readers down. :-) But, I hope there was incredibly useful content mixed in with the humor. Thanks for picking it up. -- 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 Oct 26 19:58:29 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 26 Oct 2006 16:58:29 -0700 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: <20061026165829.611f4c74.zedshaw@zedshaw.com> On Thu, 26 Oct 2006 14:46:22 -0500 "Joey Geiger" wrote: > I bought it, printed out a few chapters to read over. > > I was a bit disappointed in the Performance chapter, since you mention > what you "should" be doing, but there isn't an quick example. > > I think something like that might be helpful for someone who's never > done it before. > > Otherwise the idea is easy to follow. Ah, good point. Maybe I'll throw something like that on the Mongrel site and have an update to any errata referencing it. Several folks have asked for this in the past. -- 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 Oct 26 19:59:55 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 26 Oct 2006 16:59:55 -0700 Subject: [Mongrel] shutdown listener In-Reply-To: References: Message-ID: <20061026165955.06d36f60.zedshaw@zedshaw.com> On Thu, 26 Oct 2006 14:52:35 -0400 "Todd Fisher" wrote: > I start up an external process when I start my rails environment. I > currently do this in config/environment.rb by forking a process and > recording it's process id in log/foo.pid, I'd like to kill that process > when I close mongrel. Is there an API in mongrel for responding to the > shutdown event? Or do I need to listen for the term signal and do my clean > up that way? Easiest thing would be an at_exit handler. Maybe something like this in a mongrel.conf: at_exit { # kill the thing } Then run it with: mongrel_rails start -e production -S mongrel.conf -- 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 luislavena at gmail.com Thu Oct 26 17:13:01 2006 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 26 Oct 2006 18:13:01 -0300 Subject: [Mongrel] shutdown listener In-Reply-To: References: Message-ID: <71166b3b0610261413k57ba031dl183a3bc9d726dc48@mail.gmail.com> On 10/26/06, Todd Fisher wrote: > I start up an external process when I start my rails environment. I > currently do this in config/environment.rb by forking a process and > recording it's process id in log/foo.pid, I'd like to kill that process > when I close mongrel. Is there an API in mongrel for responding to the > shutdown event? Or do I need to listen for the term signal and do my clean > up that way? Todd, you *shouldn't* be doing that. Hook mongrel when stopping will require hack into mongrel_rails script, and that will brake things when going from 1 process to a cluster. My suggestion will be using something like BackgrounDrb [1] and control the start / stop actions from a init.d script maybe, but not from rails or mongrel (what if it crash?) Regards, > > Thanks, > Todd > > _______________________________________________ > 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 [1] http://backgroundrb.rubyforge.org/ From ian at blenke.com Thu Oct 26 17:31:46 2006 From: ian at blenke.com (Ian C. Blenke) Date: Thu, 26 Oct 2006 17:31:46 -0400 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <20061026140017.d8460a34.zedshaw@zedshaw.com> References: <20061025150720.3b0eb770.zedshaw@zedshaw.com> <453FF89E.9030909@blenke.com> <20061026011400.b8712bc5.zedshaw@zedshaw.com> <4540C218.1050801@blenke.com> <20061026140017.d8460a34.zedshaw@zedshaw.com> Message-ID: <45412942.3050205@blenke.com> Zed A. Shaw wrote: >What's this "patch for svn rev 356" you speak of? Is it something I should include? > > I stole it blindly from Michael Moen's mongrel-users list posts recently: http://rubyforge.org/pipermail/mongrel-users/2006-October/001928.html http://rubyforge.org/pipermail/mongrel-users/2006-October/001938.html I figured that a few lines couldn't hurt: mongrel$ svn diff -r 355:356 trunk/ Index: trunk/lib/mongrel.rb =================================================================== --- trunk/lib/mongrel.rb (revision 355) +++ trunk/lib/mongrel.rb (revision 356) @@ -219,7 +219,9 @@ read_body(remain, content_length, dispatcher) end - @body.rewind if body + raise HttpParserError.new("BAD CLIENT: Actual body length does not match Content-Length") if @body.pos != content_length + + @body.rewind if @body end @@ -687,7 +689,6 @@ reap_dead_workers("max processors") else thread = Thread.new(client) {|c| process_client(c) } - thread.abort_on_exception = true thread[:started_on] = Time.now @workers.add(thread) - Ian C. Blenke http://ian.blenke.com/ From joeat303 at yahoo.com Thu Oct 26 18:02:15 2006 From: joeat303 at yahoo.com (Joe Ruby) Date: Thu, 26 Oct 2006 15:02:15 -0700 (PDT) Subject: [Mongrel] [ADV] "Mongrel: Serving, Deploying, and Extending Your Ruby Applications" BOOK Message-ID: <20061026220215.59771.qmail@web38607.mail.mud.yahoo.com> Heh, sounds like stuff Anthony Bourdain writes! "what sets this one apart is Bourdain's signature wise-ass attitude that pervades nearly every recipe, explanatory note and chapter introduction. Profanity adds frequent color. If Aunt Doris would blanche at pearl onions being called "little fuckers," a cook who prefers boneless meat in Daube Proven al a "poor deluded bastard," or a person nervous about making these recipes a "dipshit," this book is not for her." http://search.barnesandnoble.com/booksearch/isbninquiry.asp?z=y&pwb=1&ean=9781582341804 Zed -- the Bourdain of Programming. :P Joe > Just finished reading it and have to say that it was entertaining(?) reading > a 'guide' which frequently calls its reader a moron, an idiot, a dumbass > and then finally tells him to get his panties out of a bunch. > > Zed is true to form as always. > > It has my must-read vote btw for anybody interested in deployment. > > Later, > Vish __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From zedshaw at zedshaw.com Thu Oct 26 22:46:21 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 26 Oct 2006 19:46:21 -0700 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: <45412942.3050205@blenke.com> References: <20061025150720.3b0eb770.zedshaw@zedshaw.com> <453FF89E.9030909@blenke.com> <20061026011400.b8712bc5.zedshaw@zedshaw.com> <4540C218.1050801@blenke.com> <20061026140017.d8460a34.zedshaw@zedshaw.com> <45412942.3050205@blenke.com> Message-ID: <20061026194621.b5e6090b.zedshaw@zedshaw.com> On Thu, 26 Oct 2006 17:31:46 -0400 "Ian C. Blenke" wrote: > Zed A. Shaw wrote: > > >What's this "patch for svn rev 356" you speak of? Is it something I should include? > > > > > > I stole it blindly from Michael Moen's mongrel-users list posts recently: > > http://rubyforge.org/pipermail/mongrel-users/2006-October/001928.html > http://rubyforge.org/pipermail/mongrel-users/2006-October/001938.html > Ah, so this is in the latest pre-release already then. Ok, great. I just have to find out why X-Sendfile is suddenly not working for Camping behind Apache (other situations?). -- 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 samuelgiffney at gmail.com Thu Oct 26 22:43:14 2006 From: samuelgiffney at gmail.com (Sam Giffney) Date: Fri, 27 Oct 2006 15:43:14 +1300 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack Message-ID: Just in case this trips anyone else up... I applied Ian's suggested patch # wget -O cgi.rb 'http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/cgi.rb?rev=1.91;content-type=application%2Fx-ruby' # install -m 644 cgi.rb /usr/lib/ruby/1.8/cgi.rb but this caused my app to throw an error - looks like something to do with the FileColumn plugin. undefined method `size' for # [RAILS_ROOT]/vendor/plugins/file_column-0.3.2/lib/file_column.rb:57:in `assign' Anyway I fixed this by running Ian's patch with http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/cgi.rb?rev=1.68.2.18;content-type=application%2Fx-ruby which is the current cgi.rb from the ruby1.8 branch rather than the Main branch. Thanks for the heads up Ian & Zed Sam From ian at blenke.com Fri Oct 27 10:39:20 2006 From: ian at blenke.com (Ian C. Blenke) Date: Fri, 27 Oct 2006 10:39:20 -0400 Subject: [Mongrel] [SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack In-Reply-To: References: Message-ID: <45421A18.5060101@blenke.com> Sam Giffney wrote: >Anyway I fixed this by running Ian's patch with > >http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/cgi.rb?rev=1.68.2.18;content-type=application%2Fx-ruby > >which is the current cgi.rb from the ruby1.8 branch rather than the Main branch. > > Yeah, I think Zed's gem fix is the best approach - it patches the missing end boundary spin problem without any other side effects: gem install cgi_multipart_eof_fix --source=http://mongrel.rubyforge.org/releases I've dropped the cgi.rb update directly from CVS and moved to this fix myself, which seems to work just fine. Kudos Zed. - Ian C. Blenke http://ian.blenke.com/ From wayneeseguin at gmail.com Sat Oct 28 21:23:08 2006 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Sat, 28 Oct 2006 21:23:08 -0400 Subject: [Mongrel] Question for Zed Message-ID: Zed, I purchased your book and was reading through it. On page 25 it states: "Mongrel will give precedence to the parameter values in the config file over those in the command line." I was wondering why this is not the other way around, preference given to the command line options. Thanks, ~Wayne From zedshaw at zedshaw.com Sun Oct 29 01:54:55 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sat, 28 Oct 2006 22:54:55 -0700 Subject: [Mongrel] Question for Zed In-Reply-To: References: Message-ID: <20061028225455.4ba5efa4.zedshaw@zedshaw.com> On Sat, 28 Oct 2006 21:23:08 -0400 "Wayne E. Seguin" wrote: > Zed, > > I purchased your book and was reading through it. On page 25 it states: > > "Mongrel will give precedence to the parameter values in the config > file over those in the command line." > > I was wondering why this is not the other way around, preference > given to the command line options. It's kind of a legacy thing about how the defaults were implemented. Short version of the story was it was too hard to merge defaults and figure out what people mean. I kept running into options that some folks felt should always be from the config file, others from the command line. To keep it simple I just say use either or but not both. And then wrote the -G option so generating the config files is super easy. That seems to be the best approach. -- 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 Oct 29 20:54:58 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 29 Oct 2006 17:54:58 -0800 Subject: [Mongrel] [RFC] Mongrel Books Page? Message-ID: <20061029175458.e72c9bde.zedshaw@zedshaw.com> There seems to be a bunch of books now that either mention Mongrel or focus on it or will focus on it. I've got my book, but the more books that people can easily get in as many languages as possible benefits Mongrel and everyone. Soooo, I'm gonna start a "Books" page that will list all the books that talk about Mongrel. Send me your book, a small abstract, and the link to where people can buy it. The link should *NOT* provide you with affiliate purchases since that violates the rubyforge.org TOS. This also applies to books in other languages, and books that are in close to publishing. -- 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 matt at eastmedia.com Mon Oct 30 07:13:12 2006 From: matt at eastmedia.com (Matt Pelletier) Date: Mon, 30 Oct 2006 07:13:12 -0500 Subject: [Mongrel] Question for Zed In-Reply-To: <20061028225455.4ba5efa4.zedshaw@zedshaw.com> References: <20061028225455.4ba5efa4.zedshaw@zedshaw.com> Message-ID: <8B70E772-7CEA-451A-84B1-3FFEE59D8009@eastmedia.com> On Oct 29, 2006, at 1:54 AM, Zed A. Shaw wrote: > On Sat, 28 Oct 2006 21:23:08 -0400 > "Wayne E. Seguin" wrote: > >> Zed, >> >> I purchased your book and was reading through it. On page 25 it >> states: >> >> "Mongrel will give precedence to the parameter values in the config >> file over those in the command line." >> >> I was wondering why this is not the other way around, preference >> given to the command line options. > > It's kind of a legacy thing about how the defaults were > implemented. Short version of the story was it was too hard to > merge defaults and figure out what people mean. I kept running > into options that some folks felt should always be from the config > file, others from the command line. > > To keep it simple I just say use either or but not both. And then > wrote the -G option so generating the config files is super easy. > That seems to be the best approach. Wayne, The way this works is that -G generates the Yaml to include tuples for each of the available options, including those not specified. When you run Mongrel with -C, the command line options hash, which is loaded first, is updated with config file's parameters hash, so even nil values overwrite the passed in ones (this is just normal hash merging behavior). This means if you want to manually edit the generated config file and remove some of the empty tuples, you could include command line parameters that wouldn't be overridden. WARNING: this is not a supported feature, just an incidental one. You can see how this works in the mongrel_rails script source. Matt > > -- > 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 > ------------------ Matt Pelletier http://www.eastmedia.com -- EastMedia http://safari.oreilly.com/0321483502 -- The Mongrel Book http://identity.eastmedia.com -- OpenID, Identity 2.0 From mongrelmail at gmail.com Mon Oct 30 10:02:29 2006 From: mongrelmail at gmail.com (Jared Brown) Date: Mon, 30 Oct 2006 10:02:29 -0500 Subject: [Mongrel] Application 500 Errors Message-ID: <5199ea460610300702x3b282c05q900ae88b8b10e7c9@mail.gmail.com> Configuration: (2) Dual Core Opterons 8GB RAM Apache used to balance 40 mongrel instances We receive Application 500 Errors. Nothing suspect appears in the log, so we are at a lost as to what to do next. Any advice would be welcome and/or an explanation of what types of things cause Application 500 Errors in mongrel. Thanks! - Jared Brown -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061030/db613f72/attachment.html From zedshaw at zedshaw.com Mon Oct 30 15:58:22 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 30 Oct 2006 12:58:22 -0800 Subject: [Mongrel] Application 500 Errors In-Reply-To: <5199ea460610300702x3b282c05q900ae88b8b10e7c9@mail.gmail.com> References: <5199ea460610300702x3b282c05q900ae88b8b10e7c9@mail.gmail.com> Message-ID: <20061030125822.5430ff67.zedshaw@zedshaw.com> On Mon, 30 Oct 2006 10:02:29 -0500 "Jared Brown" wrote: > Configuration: > > (2) Dual Core Opterons > 8GB RAM > Apache used to balance 40 mongrel instances > > We receive Application 500 Errors. Nothing suspect appears in the log, so we > are at a lost as to what to do next. > > Any advice would be welcome and/or an explanation of what types of things > cause Application 500 Errors in mongrel. Jared, you write software right? What would you do if someone came running into your office babbling about some kind of bug, but couldn't tell you important information you needed to know to fix the bug? As a programmer I expect other programmers to treat me as they want to be treated. If you ask a question on the list also report: the versions of your software, how you're using it, if you're doing anything odd, operating systems used, etc. C'mon, you know how to do this right. -- 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 mongrelmail at gmail.com Mon Oct 30 13:48:43 2006 From: mongrelmail at gmail.com (Jared Brown) Date: Mon, 30 Oct 2006 13:48:43 -0500 Subject: [Mongrel] Possible log rollover mutex problem Message-ID: <5199ea460610301048w16d61896oefdd7d9cab6a0b0d@mail.gmail.com> It appears that part of the problem could be that when logger rolls over the mongrel log file. There is a mutex synchronization issue where the various mongrel instances all try to write to the new log file and block each other. This keeps them in a continual Application 500 Error state. Has anyone run into this problem? With log rotation turned off the problem does not appear. - Jared Brown -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061030/7f2432c9/attachment.html From mongrelmail at gmail.com Mon Oct 30 15:46:14 2006 From: mongrelmail at gmail.com (Jared Brown) Date: Mon, 30 Oct 2006 15:46:14 -0500 Subject: [Mongrel] Application 500 Errors In-Reply-To: <20061030125822.5430ff67.zedshaw@zedshaw.com> References: <5199ea460610300702x3b282c05q900ae88b8b10e7c9@mail.gmail.com> <20061030125822.5430ff67.zedshaw@zedshaw.com> Message-ID: <5199ea460610301246v15c6026dr2c456480b073db35@mail.gmail.com> Sure Mongrel 0.3.13.4 Mongrel Cluster 0.2.0 Ruby 1.8.4 Rails 1.1.6 Apache 2.2.2 RHEL 4 The symptom is that we are getting frequent application 500 errors. Monitoring the mongrel cluster shows some of the servers in Err status at any given moment. We run 40 mongrel instances in the cluster and only a few of them are in Err status at a time. Does a mongrel instance in Err status return an application 500 error? I have not found documentation on the cluster monitor. The Apache config setup is standard, taken from Coda Hale's blog. The Ruby on Rails code is straight forward. Very few gems are used, the memory footprint is only 35MB for each mongrel instance. I have not been able to find any error messages in the production log. What types of things would be major no-no's? I don't use sessions. The web application mainly uses AJAX to coordinate messaging between a server and the client. I have not been able to put the servers into debug mode for the past couple of days since they are running in production at our colo, which is the only place we've seen these application errors occur. Restarting them causes chats to get dropped as well searches our users are performing. The linux kernel's TCP/IP settings have been tweaked to the following: net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_time = 1800 net.ipv4.tcp_window_scaling = 0 net.ipv4.tcp_dsack = 0 net.ipv4.tcp_sack = 0 net.ipv4.tcp_timestamps = 0 net.ipv4.icmp_echo_ignore_broadcasts = 0 net.ipv4.inet_peer_threshold = 16536 net.ipv4.ipfrag_high_thresh = 5000000 net.ipv4.ipfrag_low_thresh = 3000000 net.ipv4.conf.all.rp_filter = 0 net.ipv4.conf.lo.rp_filter = 0 net.ipv4.conf.eth0.rp_filter = 0 net.ipv4.conf.default.rp_filter = 0 net.core.netdev_max_backlog = 2500 net.core.optmem_max = 102400 net.core.rmem_default = 262141 net.core.rmem_max = 262141 net.core.wmem_default = 262141 net.core.wmem_max = 262141 net.ipv4.route.gc_interval = 5 net.ipv4.route.gc_elasticity = 3 net.ipv4.route.gc_min_interval = 1 net.ipv4.route.gc_timeout = 30 net.ipv4.route.max_size = 65536 net.ipv4.route.gc_thresh = 256 fs.file-max = 32768 net.ipv4.ip_local_port_range = 1024 65535 Although we were noticing the application 500 errors before these tweaks and removing these tweaks did not seem to make a difference. Switching servers seems to resolve the problem for a day or so. On 10/30/06, Zed A. Shaw wrote: > > On Mon, 30 Oct 2006 10:02:29 -0500 > "Jared Brown" wrote: > > > Configuration: > > > > (2) Dual Core Opterons > > 8GB RAM > > Apache used to balance 40 mongrel instances > > > > We receive Application 500 Errors. Nothing suspect appears in the log, > so we > > are at a lost as to what to do next. > > > > Any advice would be welcome and/or an explanation of what types of > things > > cause Application 500 Errors in mongrel. > > Jared, you write software right? What would you do if someone came > running into your office babbling about some kind of bug, but couldn't tell > you important information you needed to know to fix the bug? > > As a programmer I expect other programmers to treat me as they want to be > treated. If you ask a question on the list also report: the versions of > your software, how you're using it, if you're doing anything odd, operating > systems used, etc. > > C'mon, you know how to do this right. > > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061030/589cc689/attachment.html From zedshaw at zedshaw.com Mon Oct 30 21:16:13 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 30 Oct 2006 18:16:13 -0800 Subject: [Mongrel] Application 500 Errors In-Reply-To: <5199ea460610301246v15c6026dr2c456480b073db35@mail.gmail.com> References: <5199ea460610300702x3b282c05q900ae88b8b10e7c9@mail.gmail.com> <20061030125822.5430ff67.zedshaw@zedshaw.com> <5199ea460610301246v15c6026dr2c456480b073db35@mail.gmail.com> Message-ID: <20061030181613.07a7c528.zedshaw@zedshaw.com> On Mon, 30 Oct 2006 15:46:14 -0500 "Jared Brown" wrote: > Sure > > Mongrel 0.3.13.4 > Mongrel Cluster 0.2.0 > Ruby 1.8.4 > Rails 1.1.6 > Apache 2.2.2 > RHEL 4 > > The symptom is that we are getting frequent application 500 errors. > Monitoring the mongrel cluster shows some of the servers in Err status at > any given moment. We run 40 mongrel instances in the cluster and only a few > of them are in Err status at a time. Does a mongrel instance in Err status > return an application 500 error? I have not found documentation on the > cluster monitor. > Ok, this is much better. I'm short on time but I'll do a more complete answer later. First thing though, why so many Mongrels? Try scaling it back to just 1, then slowly test the speed and ramp up the numbers of Mongrels until you hit a point where no more mongrels will give you more speed. Next up, see if reduced mongrel numbers improves stability. I've seen it where lots of processes will cause problems with Apache declaring something dead but it not really being dead. And yes, when a mongrel goes bad it can return a 500, but apache is supposed to round robin to the next one in that case. 500 is usually only if all of them didn't answer. Talk to you soon, and thanks for the improved info. -- 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 Mon Oct 30 21:19:25 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 30 Oct 2006 18:19:25 -0800 Subject: [Mongrel] Possible log rollover mutex problem In-Reply-To: <5199ea460610301048w16d61896oefdd7d9cab6a0b0d@mail.gmail.com> References: <5199ea460610301048w16d61896oefdd7d9cab6a0b0d@mail.gmail.com> Message-ID: <20061030181925.58385147.zedshaw@zedshaw.com> On Mon, 30 Oct 2006 13:48:43 -0500 "Jared Brown" wrote: > It appears that part of the problem could be that when logger rolls over the > mongrel log file. There is a mutex synchronization issue where the various > mongrel instances all try to write to the new log file and block each other. > This keeps them in a continual Application 500 Error state. Has anyone run > into this problem? With log rotation turned off the problem does not appear. > Aha! I've suspected this for a long time, but I could never reproduce it. Research this a bit more for me and I'll tackle it in a few days. -- 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 chris.collins at fuse.net Mon Oct 30 17:53:48 2006 From: chris.collins at fuse.net (Chris Collins) Date: Mon, 30 Oct 2006 17:53:48 -0500 Subject: [Mongrel] Running mongrel globally Message-ID: <20061030175348.086506@YOUR-B5B06FA76B> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061030/7044a249/attachment.html From chris.collins at fuse.net Mon Oct 30 17:53:48 2006 From: chris.collins at fuse.net (Chris Collins) Date: Mon, 30 Oct 2006 17:53:48 -0500 Subject: [Mongrel] Running mongrel globally Message-ID: <20061030175348.086506@YOUR-B5B06FA76B> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061030/7044a249/attachment-0001.html From rsl at swimcommunity.org Tue Oct 31 08:55:13 2006 From: rsl at swimcommunity.org (Russell Norris) Date: Tue, 31 Oct 2006 08:55:13 -0500 Subject: [Mongrel] Moving page_cache_directory Message-ID: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> Howdy. I'm working on a RoR CMS and need cached pages to all be in public/cache rather than public [in order to set svn:ignore on all the files properly]. I can get page_cache_directory set correctly and the pages are cached in the right place but Mongrel isn't serving them because it's only looking for them in public. During development I know I can set -r public/cache but doing that means that the images and stylesheets don't get picked up. I'm sure there's a way to tell Mongrel to look in both places or at least to serve assets from public and cached pages from public/cache. Isn't there? Thanks in advance. RSL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061031/e4c56b38/attachment.html From ian at blenke.com Tue Oct 31 10:20:28 2006 From: ian at blenke.com (Ian C. Blenke) Date: Tue, 31 Oct 2006 10:20:28 -0500 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> Message-ID: <454769BC.30606@blenke.com> Russell Norris wrote: > Howdy. I'm working on a RoR CMS and need cached pages to all be in > public/cache rather than public [in order to set svn:ignore on all the > files properly]. I can get page_cache_directory set correctly and the > pages are cached in the right place but Mongrel isn't serving them > because it's only looking for them in public. During development I > know I can set -r public/cache but doing that means that the images > and stylesheets don't get picked up. I'm sure there's a way to tell > Mongrel to look in both places or at least to serve assets from public > and cached pages from public/cache. Isn't there? You can always do this with apache. # Redirect any requests for cached content that exist to the cached url. RewriteCond %{DOCUMENT_ROOT}/cache/%{REQUEST_FILENAME} -f RewriteRule ^/(.*)$ /cache/$1 [PT] # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/cache/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] Or something like that (NOTE: I haven't tested the above, but it "feels" right). - Ian C. Blenke http://ian.blenke.com/ From technoweenie at gmail.com Tue Oct 31 10:24:23 2006 From: technoweenie at gmail.com (Rick Olson) Date: Tue, 31 Oct 2006 09:24:23 -0600 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> Message-ID: <48fe25b0610310724m407d4372o24719a5d3ea543d9@mail.gmail.com> On 10/31/06, Russell Norris wrote: > Howdy. I'm working on a RoR CMS and need cached pages to all be in > public/cache rather than public [in order to set svn:ignore on all the files > properly]. I can get page_cache_directory set correctly and the pages are > cached in the right place but Mongrel isn't serving them because it's only > looking for them in public. During development I know I can set -r > public/cache but doing that means that the images and stylesheets don't get > picked up. I'm sure there's a way to tell Mongrel to look in both places or > at least to serve assets from public and cached pages from public/cache. > Isn't there? > > Thanks in advance. > > RSL I would think that you could just set up a custom DirHandler, but the RailsHandler is taking up the root uri. I'm not sure this would work, but use a config script like this: uri "/", Mongrel::DirHandler.new("path/to/public/cache", listing_allowed=true, index_html="index.html"), :in_front => true (the 2nd and 3rd params of DirHandler.new are optional). I'm not sure if the DirHandler will return 404's or just pass on to the next handler in line, which would be the Rails Handler. If this doesn't work, you'll have to hack the RailsHandler probably. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From jan.svitok at gmail.com Tue Oct 31 10:44:29 2006 From: jan.svitok at gmail.com (Jan Svitok) Date: Tue, 31 Oct 2006 16:44:29 +0100 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> Message-ID: <8d9b3d920610310744n33bbdf6ci14200201b0666050@mail.gmail.com> On 10/31/06, Russell Norris wrote: > Howdy. I'm working on a RoR CMS and need cached pages to all be in > public/cache rather than public [in order to set svn:ignore on all the files > properly]. I can get page_cache_directory set correctly and the pages are > cached in the right place but Mongrel isn't serving them because it's only > looking for them in public. During development I know I can set -r > public/cache but doing that means that the images and stylesheets don't get > picked up. I'm sure there's a way to tell Mongrel to look in both places or > at least to serve assets from public and cached pages from public/cache. > Isn't there? > > Thanks in advance. I'm not sure if any of these will work, they're just hints: 1. try prepend DirHandler mounted to public/cache :in_front of rails handler using -S switch uri "/", :handler => Mongrel::DirHandler.new("/public/cache", false) This will unfortunately not look for PATH_INFO + '.html' files. 2. try patching RailsHandler to look also in cache. For that a proxy handler would be useful - one that will hold more DirHandlers and will delegate to whichever wants to serve the particular file. In this case RailsHandler will take care of +.html files. You'd need to implement new, can_serve? and process which seems pretty easy. From zedshaw at zedshaw.com Tue Oct 31 11:26:21 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 31 Oct 2006 08:26:21 -0800 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> Message-ID: <20061031082621.ed5f55ba.zedshaw@zedshaw.com> On Tue, 31 Oct 2006 08:55:13 -0500 "Russell Norris" wrote: > Howdy. I'm working on a RoR CMS and need cached pages to all be in > public/cache rather than public [in order to set svn:ignore on all the files > properly]. I can get page_cache_directory set correctly and the pages are > cached in the right place but Mongrel isn't serving them because it's only > looking for them in public. During development I know I can set -r > public/cache but doing that means that the images and stylesheets don't get > picked up. I'm sure there's a way to tell Mongrel to look in both places or > at least to serve assets from public and cached pages from public/cache. > Isn't there? > I believe there was a patch for this and that I applied it to the current pre-release. I'm super busy today, but I'll be spending some time later in the afternoon on Mongrel. I'll sit down and figure out how to dynamically determine this from the Rails configuration if I haven't done that already. -- 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 mongrelmail at gmail.com Tue Oct 31 11:29:22 2006 From: mongrelmail at gmail.com (Jared Brown) Date: Tue, 31 Oct 2006 11:29:22 -0500 Subject: [Mongrel] Possible log rollover mutex problem In-Reply-To: <20061030181925.58385147.zedshaw@zedshaw.com> References: <5199ea460610301048w16d61896oefdd7d9cab6a0b0d@mail.gmail.com> <20061030181925.58385147.zedshaw@zedshaw.com> Message-ID: <5199ea460610310829t499a543chac5462f8a0adbde9@mail.gmail.com> In environments.rb I created a new Logger() and set the rollover to "daily". All of the mongrels tried to roll the file over at the same time and continually blocked. Accesses to the site only resulted in application 500 errors. Deleting the logs fixed it. Touching the log file to an old date reproduces it. On 10/30/06, Zed A. Shaw wrote: > > On Mon, 30 Oct 2006 13:48:43 -0500 > "Jared Brown" wrote: > > > It appears that part of the problem could be that when logger rolls over > the > > mongrel log file. There is a mutex synchronization issue where the > various > > mongrel instances all try to write to the new log file and block each > other. > > This keeps them in a continual Application 500 Error state. Has anyone > run > > into this problem? With log rotation turned off the problem does not > appear. > > > > Aha! I've suspected this for a long time, but I could never reproduce > it. Research this a bit more for me and I'll tackle it in a few days. > > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061031/183b1b41/attachment.html From rsl at swimcommunity.org Tue Oct 31 11:32:44 2006 From: rsl at swimcommunity.org (Russell Norris) Date: Tue, 31 Oct 2006 11:32:44 -0500 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <8d9b3d920610310744n33bbdf6ci14200201b0666050@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <8d9b3d920610310744n33bbdf6ci14200201b0666050@mail.gmail.com> Message-ID: <1d2f8d6f0610310832t49a9b5cclf0e818375a2d5880@mail.gmail.com> I was thinking that DirHandler or RailsHandler would be the answer but I can't seem to figure out what to do with them. The RDoc is, um... Let's say "terse". And there's nothing [that I saw] on the main site. Any chance you've seen a good breakdown/tutorial/whatever somewhere online? RSL On 10/31/06, Jan Svitok wrote: > > On 10/31/06, Russell Norris wrote: > > Howdy. I'm working on a RoR CMS and need cached pages to all be in > > public/cache rather than public [in order to set svn:ignore on all the > files > > properly]. I can get page_cache_directory set correctly and the pages > are > > cached in the right place but Mongrel isn't serving them because it's > only > > looking for them in public. During development I know I can set -r > > public/cache but doing that means that the images and stylesheets don't > get > > picked up. I'm sure there's a way to tell Mongrel to look in both places > or > > at least to serve assets from public and cached pages from public/cache. > > Isn't there? > > > > Thanks in advance. > > I'm not sure if any of these will work, they're just hints: > > 1. try prepend DirHandler mounted to public/cache :in_front of rails > handler using -S switch > uri "/", :handler => Mongrel::DirHandler.new("/public/cache", > false) > This will unfortunately not look for PATH_INFO + '.html' files. > > 2. try patching RailsHandler to look also in cache. For that a proxy > handler > would be useful - one that will hold more DirHandlers and will > delegate to whichever > wants to serve the particular file. In this case RailsHandler will > take care of +.html files. > You'd need to implement new, can_serve? and process which seems pretty > easy. > _______________________________________________ > 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/20061031/8325bac9/attachment-0001.html From rsl at swimcommunity.org Tue Oct 31 11:38:55 2006 From: rsl at swimcommunity.org (Russell Norris) Date: Tue, 31 Oct 2006 11:38:55 -0500 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <20061031082621.ed5f55ba.zedshaw@zedshaw.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <20061031082621.ed5f55ba.zedshaw@zedshaw.com> Message-ID: <1d2f8d6f0610310838v30df364bw9c7d1fb40f2db3c3@mail.gmail.com> I feel bad now. I didn't mean to add more to your plate, Zed. RSL On 10/31/06, Zed A. Shaw wrote: > > On Tue, 31 Oct 2006 08:55:13 -0500 > "Russell Norris" wrote: > > > Howdy. I'm working on a RoR CMS and need cached pages to all be in > > public/cache rather than public [in order to set svn:ignore on all the > files > > properly]. I can get page_cache_directory set correctly and the pages > are > > cached in the right place but Mongrel isn't serving them because it's > only > > looking for them in public. During development I know I can set -r > > public/cache but doing that means that the images and stylesheets don't > get > > picked up. I'm sure there's a way to tell Mongrel to look in both places > or > > at least to serve assets from public and cached pages from public/cache. > > Isn't there? > > > > I believe there was a patch for this and that I applied it to the current > pre-release. I'm super busy today, but I'll be spending some time later in > the afternoon on Mongrel. > > I'll sit down and figure out how to dynamically determine this from the > Rails configuration if I haven't done that already. > > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061031/810d2271/attachment.html From rmdf at stimble.net Tue Oct 31 12:48:27 2006 From: rmdf at stimble.net (Michael Fairchild) Date: Tue, 31 Oct 2006 09:48:27 -0800 Subject: [Mongrel] works with webrick,lighty, not mongrel Message-ID: <2ef9bb620610310948t1b67f166y2a5e94dc62dac03b@mail.gmail.com> 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. I am hoping to both get this working, and understand why such an error would occur. Does anyone have any suggestions? Thanks a lot, Michael Fairchild -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061031/5ff8c737/attachment.html From rsl at swimcommunity.org Tue Oct 31 14:27:26 2006 From: rsl at swimcommunity.org (Russell Norris) Date: Tue, 31 Oct 2006 14:27:26 -0500 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <48fe25b0610310724m407d4372o24719a5d3ea543d9@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <48fe25b0610310724m407d4372o24719a5d3ea543d9@mail.gmail.com> Message-ID: <1d2f8d6f0610311127y637e0d76o21e3fde4bf7e14a5@mail.gmail.com> Rick, that did the trick. Thank you so much! RSL On 10/31/06, Rick Olson wrote: > > On 10/31/06, Russell Norris wrote: > > Howdy. I'm working on a RoR CMS and need cached pages to all be in > > public/cache rather than public [in order to set svn:ignore on all the > files > > properly]. I can get page_cache_directory set correctly and the pages > are > > cached in the right place but Mongrel isn't serving them because it's > only > > looking for them in public. During development I know I can set -r > > public/cache but doing that means that the images and stylesheets don't > get > > picked up. I'm sure there's a way to tell Mongrel to look in both places > or > > at least to serve assets from public and cached pages from public/cache. > > Isn't there? > > > > Thanks in advance. > > > > RSL > > I would think that you could just set up a custom DirHandler, but the > RailsHandler is taking up the root uri. I'm not sure this would work, > but use a config script like this: > > uri "/", Mongrel::DirHandler.new("path/to/public/cache", > listing_allowed=true, index_html="index.html"), :in_front => true > > (the 2nd and 3rd params of DirHandler.new are optional). > > I'm not sure if the DirHandler will return 404's or just pass on to > the next handler in line, which would be the Rails Handler. If this > doesn't work, you'll have to hack the RailsHandler probably. > > -- > 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/20061031/d1bd2a36/attachment.html From eimorton at gmail.com Tue Oct 31 14:37:42 2006 From: eimorton at gmail.com (Erik Morton) Date: Tue, 31 Oct 2006 14:37:42 -0500 Subject: [Mongrel] works with webrick,lighty, not mongrel In-Reply-To: <2ef9bb620610310948t1b67f166y2a5e94dc62dac03b@mail.gmail.com> References: <2ef9bb620610310948t1b67f166y2a5e94dc62dac03b@mail.gmail.com> Message-ID: In your application do you have a class called Sync with a method called send_qbxml? Mongrel uses Sync from the Ruby Std Lib. It looks to me that you have a name collision here. Erik On Oct 31, 2006, at 12:48 PM, 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. > > I am hoping to both get this working, and understand why such an > error would occur. Does anyone have any suggestions? > > Thanks a lot, > > Michael Fairchild > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From rsl at swimcommunity.org Tue Oct 31 14:44:09 2006 From: rsl at swimcommunity.org (Russell Norris) Date: Tue, 31 Oct 2006 14:44:09 -0500 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610311127y637e0d76o21e3fde4bf7e14a5@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <48fe25b0610310724m407d4372o24719a5d3ea543d9@mail.gmail.com> <1d2f8d6f0610311127y637e0d76o21e3fde4bf7e14a5@mail.gmail.com> Message-ID: <1d2f8d6f0610311144u4a50864fjcb7aec9be43b18fe@mail.gmail.com> I spoke too soon. Things are still caching in the wrong place. :/ I think I've looked at these directories so long they've stopped making sense even to me. Anyhow, I'm looking at the RailsHandler now. RSL On 10/31/06, Russell Norris wrote: > > Rick, that did the trick. Thank you so much! > > RSL > > On 10/31/06, Rick Olson wrote: > > > > On 10/31/06, Russell Norris wrote: > > > Howdy. I'm working on a RoR CMS and need cached pages to all be in > > > public/cache rather than public [in order to set svn:ignore on all the > > files > > > properly]. I can get page_cache_directory set correctly and the pages > > are > > > cached in the right place but Mongrel isn't serving them because it's > > only > > > looking for them in public. During development I know I can set -r > > > public/cache but doing that means that the images and stylesheets > > don't get > > > picked up. I'm sure there's a way to tell Mongrel to look in both > > places or > > > at least to serve assets from public and cached pages from > > public/cache. > > > Isn't there? > > > > > > Thanks in advance. > > > > > > RSL > > > > I would think that you could just set up a custom DirHandler, but the > > RailsHandler is taking up the root uri. I'm not sure this would work, > > but use a config script like this: > > > > uri "/", Mongrel:: DirHandler.new("path/to/public/cache", > > listing_allowed=true, index_html="index.html"), :in_front => true > > > > (the 2nd and 3rd params of DirHandler.new are optional). > > > > I'm not sure if the DirHandler will return 404's or just pass on to > > the next handler in line, which would be the Rails Handler. If this > > doesn't work, you'll have to hack the RailsHandler probably. > > > > -- > > 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/20061031/ff5ee22e/attachment.html From robert at kitchendemocracy.org Tue Oct 31 14:48:02 2006 From: robert at kitchendemocracy.org (Robert Vogel) Date: Tue, 31 Oct 2006 12:48:02 -0700 Subject: [Mongrel] Problems with mongrel dying Message-ID: <20061031124801.c41e0b8117d7637a8f09ddbc78878a27.0d8284bfd1.wbe@email.secureserver.net> 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: * Each time I can restart the process via cap -a restart_app. * Before the restart, there is nothing unusual in production.log or mongrel.log. * During the restart, about 100 repetitions of an error message are generated in mongrel.log (see below). * I followed the suggestions on mongrel.rubyforge.org/faq: lsof -i -P | grep CLOSE_WAIT 99% CPU Memory Leak None of those show any problems. Before the restart, top shows the largest memory processes are: top - 07:17:05 up 31 days, 20:38, 0 users, load average: 0.00, 0.00, 0.00 Tasks: 46 total, 2 running, 44 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0% us, 0.0% sy, 0.0% ni, 100.0% id, 0.0% wa, 0.0% hi, 0.0% si Mem: 262316k total, 239700k used, 22616k free, 3412k buffers Swap: 0k total, 0k used, 0k free, 88320k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 18001 root 16 0 45712 39m 2584 S 0.0 15.6 0:20.79 mongrel_rails 18004 root 16 0 43624 38m 2524 S 0.0 15.0 0:25.93 mongrel_rails 2632 mysql 16 0 109m 27m 3100 S 0.0 10.8 5:37.37 mysqld After the restart, memory usage rapidly approaches above values while the application runs normally. * Yesterday I updated production.rb with this entry: ActiveRecord::Base.verification_timeout = 14400 and this did not fix the problem. Note I am using 0.3.13.5 because I had problems with 0.3.13.4 not restarting when my railsmachine system reboots. However, I would gladly switch back to 0.3.13.4 if it solved this problem. Useage is very low - only about 50-200 requests / hour. One more factoid - may be irrelevant, but it appears that shortly before each of the four crashes, one or two pdf files were downloaded from my public directory - which I believe apache does bypassing mongrel. Suggestions? Thanks Robert Vogel Error messages in mongrel.log generated during restart: Tue Oct 31 07:26:30 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' /usr/lib/ruby/1.8/sync.rb:183:in `sync_unlock' /usr/lib/ruby/1.8/sync.rb:231:in `synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/rails.rb:81:in `process' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel.rb:583:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel.rb:582:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel.rb:689:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel.rb:689:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel.rb:676:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:271:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:270:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:124:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/command.rb:211:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:234 /usr/bin/mongrel_rails:18 Tue Oct 31 07:26:30 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' /usr/lib/ruby/1.8/sync.rb:183:in `sync_unlock' etc. The tail of mongrel.log after the restart is: /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:234 /usr/bin/mongrel_rails:18 /var/www/apps/kd/current/config/../vendor/rails/activerecord/lib/active_record/transactions.rb:84:in `transaction': Transaction aborted (ActiveRecord::Transactions::TransactionError) from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:293:in `join' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/configurator.rb:293:in `join' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:133:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/lib/mongrel/command.rb:211:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.5/bin/mongrel_rails:234 from /usr/bin/mongrel_rails:18 deadlock 0xb71a8518: sleep:- - /usr/lib/ruby/1.8/thread.rb:100 deadlock 0xb7e3c748: sleep:- (main) - /usr/lib/ruby/1.8/thread.rb:100 ** TERM signal received. ** Daemonized, any open files are closed. Look at log/mongrel.8000.pid and log/mongrel.log for info. ** Starting Mongrel listening at 127.0.0.1:8000 ** Starting Rails with production environment... ** Daemonized, any open files are closed. Look at log/mongrel.8001.pid and log/mongrel.log for info. ** Starting Mongrel listening at 127.0.0.1:8001 ** 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:8000 ** Writing PID file to log/mongrel.8000.pid ** 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:8001 ** Writing PID file to log/mongrel.8001.pid From mi-mongrel at moensolutions.com Tue Oct 31 14:50:23 2006 From: mi-mongrel at moensolutions.com (Michael Moen) Date: Tue, 31 Oct 2006 11:50:23 -0800 Subject: [Mongrel] works with webrick,lighty, not mongrel In-Reply-To: <2ef9bb620610310948t1b67f166y2a5e94dc62dac03b@mail.gmail.com> References: <2ef9bb620610310948t1b67f166y2a5e94dc62dac03b@mail.gmail.com> Message-ID: <66D04F01-3786-4A0E-BDA2-C9E727521707@moensolutions.com> On Oct 31, 2006, at 9:48 AM, Michael Fairchild wrote: > Hello, > 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. Zed is using the Sync class from the Standard Library and you are using a class also named Sync. Those wont play well together. Your best bet would be to rename your class to something that doesn't exist in the Ruby libraries and watch out for that in the future. Michael- From technoweenie at gmail.com Tue Oct 31 14:51:07 2006 From: technoweenie at gmail.com (Rick Olson) Date: Tue, 31 Oct 2006 13:51:07 -0600 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610311127y637e0d76o21e3fde4bf7e14a5@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <48fe25b0610310724m407d4372o24719a5d3ea543d9@mail.gmail.com> <1d2f8d6f0610311127y637e0d76o21e3fde4bf7e14a5@mail.gmail.com> Message-ID: <48fe25b0610311151p6fa4439v98b25445ccae4466@mail.gmail.com> On 10/31/06, Russell Norris wrote: > Rick, that did the trick. Thank you so much! > > RSL Which? The config script? That's cool... I'd suggest implementing this in various web servers too. Apache/nginx/lighty handle this stuff much better and can leave mongrel for doing rails stuff. Still, it's good to have a fallback like this. That's why I love mongrel :) -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From rsl at swimcommunity.org Tue Oct 31 15:30:53 2006 From: rsl at swimcommunity.org (Russell Norris) Date: Tue, 31 Oct 2006 15:30:53 -0500 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <48fe25b0610311151p6fa4439v98b25445ccae4466@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <48fe25b0610310724m407d4372o24719a5d3ea543d9@mail.gmail.com> <1d2f8d6f0610311127y637e0d76o21e3fde4bf7e14a5@mail.gmail.com> <48fe25b0610311151p6fa4439v98b25445ccae4466@mail.gmail.com> Message-ID: <1d2f8d6f0610311230q31d6841at74ddbc91ca9cff50@mail.gmail.com> Unfortunately, it wasn't the config but hacking the RailsHandler that ended up working. I hard-coded my copy but I can imagine how easily you could generate a path_info/page_cached from the value in ActionController:: Base.page_cache_directory. I'm sure that's what Zed and co. probably have in the new version. Anyhow, I wanted to thank all for you kittens for helping. Thanks. RSL On 10/31/06, Rick Olson wrote: > > On 10/31/06, Russell Norris wrote: > > Rick, that did the trick. Thank you so much! > > > > RSL > > Which? The config script? That's cool... > > I'd suggest implementing this in various web servers too. > Apache/nginx/lighty handle this stuff much better and can leave > mongrel for doing rails stuff. Still, it's good to have a fallback > like this. That's why I love mongrel :) > > > -- > 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/20061031/ab220cf3/attachment.html From technoweenie at gmail.com Tue Oct 31 15:32:12 2006 From: technoweenie at gmail.com (Rick Olson) Date: Tue, 31 Oct 2006 14:32:12 -0600 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610310832t49a9b5cclf0e818375a2d5880@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <8d9b3d920610310744n33bbdf6ci14200201b0666050@mail.gmail.com> <1d2f8d6f0610310832t49a9b5cclf0e818375a2d5880@mail.gmail.com> Message-ID: <48fe25b0610311232n7d4cecaco56d696918495cd67@mail.gmail.com> On 10/31/06, Russell Norris wrote: > I was thinking that DirHandler or RailsHandler would be the answer but I > can't seem to figure out what to do with them. The RDoc is, um... Let's say > "terse". And there's nothing [that I saw] on the main site. Any chance > you've seen a good breakdown/tutorial/whatever somewhere online? The mongrel source is very clean and easy to follow. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From technoweenie at gmail.com Tue Oct 31 16:08:55 2006 From: technoweenie at gmail.com (Rick Olson) Date: Tue, 31 Oct 2006 15:08:55 -0600 Subject: [Mongrel] Moving page_cache_directory In-Reply-To: <1d2f8d6f0610310838v30df364bw9c7d1fb40f2db3c3@mail.gmail.com> References: <1d2f8d6f0610310555x51dcfea3w3994b38ff0fd33ce@mail.gmail.com> <20061031082621.ed5f55ba.zedshaw@zedshaw.com> <1d2f8d6f0610310838v30df364bw9c7d1fb40f2db3c3@mail.gmail.com> Message-ID: <48fe25b0610311308t1ff32640te6a284e8468b46c0@mail.gmail.com> On 10/31/06, Russell Norris wrote: > I feel bad now. I didn't mean to add more to your plate, Zed. > > RSL I think this is definitely mongrel plugin territory. Not too many apps do this kind of thing. Mephisto does, but I rely on the web server to rewrite properly. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com From snacktime at gmail.com Tue Oct 31 16:41:26 2006 From: snacktime at gmail.com (snacktime) Date: Tue, 31 Oct 2006 13:41:26 -0800 Subject: [Mongrel] mongrel parser for server response Message-ID: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> I'm taking a stab at creating a parser to parse the server response using the mongrel parser as a base. Never having used a parser like Ragel before in my life, I'd like some input on the following for parsing an http server response. This is part of my modified version of http11_parser.rl. In particular what would be better than using 'any' to match the status text? http_number = (digit+ "." digit+) ; HTTP_Version = ("HTTP/" http_number) >mark %http_version ; Http_status_code = (digit){3} >mark %http_status_code ; Http_status_text = any* >mark %http_status_text ; Request_Line = (HTTP_Version " " Http_status_code " " Http_status_text CRLF) ; field_name = (token -- ":")+ >start_field %write_field; field_value = any* >start_value %write_value; message_header = field_name ":" " "* field_value :> CRLF; Request = Request_Line (message_header)* ( CRLF @done); Chris From zedshaw at zedshaw.com Tue Oct 31 17:36:12 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 31 Oct 2006 14:36:12 -0800 Subject: [Mongrel] Problems with mongrel dying In-Reply-To: <20061031124801.c41e0b8117d7637a8f09ddbc78878a27.0d8284bfd1.wbe@email.secureserver.net> References: <20061031124801.c41e0b8117d7637a8f09ddbc78878a27.0d8284bfd1.wbe@email.secureserver.net> Message-ID: <20061031143612.e86891c5.zedshaw@zedshaw.com> 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. From snacktime at gmail.com Tue Oct 31 18:41:50 2006 From: snacktime at gmail.com (snacktime) Date: Tue, 31 Oct 2006 15:41:50 -0800 Subject: [Mongrel] mongrel parser for server response In-Reply-To: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> References: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> Message-ID: <1f060c4c0610311541m1fabc77crcaa6a1b5ce8d5027@mail.gmail.com> Ok I have a working parser for server responses based on the mongrel parser. But I'm trying to decide the best way to structure it so it will co-exist nicely with the mongrel parser when used in the same application. The main thing I'm trying to decide is what to do with all the variables that the mongrel parser puts into globals, but that the server response parser also needs. I know what would work for me, but maybe someone else might want to use this code also when I'm done so I'd like some feedback on it. My first reaction is to just not define any globals in the server parser and access everything from HttpParams. Thoughts? Also, the grammer I posted had a problem, but I figured it out and it appears to be working fine. Chris From zedshaw at zedshaw.com Tue Oct 31 20:49:55 2006 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 31 Oct 2006 17:49:55 -0800 Subject: [Mongrel] mongrel parser for server response In-Reply-To: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> References: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> Message-ID: <20061031174955.148986fa.zedshaw@zedshaw.com> On Tue, 31 Oct 2006 13:41:26 -0800 snacktime wrote: > I'm taking a stab at creating a parser to parse the server response > using the mongrel parser as a base. Never having used a parser like > Ragel before in my life, I'd like some input on the following for > parsing an http server response. This is part of my modified version > of http11_parser.rl. In particular what would be better than using > 'any' to match the status text? > Already did that. It's in RFuzz: http://rfuzz.rubyforge.org/ Including chunked encoding. -- 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 snacktime at gmail.com Tue Oct 31 23:51:29 2006 From: snacktime at gmail.com (snacktime) Date: Tue, 31 Oct 2006 20:51:29 -0800 Subject: [Mongrel] mongrel parser for server response In-Reply-To: <20061031174955.148986fa.zedshaw@zedshaw.com> References: <1f060c4c0610311341l200d4ar28849696916c88ca@mail.gmail.com> <20061031174955.148986fa.zedshaw@zedshaw.com> Message-ID: <1f060c4c0610312051y89ec617p46b848cabbf3e59b@mail.gmail.com> On 10/31/06, Zed A. Shaw wrote: > On Tue, 31 Oct 2006 13:41:26 -0800 > snacktime wrote: > > > I'm taking a stab at creating a parser to parse the server response > > using the mongrel parser as a base. Never having used a parser like > > Ragel before in my life, I'd like some input on the following for > > parsing an http server response. This is part of my modified version > > of http11_parser.rl. In particular what would be better than using > > 'any' to match the status text? > > > > Already did that. It's in RFuzz: > > http://rfuzz.rubyforge.org/ > > Including chunked encoding. Ah very cool, saves me some work, although I was having fun learning to use Ragel.