Bradley Taylor
2007-Feb-24 03:23 UTC
[Mongrel] [ANN] Mongrel Cluster 1.0.1.1 Prerelease: Healing power of the pack!
Hello all... I know its been a while since the last one, but a new prerelease is available with a gratuitous increase in version numbers! gem install mongrel_cluster --source http://mongrel.rubyforge.org/releases/ This one has some new features in it that need to be tested on all unix platforms. Please run --clean and cluster::status on every *nix you can find. I run linux so the rest are up to you. Thanks to the following for patches, bug reports, and suggestions: Corey Donahue, Matt Trott, Donnie Jones, Matte Edens, Joey Geiger, Nathan Vack, and others. New Features: * The cluster::start, stop and restart commands now support --clean. On start, any orphaned pid_files will be removed and any missing members will be started. Running members will be ignored. On stop, orphaned members (with missing pids) will be killed. On restart, --clean will be passed to stop and start. Feel the healing power of the pack! * cluster::status - Reports the status of the cluster members with respect to pid_file and the existence of the process. Returns 0 if ok, 2 if not. * --only PORT - run a command only a specific port. * Capistrano - added variables for the mongrel_rails path, pid_file, log_file, clean, and a task for status. * The init.d script (resources/mongrel_cluster) will now create /var/run/mongrel_cluster and chown to a defined user on start (see file). To fully use this feature, update your cluster yml files to store the pidfile in /var/run/mongrel_cluster. This will support cleaning up orphaned pidfiles at boot time. For example: pid_file: /var/run/mongrel_cluster/foo.pid Changes/Fixes: * Each mongrel_rails process now has its own log file. * Improved parsing of log_file and pid_file filenames to support "." in the names. * start/stop messages for each port * Fixed a parameter bug with mongrel_cluster_ctl calling mongrel_rails. * Default pid_file is now "tmp/pids/mongrel.pid" to match Rails rake tasks. NOTE: I recommend using /var/run/mongrel_cluster so pids are properly cleaned up after a crash. How does it work? ## check status of your cluster [me at fluxura ~]$ mongrel_rails cluster::status -C /etc/mongrel_cluster/fluxura.conf found pid_file: /var/run/mongrel_cluster/fluxura.8000.pid mongrel_rails (port: 8000, pid:27286) is running... found pid_file: /var/run/mongrel_cluster/fluxura.8001.pid mongrel_rails (port: 8001, pid:27289) is running... ## simulate process death [me at fluxura ~]$ kill -9 27289 ## uh-oh [me at fluxura ~]$ mongrel_rails cluster::status -C /etc/mongrel_cluster/fluxura.conf found pid_file: /var/run/mongrel_cluster/fluxura.8000.pid mongrel_rails (port: 8000, pid:27286) is running... found pid_file: /var/run/mongrel_cluster/fluxura.8001.pid !! mongrel_rails (port: 8001) is not running... ## start --clean ignores the good process, removes orphaned pid_file, ## and starts new process. healing pack power! [me at fluxura ~]$ mongrel_rails cluster::start --clean -C /etc/mongrel_cluster/fluxura.conf already started port 8000 missing process: removing /var/run/mongrel_cluster/fluxura.8001.pid starting port 8001 Give it a go and let me know... Regards, Bradley Taylor http://railsmachine.com
Hi guys, I''ve hooked mongrel_upload_progress into our application, and it''s working now, but I noticed what might be a small bug. The size of the file as reported by Mongrel is slightly bigger than the actual file size (both on the source computer + when it''s stored on the server). This difference varies slightly each time, but seems to be in the neighborhood of 420 - 486 extra bytes. My guess is that when Mongrel calculates the file size to give to upload progress, it doesn''t strip out the HTTP header. Here''s the code snippet for the upload progress gem where the issue seems to be. The content length is returning the wrong number. class Upload < GemPlugin::Plugin "/handlers" include Mongrel::HttpHandlerPlugin ... def request_begins(params) upload_notify(:add, params, params [Mongrel::Const::CONTENT_LENGTH].to_i) end I use this file size to ensure the upload completed successfully, but I have a workaround. I''m doing Flash based upload, and I can get the file size from Flash and send it to the server before the upload starts. But the all-server-side approach seems cleaner and more portable. Small bug aside... this is a really cool gem ... it''s letting me upload a file from one client and show the progress of the upload to other clients as they wait for the file. -Pete ------ Pete DeLaurentis Lead Software Engineer NextEngine, Inc. pete at nextengine.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070223/77970548/attachment.html
Corey Donohoe
2007-Feb-26 19:00 UTC
[Mongrel] [ANN] Mongrel Cluster 1.0.1.1 Prerelease: Healing power of the pack!
On 2/23/07, Bradley Taylor <bradley at railsmachine.com> wrote:> > Hello all... > > I know its been a while since the last one, but a new prerelease is > available with a gratuitous increase in version numbers! > > gem install mongrel_cluster --source > http://mongrel.rubyforge.org/releases/ > > * Default pid_file is now "tmp/pids/mongrel.pid" to match Rails rake > tasks. NOTE: I recommend using /var/run/mongrel_cluster so pids are > properly cleaned up after a crash.For what it''s worth I had to change my pid file path in my mongrel_cluster.yml file to make cap deploy happy. It appears cap calls restart before relinking the pid directory down into tmp. If you give the absolute path to shared/pids in your config file you should be setup. This is only if you go against what Bradley advises above. :) Thanks for the upgrade I can finally ditch my custom tasks. :D -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070226/8ce75843/attachment.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><title></title> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- body { margin: 5px 5px 5px 5px; background-color: #ffffff; } /* ---------- Text Styles ---------- */ hr { color: #000000} body, table /* Normal text */ { font-size: 9pt; font-family: ''Courier New''; font-style: normal; font-weight: normal; color: #000000; text-decoration: none; } span.rvts1 /* Heading */ { font-size: 10pt; font-family: ''Arial''; font-weight: bold; color: #0000ff; } span.rvts2 /* Subheading */ { font-size: 10pt; font-family: ''Arial''; font-weight: bold; color: #000080; } span.rvts3 /* Keywords */ { font-size: 10pt; font-family: ''Arial''; font-style: italic; color: #800000; } a.rvts4, span.rvts4 /* Jump 1 */ { font-size: 10pt; font-family: ''Arial''; color: #008000; text-decoration: underline; } a.rvts5, span.rvts5 /* Jump 2 */ { font-size: 10pt; font-family: ''Arial''; color: #008000; text-decoration: underline; } span.rvts6 { font-size: 11pt; font-family: ''tahoma''; font-weight: bold; color: #ffffff; background-color: #0000ff; } span.rvts7 { font-size: 11pt; font-family: ''tahoma''; } span.rvts8 { font-size: 11pt; font-family: ''tahoma''; font-weight: bold; } a.rvts9, span.rvts9 { font-size: 11pt; font-family: ''tahoma''; color: #0000ff; text-decoration: underline; } span.rvts10 { font-size: 8pt; font-family: ''arial''; font-style: italic; color: #c0c0c0; } a.rvts11, span.rvts11 { font-size: 8pt; font-family: ''arial''; color: #0000ff; text-decoration: underline; } /* ---------- Para Styles ---------- */ p,ul,ol /* Paragraph Style */ { text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; } .rvps1 /* Centered */ { text-align: center; } --></style> </head> <body> <p>Hello Corey,</p> <p><br></p> <p>Monday, February 26, 2007, 1:00:38 PM, you wrote:</p> <p><br></p> <div><table border=0 cellpadding=1 cellspacing=2 style="border-color: #000000; border-style: solid;"> <tr valign=top> <td width=12 style="background-color: #0000ff;"> <p><span class=rvts6>></span></p> </td> <td width=659 style="background-color: #ffffff;"> <p><span class=rvts7>On 2/23/07, </span><span class=rvts8>Bradley Taylor</span><span class=rvts7> <</span><a class=rvts9 href="mailto:bradley@railsmachine.com">bradley@railsmachine.com</a><span class=rvts7>> wrote:</span></p> <p><span class=rvts7>Hello all...</span></p> <p><br></p> <p><span class=rvts7>I know its been a while since the last one, but a new prerelease is</span></p> <p><span class=rvts7>available with a gratuitous increase in version numbers!</span></p> <p><br></p> <p><span class=rvts7>gem install mongrel_cluster --source </span><a class=rvts9 href="http://mongrel.rubyforge.org/releases/">http://mongrel.rubyforge.org/releases/</a></p> <p><br></p> <p><span class=rvts7>* Default pid_file is now "tmp/pids/mongrel.pid" to match Rails rake</span></p> <p><span class=rvts7>tasks. NOTE: I recommend using /var/run/mongrel_cluster so pids are</span></p> <p><span class=rvts7>properly cleaned up after a crash. </span></p> <p><br></p> <p><span class=rvts7>For what it''s worth I had to change my pid file path in my mongrel_cluster.yml file to make cap deploy happy. It appears cap calls restart before relinking the pid directory down into tmp. If you give the absolute path to shared/pids in your config file you should be setup. This is only if you go against what Bradley advises above. :) </span></p> <p><br></p> <p><span class=rvts7>Thanks for the upgrade I can finally ditch my custom tasks. :D</span></p> </td> </tr> </table> </div> <p><br></p> <p><br></p> <p>u</p> <p><br></p> <p><span class=rvts10>-- </span></p> <p><span class=rvts10>Best regards,</span></p> <p><span class=rvts10> Chris </span><a class=rvts11 href="mailto:chris.collins@fuse.net">mailto:chris.collins@fuse.net</a></p> </body></html>