From lists at ruby-forum.com Mon Sep 1 05:46:03 2008 From: lists at ruby-forum.com (Deepak Battu) Date: Mon, 1 Sep 2008 11:46:03 +0200 Subject: [Mongrel] mongrel_rails: fatal: relocation error Message-ID: Just installed mongrel from source and when try to start mongrel.. the following error is coming. $>mongrel_rails start ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:225:in `require_frameworks': ld.so.1: mongrel_rails: fatal: relocation error: file /usr/local/lib/ruby/1.8/sparc-solaris2.8/digest/md5.so: symbol rb_Digest_MD5_Finish: referenced symbol not found - /usr/local/lib/ruby/1.8/sparc-solaris2.8/digest/md5.so (RuntimeError) from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:113:in `process' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `send' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run' from /opt/www/config/environment.rb:14 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /usr/local/lib/ruby/site_ruby/1.8/mongrel/rails.rb:147:in `rails' from /usr/local/bin/mongrel_rails:114:in `cloaker_' from /usr/local/lib/ruby/site_ruby/1.8/mongrel/configurator.rb:149:in `call' from /usr/local/lib/ruby/site_ruby/1.8/mongrel/configurator.rb:149:in `listener' from /usr/local/bin/mongrel_rails:100:in `cloaker_' from /usr/local/lib/ruby/site_ruby/1.8/mongrel/configurator.rb:50:in `call' from /usr/local/lib/ruby/site_ruby/1.8/mongrel/configurator.rb:50:in `initialize' from /usr/local/bin/mongrel_rails:85:in `new' from /usr/local/bin/mongrel_rails:85:in `run' from /usr/local/lib/ruby/site_ruby/1.8/mongrel/command.rb:212:in `run' from /usr/local/bin/mongrel_rails:282 can any one help me solve this problem. thank u deepak -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Sep 1 07:00:10 2008 From: lists at ruby-forum.com (Deepak Battu) Date: Mon, 1 Sep 2008 13:00:10 +0200 Subject: [Mongrel] mongrel_rails: fatal: relocation error In-Reply-To: References: Message-ID: <8a6b228fbab56b41dd3fcf3b11ae6ce1@ruby-forum.com> Sorry for all that was an error with the improper installation of ruby with ssl support.re installation of the ruby solved the problem. -- Posted via http://www.ruby-forum.com/. From jftucker at gmail.com Mon Sep 1 07:30:27 2008 From: jftucker at gmail.com (James Tucker) Date: Mon, 1 Sep 2008 12:30:27 +0100 Subject: [Mongrel] speed curiosity In-Reply-To: <960bbb7c18ebdb80973cf32047aa90b7@ruby-forum.com> References: <960bbb7c18ebdb80973cf32047aa90b7@ruby-forum.com> Message-ID: <475A9E9C-EE46-4D69-A5B4-6CF3C12171EB@gmail.com> On 30 Aug 2008, at 21:57, Roger Pack wrote: > As a note--using the mongrel example from > > http://mongrel.rubyforge.org/web/mongrel/files/README.html and Mongrel > 1.1.5 > > It yielded (for me) ~800 req/s [running ab -n 1000 -c 1 > http://localhost:3000/test] > > and if I changed > out.write("hello!\n") > > to > out.write("hello!\n"*10_000) AFAIK that's not the fastest of operations. > > > it yielded ~300 req/s. > > I was unable to get evented mongrel to run so wasn't able to compare > the > two. > > > Doing a little bit of investigating, kcachegrind+ruby-prof points the > latency to http_response.rb line 137 > > @socket.write(data) > > Experimenting by changing this line haphazardly to > > while data and data.length > 0 > wrote = @socket.write_nonblock(data) > data = data[wrote..-1] > end > > yielded ~938 req/s [AFAICT] Thin and ebb both write more like this. > > > > Thoughts? > > -=R > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Mon Sep 1 13:08:20 2008 From: lists at ruby-forum.com (Roger Pack) Date: Mon, 1 Sep 2008 19:08:20 +0200 Subject: [Mongrel] speed curiosity In-Reply-To: <475A9E9C-EE46-4D69-A5B4-6CF3C12171EB@gmail.com> References: <960bbb7c18ebdb80973cf32047aa90b7@ruby-forum.com> <475A9E9C-EE46-4D69-A5B4-6CF3C12171EB@gmail.com> Message-ID: >> out.write("hello!\n"*10_000) > > AFAIK that's not the fastest of operations. String creation itself turns out to not take too long: >> Benchmark.measure { "hello!\n"*10_000} => # So it's not a huge bottleneck. Replacing it with a static string yields approx. the same results, which I did thanks to your suggestion. >> latency to http_response.rb line 137 >> yielded ~938 req/s [AFAICT] > Thin and ebb both write more like this. Here's some results [ruby 1.8.6p287 OS X] running ab -n 300 7B response: old: 1595 req/s new: 1690 req/s (thin: 1901) 7K response: old: 1168 req/s new: 1559 req/s (thin: 1849) 70K response: old: 366 req/s new: 1140 req/s (thin: 1160) 700K response: old: 46 req/s new: 286 [or 48] req/s (thin: 295)* So overall better results, but most noticeable at the 70K level. It seems roughly on par with thin. IO#write is [I think] ruby thread friendly, so I'm not sure why the difference. Thanks! -=R * or 48: With some mongrel tests it would have a single long, out of 300, that would take 4s while the others all took 20ms. Not sure why. Excluding that, it ran at the 286 patch: Index: lib/mongrel/http_response.rb =================================================================== --- lib/mongrel/http_response.rb (revision 1036) +++ lib/mongrel/http_response.rb (working copy) @@ -137,7 +137,15 @@ end def write(data) - @socket.write(data) + while data and data.length > 0 + begin + amount_wrote = @socket.write_nonblock(data) + data = data[amount_wrote..-1] + rescue Errno::EAGAIN + # wait for it to become writable again + select nil, [@socket], nil, nil + end + end rescue => details socket_error(details) end -- Posted via http://www.ruby-forum.com/. From wayneeseguin at gmail.com Mon Sep 1 16:13:36 2008 From: wayneeseguin at gmail.com (Wayne Seguin) Date: Mon, 1 Sep 2008 16:13:36 -0400 Subject: [Mongrel] speed curiosity In-Reply-To: References: <960bbb7c18ebdb80973cf32047aa90b7@ruby-forum.com> <475A9E9C-EE46-4D69-A5B4-6CF3C12171EB@gmail.com> Message-ID: Roger, Using write_nonblock is an absolutely great suggestion; the only real issue with write_nonblock is that it doesn't work in all environments. While Ruby is supposed to fall back on blocking IO when async is unavailable in the underlying system the reality is sketchy at best. Through in Ruby implementations like Ruby and you end up with code that seemingly arbitrarily breaks. I'm all for write_nonblock however if this route is pursued then there has to be a whole chain of capability and environment detection around this chunk not a simple rescue (yes I have done this before). So, +1 from me as long as we modify as I suggested. ~Wayne On Sep 1, 2008, at 13:08 , Roger Pack wrote: >>> out.write("hello!\n"*10_000) >> >> AFAIK that's not the fastest of operations. > > String creation itself turns out to not take too long: >>> Benchmark.measure { "hello!\n"*10_000} > => # > > So it's not a huge bottleneck. Replacing it with a static string > yields > approx. the same results, which I did thanks to your suggestion. > >>> latency to http_response.rb line 137 >>> yielded ~938 req/s [AFAICT] >> Thin and ebb both write more like this. > > Here's some results [ruby 1.8.6p287 OS X] running ab -n 300 > > > 7B response: old: 1595 req/s new: 1690 req/s (thin: 1901) > 7K response: old: 1168 req/s new: 1559 req/s (thin: 1849) > 70K response: old: 366 req/s new: 1140 req/s (thin: 1160) > 700K response: old: 46 req/s new: 286 [or 48] req/s (thin: 295)* > > > > So overall better results, but most noticeable at the 70K level. It > seems roughly on par with thin. > IO#write is [I think] ruby thread friendly, so I'm not sure why the > difference. > > Thanks! > -=R > * or 48: With some mongrel tests it would have a single long, out of > 300, that would take 4s while the others all took 20ms. Not sure why. > Excluding that, it ran at the 286 > > patch: > Index: lib/mongrel/http_response.rb > =================================================================== > --- lib/mongrel/http_response.rb (revision 1036) > +++ lib/mongrel/http_response.rb (working copy) > @@ -137,7 +137,15 @@ > end > > def write(data) > - @socket.write(data) > + while data and data.length > 0 > + begin > + amount_wrote = @socket.write_nonblock(data) > + data = data[amount_wrote..-1] > + rescue Errno::EAGAIN > + # wait for it to become writable again > + select nil, [@socket], nil, nil > + end > + end > rescue => details > socket_error(details) > end > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Mon Sep 1 16:26:57 2008 From: lists at ruby-forum.com (Front Line) Date: Mon, 1 Sep 2008 22:26:57 +0200 Subject: [Mongrel] Question about mongrel debugging Message-ID: <48307490367d155738ebed5141ab0876@ruby-forum.com> I enabled debugging with "kill -USR1" and got this in the log: "** USR1 received, toggling $mongrel_debug_client to true" What else is this supposed to log and is it logging it in the same file? I haven't got any other lines in the log even though the process has received requests. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Sep 1 17:21:56 2008 From: lists at ruby-forum.com (Roger Pack) Date: Mon, 1 Sep 2008 23:21:56 +0200 Subject: [Mongrel] nagle disabled? Message-ID: Is nagle disabled for mongrel's sockets? I am thinking it isn't? Thanks! -=R -- Posted via http://www.ruby-forum.com/. From ml at stiegerhs.de Tue Sep 2 11:49:29 2008 From: ml at stiegerhs.de (Ingmar Stieger) Date: Tue, 02 Sep 2008 17:49:29 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <71166b3b0806240222n2cd0a7a3sc9b41ff1dd658288@mail.gmail.com> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> <4847D63F.5050204@stiegerhs.de> <71166b3b0806050524i29c373e3o165102acdf15011d@mail.gmail.com> <4847E361.3060202@stiegerhs.de> <71166b3b0806050646y762a5a80i63a9773d7b7908ce@mail.gmail.com> <4847F5D7.8050105@stiegerhs.de> <71166b3b0806240222n2cd0a7a3sc9b41ff1dd658288@mail.gmail.com> Message-ID: <48BD6089.9030704@stiegerhs.de> On Jun 24, 2008 at 11:22 PM, Luis Lavena wrote: > So, at the end, the ServiceHost automatic stuff didn't do the trick, > which is a pain. I wrote that code to be more intelligent, but I think > Windows beat me, again :-P > > Can you provide me your patch for ServiceFB library in google code?: > > http://code.google.com/p/mmediasys-labs/ Sorry, I almost forgot about this. I do not have a patch, really. I simpy commented out the call to _process_name_dyn_psapi and always set RunAsService (instead of RunAsUnknown): '# RunMode() provide a simple way to get (*you*) from where this process was started '# and do the corresponding action. function ServiceController.RunMode() as ServiceRunMode dim result as ServiceRunMode dim currPID as DWORD dim parent_pid as uinteger dim parent_name as string dim start_mode as string _dprint("ServiceController.RunMode()") '# get this process PID currPID = GetCurrentProcessId() _dprint("CurrentPID: " + str(currPID)) '# get the parent PID parent_pid = _parent_pid(currPID) _dprint("ParentPID: " + str(parent_pid)) '# now the the name parent_name = _process_name(parent_pid) '##if (parent_name = "") then '## parent_name = _process_name_dyn_psapi(parent_pid) '##end if _dprint("Parent Name: " + parent_name) '# this process started as service? '# that means his parent is services.exe if (parent_name = "services.exe") then result = RunAsService else '# ok, it didn't start as service, analyze command line then start_mode = lcase(trim(command(1))) if (start_mode = "manage") then '# start ServiceController.Manage() result = RunAsManager elseif (start_mode = "console") then '# start ServiceController.Console() result = RunAsConsole else '# ok, the first paramenter in the commandline didn't work, '# report back so we could send the banner! '## (ing) Run service anyway: '## result = RunAsUnknown result = RunAsService end if end if _dprint("ServiceController.RunMode() done") return result end function > Just create a new issue and attach / paste your patch, I'll really > appreciate get rid of this thing that, at the end, didn't provide > anything but just bring pain to us (sniff) :-P I do not know if this solves more problems than it opens up. Calling mongrel_service.exe with no command line parameters just does nothing with the version I posted above - which is ok for me and works fine. I am not sure if this is an acceptable solution for everybody else, though ... Bye, Ingmar From lists at ruby-forum.com Wed Sep 3 06:26:05 2008 From: lists at ruby-forum.com (Anders Eriksen) Date: Wed, 3 Sep 2008 12:26:05 +0200 Subject: [Mongrel] Option mime (-m) does'nt work Message-ID: <461b2dce3b05c87a6baa03520beab51f@ruby-forum.com> Trying to start Mongrel with: ruby script/server -p 3001 -m config/mongrel_mime.yml The config-file tells Mongrel to use ISO-8859-1 and includes: .htm: text/html; charset=ISO-8859-1 .html: text/html; charset=ISO-8859-1 But mongrel returns the following error when starting up: server: invalid option: -m But isn't the -m option the one to use? Anders -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 3 12:12:32 2008 From: lists at ruby-forum.com (Ripta Pasay) Date: Wed, 3 Sep 2008 18:12:32 +0200 Subject: [Mongrel] Option mime (-m) does'nt work In-Reply-To: <461b2dce3b05c87a6baa03520beab51f@ruby-forum.com> References: <461b2dce3b05c87a6baa03520beab51f@ruby-forum.com> Message-ID: <496002bdb84bb290f2bdfda98891e6cc@ruby-forum.com> The -m option is an option to mongrel_rails, not script/server. Try "mongrel_rails start -p 3001 -m config/mongrel_mime.yml" instead, or "mongrel_rails start -h" for help. Ripta Anders Eriksen wrote: > Trying to start Mongrel with: > ruby script/server -p 3001 -m config/mongrel_mime.yml > > The config-file tells Mongrel to use ISO-8859-1 and includes: > .htm: text/html; charset=ISO-8859-1 > .html: text/html; charset=ISO-8859-1 > > But mongrel returns the following error when starting up: > > server: invalid option: -m > > But isn't the -m option the one to use? > > Anders -- Posted via http://www.ruby-forum.com/. From counterveil at gmail.com Wed Sep 3 19:17:50 2008 From: counterveil at gmail.com (Christopher Opena) Date: Wed, 3 Sep 2008 16:17:50 -0700 Subject: [Mongrel] Mongrel .pids disappearing? Message-ID: <3a96987f0809031617n7bfb33a1kd80ca8c51ec516cf@mail.gmail.com> Hello everyone, new to the list :) Strange problem with Mongrels that we're having in a few cases...the Mongrels start up fine, but as part of a long Capistrano deploy + database we will normally cycle them - normally no issues there. In those edge cases, we've seen that the mongrel .pids have just up and disappeared while running, so when shutting them down we get the error message that the .pids do not exist. Normally not a problem, except that when restarting them (and thereby needing to create a new pid), the log comes back with the error message: ** Daemonized, any open files are closed. Look at log/mongrel.4102.pid and log/mongrel.4102.log for info. ** Starting Mongrel listening at 127.0.0.1:4102 /usr/lib64/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/tcphack.rb:12:in `initialize_without_backlog': Address already in use - bind(2) (Errno::EADDRINUSE) Logging into the server over ssh and executing 'sudo /usr/sbin/lsof -i:4102' reveals that indeed a mongrel process is running without a .pid. From what I can see there is no log rotation, cron job, or similar activity on the box that would be deleting the pids. In fact, some of the 6 .pids are there while others are not. The pattern also changes with regard to which ones are missing, which is mildly aggravating. Box is CentOS 5.1 if that helps. I also noted that someone was having this issue before and was cured by running the MySQL gem after seeing MySQL connections going stale / dying on their server, but we're already running the MySQL gem and are not seeing those errors in the Mongrel log. In fact, looking at the last successful start just before the error shown above, there are no other errors. In other words, Mongrel starts up daemonized without an issue or any errors in the log, and then some time later (in this case, 2 weeks), trying to stop them generates a nonexistent .pid error. The subsequent start attempt generates the 'Address already in use' message, which forces us to log in and actually kill the processes before we can start up again. Processes without .pids don't seem to be using more or less memory than usual. We are stopping and starting the mongrels with the following bash script: mongrel_rails cluster::start -C $MONGREL_CONF mongrel_rails cluster::stop -C $MONGREL_CONF Mongrel version is 1.0.1 (as described above), and MySQL gem is 2.7. Has anyone seen a similar issue, and if so did you figure out the root cause? I'm a bit at a loss with the mongrel logs not giving any information nor the system giving any inidication that it deleted the .pid files. Any help is greatly appreciated. -Chris. -------------- next part -------------- An HTML attachment was scrubbed... URL: From runner at berkeley.edu Wed Sep 3 19:47:20 2008 From: runner at berkeley.edu (Steven Hansen) Date: Wed, 03 Sep 2008 16:47:20 -0700 Subject: [Mongrel] Mongrel .pids disappearing? In-Reply-To: <3a96987f0809031617n7bfb33a1kd80ca8c51ec516cf@mail.gmail.com> References: <3a96987f0809031617n7bfb33a1kd80ca8c51ec516cf@mail.gmail.com> Message-ID: <48BF2208.1000007@berkeley.edu> I've been experiencing this exact same problem for months. Still haven't figured out what the cause is. I'm on solaris 10 x86 -Steven Christopher Opena wrote: > Hello everyone, new to the list :) > > Strange problem with Mongrels that we're having in a few cases...the > Mongrels start up fine, but as part of a long Capistrano deploy + > database we will normally cycle them - normally no issues there. In > those edge cases, we've seen that the mongrel .pids have just up and > disappeared while running, so when shutting them down we get the error > message that the .pids do not exist. Normally not a problem, except > that when restarting them (and thereby needing to create a new pid), > the log comes back with the error message: > > ** Daemonized, any open files are closed. Look at log/mongrel.4102.pid > and log/mongrel.4102.log for info. > ** Starting Mongrel listening at 127.0.0.1:4102 > /usr/lib64/ruby/gems/1.8/gems/ > mongrel-1.0.1/lib/mongrel/tcphack.rb:12:in > `initialize_without_backlog': Address already in use - bind(2) > (Errno::EADDRINUSE) > > Logging into the server over ssh and executing 'sudo /usr/sbin/lsof > -i:4102' reveals that indeed a mongrel process is running without a > .pid. From what I can see there is no log rotation, cron job, or > similar activity on the box that would be deleting the pids. In fact, > some of the 6 .pids are there while others are not. The pattern also > changes with regard to which ones are missing, which is mildly > aggravating. > > Box is CentOS 5.1 if that helps. I also noted that someone was having > this issue before and was cured by running the MySQL gem after seeing > MySQL connections going stale / dying on their server, but we're > already running the MySQL gem and are not seeing those errors in the > Mongrel log. > > In fact, looking at the last successful start just before the error > shown above, there are no other errors. In other words, Mongrel > starts up daemonized without an issue or any errors in the log, and > then some time later (in this case, 2 weeks), trying to stop them > generates a nonexistent .pid error. The subsequent start attempt > generates the 'Address already in use' message, which forces us to log > in and actually kill the processes before we can start up again. > > Processes without .pids don't seem to be using more or less memory > than usual. > > We are stopping and starting the mongrels with the following bash script: > > mongrel_rails cluster::start -C $MONGREL_CONF > mongrel_rails cluster::stop -C $MONGREL_CONF > > Mongrel version is 1.0.1 (as described above), and MySQL gem is 2.7. > > Has anyone seen a similar issue, and if so did you figure out the root > cause? I'm a bit at a loss with the mongrel logs not giving any > information nor the system giving any inidication that it deleted the > .pid files. Any help is greatly appreciated. > > -Chris. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From gurung_suman at hotmail.com Fri Sep 5 18:56:52 2008 From: gurung_suman at hotmail.com (suman gurung(hotmail)) Date: Fri, 5 Sep 2008 17:56:52 -0500 Subject: [Mongrel] problem starting mongrel in windows Message-ID: Hi everybody, I was trying to get rails applications deployed in my pc(windows vista), and I had some problem trying to start mongrel web server, and I have no clue as to how and why it is not working. I have installed ruby, rubygems, rails, mysql and mongrel, the last three as rubygems. I could run the 'rails' command to and create an application with the folder structure and all. But when I tried to start the mongrel, I get the following error message. F:\ROR\sources\hello>mongrel_rails start -d C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require': no such file to load -- win32/service (LoadError) from C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require. rb:27:in `require' from C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel_service-0.1/lib/mongrel_service/init.rb:5 from C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel_service-0.1/lib/mongrel_service/init.rb:27:in `require' from C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:134:in `load' from C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:195:in `each' from C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:195:in `each' from C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:112:in `load' from C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/bin/mongrel_rails:278 from C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/bin/mongrel_rails:19:in `load' from c:\ruby\jruby-1.1.3\bin\mongrel_rails:19 Also, is there any way to keep mongrel live and running?? I tried to install it as a service as mentioned in the website with the following command: gem install mongrel_service and it mentioned that 1 gem was installed, but I don't see any service with the name "mongrel" or "mongrel_rails" running in the list of services. I am new with mongrel so please do help me. Thanks, suman gurung -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sat Sep 6 13:04:56 2008 From: lists at ruby-forum.com (Roger Pack) Date: Sat, 6 Sep 2008 19:04:56 +0200 Subject: [Mongrel] speed curiosity In-Reply-To: References: <960bbb7c18ebdb80973cf32047aa90b7@ruby-forum.com> <475A9E9C-EE46-4D69-A5B4-6CF3C12171EB@gmail.com> Message-ID: <8d220e920a245b844416bc31b8162481@ruby-forum.com> Wayne Seguin wrote: > Using write_nonblock is an absolutely great suggestion; the only real > issue with write_nonblock is that it doesn't work in all environments. > While Ruby is supposed to fall back on blocking IO when async is > unavailable in the underlying system the reality is sketchy at best. Yeah I guess the best thing'd be to fix IO#write in the core, instead of a hack to work around it :) I have no idea what #write does but it appears that it is suboptimal, at least for this one distro on this one machine. Maybe I should just file a ruby bug report that says "IO#write seems slow!" :) Unfortunately it seems that on 1.9 it has the same speed pattern, so no help there. Thanks for your help. -=R >> approx. the same results, which I did thanks to your suggestion. >> 70K response: old: 366 req/s new: 1140 req/s (thin: 1160) >> -=R -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Sat Sep 6 16:08:38 2008 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 6 Sep 2008 17:08:38 -0300 Subject: [Mongrel] problem starting mongrel in windows In-Reply-To: References: Message-ID: <71166b3b0809061308vbebe336v24ad84d0a385dbd3@mail.gmail.com> On Fri, Sep 5, 2008 at 7:56 PM, suman gurung(hotmail) wrote: > Hi everybody, > I was trying to get rails applications deployed in my pc(windows vista), and > I had some problem trying to start mongrel web server, and I have no clue as > to how and why it is not working. > I have installed ruby, rubygems, rails, mysql and mongrel, the last three as > rubygems. I could run the 'rails' command to and create an application with > the folder structure and all. But when I tried to start the mongrel, I get > the following error message. > > F:\ROR\sources\hello>mongrel_rails start -d > C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require': no such file to load -- win32/service (LoadError) > from > C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require. > rb:27:in `require' > from > C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel_service-0.1/lib/mongrel_service/init.rb:5 > from > C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel_service-0.1/lib/mongrel_service/init.rb:27:in > `require' To keep it short: You're using JRuby, not Matz Ruby (MRI) so: mongrel_service gem will not work, since it depends on win32-service, which is only Windows (not Java). You're using a old version of mongrel_service (0.1) which definitely will not work as expected with latest Rails and Mongrel. Daemonize (-d) otpion requires fork functionality, which is not available in Windows (neither MRI or JRuby or any Ruby for Windows implementation). > > > Also, is there any way to keep mongrel live and running?? I tried to install > it as a service as mentioned in the website with the following command: gem > install mongrel_service and it mentioned that 1 gem was installed, but I > don't see any service with the name "mongrel" or "mongrel_rails" running in > the list of services. I am new with mongrel so please do help me. > mongrel_rails service::install --help That is clearly documented in mongrel site: http://mongrel.rubyforge.org/wiki/Win32 -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From mbj at seonic.net Sat Sep 6 14:04:57 2008 From: mbj at seonic.net (Markus Schirp) Date: Sat, 6 Sep 2008 20:04:57 +0200 Subject: [Mongrel] speed curiosity In-Reply-To: <8d220e920a245b844416bc31b8162481@ruby-forum.com> References: <960bbb7c18ebdb80973cf32047aa90b7@ruby-forum.com> <475A9E9C-EE46-4D69-A5B4-6CF3C12171EB@gmail.com> <8d220e920a245b844416bc31b8162481@ruby-forum.com> Message-ID: <20080906200457.21d62896@mbj.seonic.net> > Yeah I guess the best thing'd be to fix IO#write in the core, instead > of a hack to work around it :) I have no idea what #write does but > it appears that it is suboptimal, at least for this one distro on > this one machine. I do not think so, IO#write writes "exactly" n bytes even if the operating systems socket buffer infrastructure (and ruby's one) cannot handle "exactly" n bytes with optimal efficiency. It maybe force sending fragmented packages, do costly buffer expansion or other time consuming operations. IO#writepartial let the os (and ruby?) write the "optimal" amount of data in the current buffer and socket environment. Maybe the usage of the select (ruby) system call Kernel#select can be used to write to the socket "only if it would not block and or do other costly operations" - see above. Ruby 1.8 (maybe 1.9 too?) internally useing the select system call, to manage threading. Year's ago i tried to improve the throughput using select, unfortunately ruby 1.8 did not merge "my select call" in it's internal select calls. strace showed various "internal selects" and "my io selects" in unpredictable order, interrupting each other (ruby's thread scheduler timer?)... It was not he perfect solution ;) Maybe situation has changed? Mfg Markus From gurung_suman at hotmail.com Sat Sep 6 23:29:42 2008 From: gurung_suman at hotmail.com (suman gurung(hotmail)) Date: Sat, 6 Sep 2008 22:29:42 -0500 Subject: [Mongrel] problem starting mongrel in windows In-Reply-To: <71166b3b0809061308vbebe336v24ad84d0a385dbd3@mail.gmail.com> References: <71166b3b0809061308vbebe336v24ad84d0a385dbd3@mail.gmail.com> Message-ID: Thanks, Luis, for making me see that. Indeed I was using jruby's gems to install all the applications. When I installed anything using the gem command, it was the gem under the jruby folder that was being executed. I had to changed the precedence of the entries of jruby and ruby in the path(environment variable) and do all the installs again and mongrel runs smooth. great!!! -------------------------------------------------- From: "Luis Lavena" Sent: Saturday, September 06, 2008 3:08 PM To: Subject: Re: [Mongrel] problem starting mongrel in windows > On Fri, Sep 5, 2008 at 7:56 PM, suman gurung(hotmail) > wrote: >> Hi everybody, >> I was trying to get rails applications deployed in my pc(windows vista), >> and >> I had some problem trying to start mongrel web server, and I have no clue >> as >> to how and why it is not working. >> I have installed ruby, rubygems, rails, mysql and mongrel, the last three >> as >> rubygems. I could run the 'rails' command to and create an application >> with >> the folder structure and all. But when I tried to start the mongrel, I >> get >> the following error message. >> >> F:\ROR\sources\hello>mongrel_rails start -d >> C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `require': no such file to load -- win32/service (LoadError) >> from >> C:/ruby/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require. >> rb:27:in `require' >> from >> C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel_service-0.1/lib/mongrel_service/init.rb:5 >> from >> C:/ruby/jruby-1.1.3/lib/ruby/gems/1.8/gems/mongrel_service-0.1/lib/mongrel_service/init.rb:27:in >> `require' > > To keep it short: > > You're using JRuby, not Matz Ruby (MRI) so: > > mongrel_service gem will not work, since it depends on win32-service, > which is only Windows (not Java). > You're using a old version of mongrel_service (0.1) which definitely > will not work as expected with latest Rails and Mongrel. > > Daemonize (-d) otpion requires fork functionality, which is not > available in Windows (neither MRI or JRuby or any Ruby for Windows > implementation). > >> >> >> Also, is there any way to keep mongrel live and running?? I tried to >> install >> it as a service as mentioned in the website with the following command: >> gem >> install mongrel_service and it mentioned that 1 gem was installed, but I >> don't see any service with the name "mongrel" or "mongrel_rails" running >> in >> the list of services. I am new with mongrel so please do help me. >> > > mongrel_rails service::install --help > > That is clearly documented in mongrel site: > > http://mongrel.rubyforge.org/wiki/Win32 > > -- > Luis Lavena > AREA 17 > - > Human beings, who are almost unique in having the ability to learn from > the experience of others, are also remarkable for their apparent > disinclination to do so. > Douglas Adams > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From greg.hauptmann.ruby at gmail.com Mon Sep 8 00:39:40 2008 From: greg.hauptmann.ruby at gmail.com (Greg Hauptmann) Date: Mon, 8 Sep 2008 14:39:40 +1000 Subject: [Mongrel] reaper is not restarting mongrel with the latest release path?? (but rather an earlier releases path) In-Reply-To: References: Message-ID: Hi, I've tracked my "cap deploy" problems down to the fact that (at least with the unix user I've created for use with capistrano) when "script/process/reaper" is run, whilst it restarts the ruby process the resulting ruby process itself has a path that reflects the previous "release" path, not the latest one that was put in place as a result of capistrano. Note that the link (created by ln ...etc) is correct, so it seems "cap deploy" did it's job correctly except that the "reaper" call when it restarts the ruby processes does use the latest "current" path. If I log onto the prod server with this user and manually run "reaper" the same issue occurs. Any ideas? Also, I can't quite see in the reaper code in rails how it actually repopulates the PID file with the new PID number after a restart? Does mongrel itself do this when it received the "kill -s USR2"? === standard out ====== Macintosh-2:myequity greg$ cap deploy --debug * executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' * executing "svn checkout -q -r85 http://10.1.1.1:3690/svn/myequity/trunk /u/apps/myequity/releases/20080908032908 && (echo 85 > /u/apps/ myequity/releases/20080908032908/REVISION)" Preparing to execute command: svn checkout -q -r85 http://10.1.1.1:3690/svn/myequity/trunk /u/apps/myequity/releases/ 20080908032908 && (echo 85 > /u/apps/myequity/releases/20080908032908/ REVISION) Execute ([Yes], No, Abort) ? |y| y servers: ["10.1.1.1"] Password: [callagga at 10.1.1.1] executing command command finished * executing `deploy:finalize_update' * executing "chmod -R g+w /u/apps/myequity/releases/20080908032908" Preparing to execute command: chmod -R g+w /u/apps/myequity/releases/ 20080908032908 Execute ([Yes], No, Abort) ? |y| y servers: ["10.1.1.1"] [callagga at 10.1.1.1] executing command command finished * executing "rm -rf /u/apps/myequity/releases/20080908032908/log /u/ apps/myequity/releases/20080908032908/public/system /u/apps/myequity/ releases/20080908032908/tmp/pids &&\n mkdir -p /u/apps/myequity/ releases/20080908032908/public &&\n mkdir -p /u/apps/myequity/ releases/20080908032908/tmp &&\n ln -s /u/apps/myequity/shared/ log /u/apps/myequity/releases/20080908032908/log &&\n ln -s /u/ apps/myequity/shared/system /u/apps/myequity/releases/20080908032908/ public/system &&\n ln -s /u/apps/myequity/shared/pids /u/apps/ myequity/releases/20080908032908/tmp/pids" Preparing to execute command: rm -rf /u/apps/myequity/releases/ 20080908032908/log /u/apps/myequity/releases/20080908032908/public/ system /u/apps/myequity/releases/20080908032908/tmp/pids && mkdir -p /u/apps/myequity/releases/20080908032908/public && mkdir -p /u/apps/myequity/releases/20080908032908/tmp && ln -s /u/apps/myequity/shared/log /u/apps/myequity/releases/ 20080908032908/log && ln -s /u/apps/myequity/shared/system /u/apps/myequity/releases/ 20080908032908/public/system && ln -s /u/apps/myequity/shared/pids /u/apps/myequity/releases/ 20080908032908/tmp/pids Execute ([Yes], No, Abort) ? |y| y servers: ["10.1.1.1"] [callagga at 10.1.1.1] executing command command finished * executing "find /u/apps/myequity/releases/20080908032908/public/ images /u/apps/myequity/releases/20080908032908/public/stylesheets /u/ apps/myequity/releases/20080908032908/public/javascripts -exec touch - t 200809080329.22 {} ';'; true" Preparing to execute command: find /u/apps/myequity/releases/ 20080908032908/public/images /u/apps/myequity/releases/20080908032908/ public/stylesheets /u/apps/myequity/releases/20080908032908/public/ javascripts -exec touch -t 200809080329.22 {} ';'; true Execute ([Yes], No, Abort) ? |y| y servers: ["10.1.1.1"] [callagga at 10.1.1.1] executing command command finished * executing `deploy:symlink' * executing "rm -f /u/apps/myequity/current && ln -s /u/apps/ myequity/releases/20080908032908 /u/apps/myequity/current" Preparing to execute command: rm -f /u/apps/myequity/current && ln -s / u/apps/myequity/releases/20080908032908 /u/apps/myequity/current Execute ([Yes], No, Abort) ? |y| y servers: ["10.1.1.1"] [callagga at 10.1.1.1] executing command command finished ** transaction: commit * executing `deploy:restart' * executing "sudo -p 'sudo password: ' -u callagga /u/apps/myequity/ current/script/process/reaper" Preparing to execute command: sudo -p 'sudo password: ' -u callagga /u/ apps/myequity/current/script/process/reaper Execute ([Yes], No, Abort) ? |y| y servers: ["10.1.1.1"] [callagga at 10.1.1.1] executing command *** [err :: callagga at 10.1.1.1] ** [out :: callagga at 10.1.1.1] Restarting 19776 command finished Macintosh-2:myequity greg$ ==================== callagga 20557 2.8 5.3 29928 27112 ? S 13:29 0:03 ruby / usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails start -d -a 0.0.0.0 -p 3001 -P /u/apps/myequity/releases/20080908032044/tmp/pids/ dispatch.3001.pid -e production -c /u/apps/myequity/releases/ 20080908032044 -l /u/apps/myequity/releases/20080908032044/log/ mongrel.log ===================== From lists at ruby-forum.com Sun Sep 14 22:44:26 2008 From: lists at ruby-forum.com (Steve Meyer) Date: Mon, 15 Sep 2008 04:44:26 +0200 Subject: [Mongrel] "service mongrel_cluster start" startup fails Message-ID: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> I've attempted to configure mongrel to start as a service in RHEL. I've copied mongrel_cluster to /etc/init.d and "#/etc/init.d/mongrel_cluster start" does work. However when I attempt to start mongrel_cluster using "service mongrel_cluster start" I get the following error: service mongrel_cluster start /usr/bin/env: ruby: No such file or directory I am somewhat new to ruby. But could sure use some help. chkconfig --level 35 mongrel_cluster on # chkconfig --list mongrel_cluster mongrel_cluster 0:off 1:off 2:off 3:on 4:off 5:on 6:off -- Posted via http://www.ruby-forum.com/. From david at vrensk.com Mon Sep 15 08:01:05 2008 From: david at vrensk.com (David Vrensk) Date: Mon, 15 Sep 2008 14:01:05 +0200 Subject: [Mongrel] "service mongrel_cluster start" startup fails In-Reply-To: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> References: <84fd6e976c4d045b76b9601ec79b291d@ruby-forum.com> Message-ID: <81b453920809150501t68f85760i759009ba2751b795@mail.gmail.com> On Mon, Sep 15, 2008 at 4:44 AM, Steve Meyer wrote: > I've attempted to configure mongrel to start as a service in RHEL. > I've copied mongrel_cluster to /etc/init.d and > "#/etc/init.d/mongrel_cluster start" does work. However when I attempt > to start mongrel_cluster using "service mongrel_cluster start" I get the > following error: > service mongrel_cluster start > /usr/bin/env: ruby: No such file or directory "service" gives a better picture of what will happen on boot since it sets up the environment as it would be for the init process that runs all the little start scripts. In this case, it looks like ruby is not in the default path. Read the man-page for 'service' for a little more information and try creating a simple script in /etc/init.d that just prints out the environment variables, like this (untested): ---------------8<-------- #! /bin/sh env -------------8<--------- Make it executable and run it with "service name_of_script start" to see what it prints. It's not the solution to your problem, but it's a start. /David -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua at crackcreative.com Mon Sep 15 19:13:55 2008 From: joshua at crackcreative.com (joshua at crackcreative.com) Date: Mon, 15 Sep 2008 18:13:55 -0500 Subject: [Mongrel] scripts/server with mongrel arguments Message-ID: <468F8D2F-2E81-4959-9029-5051CD0C3F6E@crackcreative.com> Does anyone here know how to pass an argument like: "-S config/ mongrel_upload_progress.conf" to the mongrel that is run using the standard scripts/server command in a Rails app? I haven't been able to find any documentation on this. Thanks, j From joshua at crackCreative.com Mon Sep 15 18:34:20 2008 From: joshua at crackCreative.com (joshua@crackcreative.com) Date: Mon, 15 Sep 2008 17:34:20 -0500 Subject: [Mongrel] scripts/server with mongrel arguments Message-ID: <6CF44FDB-92B8-4CE3-A9F9-B158E65F7C4F@crackCreative.com> Does anyone here know how to pass an argument like: "-S config/ mongrel_upload_progress.conf" to the mongrel that is run using the standard scripts/server command in a Rails app? I haven't been able to find any documentation on this. Thanks, j From cnk at caltech.edu Mon Sep 15 19:33:50 2008 From: cnk at caltech.edu (Cynthia Kiser) Date: Mon, 15 Sep 2008 16:33:50 -0700 Subject: [Mongrel] scripts/server with mongrel arguments In-Reply-To: <468F8D2F-2E81-4959-9029-5051CD0C3F6E@crackcreative.com> References: <468F8D2F-2E81-4959-9029-5051CD0C3F6E@crackcreative.com> Message-ID: <20080915233350.GV21069@blinky.caltech.edu> Quoting joshua at crackcreative.com : > Does anyone here know how to pass an argument like: "-S config/ > mongrel_upload_progress.conf" to the mongrel that is run using the > standard scripts/server command in a Rails app? I haven't been able > to find any documentation on this. Looking at the rails script that is invoked, it doesn't look like there is an option like what you want. But the script seems well enough constructed that you are likely to be able to add that yourself if you don't mind re-adding that to your rails gem - or to vendor/rails if you run a personal copy of rails for each server. Have a look at the options allowed by: ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/mongrel.rb From lists at ruby-forum.com Tue Sep 16 17:01:11 2008 From: lists at ruby-forum.com (Sophie Su) Date: Tue, 16 Sep 2008 23:01:11 +0200 Subject: [Mongrel] Error when install Mongrel as a Windows service Message-ID: <043bc403d16a4fe9bf1537441d461da3@ruby-forum.com> I have Ruby and Rails 2.1.1 installed, then I installed mongrel 1.1.5. Now I want to install mongrel as a service. I downloaded and installed mongrel_service-0.3.3-mswin32.gem. After all these, I followed the instructions to install it as service by running the command below, but got an error. C:\ruby>mongrel_rails service::install -N BuildDashboard -c "c:\Build Dashboard" -p 4000 -e development c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.3.3-mswin32/lib/mongrel_service/init.rb:140:in `initialize': wrong number of arguments (0 for 1) (ArgumentError) from c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.3.3-mswin32/lib/mongrel_service/init.rb:140:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.3.3-mswin32/lib/mongrel_service/init.rb:140:in `run' from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/command.rb:212:in `run' from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/mongrel_rails:281 from c:/ruby/bin/mongrel_rails:16:in `load' from c:/ruby/bin/mongrel_rails:16 Thanks for any help. -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Sep 16 19:25:58 2008 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 16 Sep 2008 20:25:58 -0300 Subject: [Mongrel] Error when install Mongrel as a Windows service In-Reply-To: <043bc403d16a4fe9bf1537441d461da3@ruby-forum.com> References: <043bc403d16a4fe9bf1537441d461da3@ruby-forum.com> Message-ID: <71166b3b0809161625l1885c4edtbe42cc23b1c7a951@mail.gmail.com> On Tue, Sep 16, 2008 at 6:01 PM, Sophie Su wrote: > I have Ruby and Rails 2.1.1 installed, then I installed mongrel 1.1.5. > Now I want to install mongrel as a service. I downloaded and installed > mongrel_service-0.3.3-mswin32.gem. After all these, I followed the > instructions to install it as service by running the command below, but > got an error. > Did you install mongrel_service using RubyGems locally or remote? If you downloaded the gem and installed locally then the win32/service dependency will not be fulfilled. mongrel_service requires a specific version of that win32-service gem >= 0.5.2 and less than 0.6, since that version introduced some incompatibilities that require a lot of code change in the plugin. -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From lists at ruby-forum.com Wed Sep 17 11:14:45 2008 From: lists at ruby-forum.com (Zainab Memon) Date: Wed, 17 Sep 2008 17:14:45 +0200 Subject: [Mongrel] offline/local install of mongrel_service Message-ID: <8320fad730538fbb11473524481e34d1@ruby-forum.com> I am trying to install mongrel_service 0.3.4 on a server that does not have any outside internet connection. It has ruby 1.8.6 and I have been installing gems by copying the source into ..\ruby\lib\ruby\gems\1.8\gems and then doing a gem install --local using the .gem file. I was able to find and install all the gem dependencies of mongrel_service through rubyforge except win32-service which required version 0.5.2, which was not readily available through rubyforge's win32 utilities page (http://rubyforge.org/frs/?group_id=85). I ended up finding the gem win32-service-0.5.2-mswin32.gem I needed through google (http://rubyforge.org/frs/download.php/15355/win32-service-0.5.2-mswin32.gem) but I suspect if might have been corrupted. I installed this gem, then installed mongrel_service. After installing mongrel_service there is no mongrel_service.exe in ..\ruby\bin. Does anyone have any suggestions as to how I can successfully install mongrel_service? thanks! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 17 13:07:58 2008 From: lists at ruby-forum.com (Sophie Su) Date: Wed, 17 Sep 2008 19:07:58 +0200 Subject: [Mongrel] Error when install Mongrel as a Windows service In-Reply-To: <71166b3b0809161625l1885c4edtbe42cc23b1c7a951@mail.gmail.com> References: <043bc403d16a4fe9bf1537441d461da3@ruby-forum.com> <71166b3b0809161625l1885c4edtbe42cc23b1c7a951@mail.gmail.com> Message-ID: <5f4b5a154429a15f1fb209ea61379f7c@ruby-forum.com> Thanks very much for that information. I installed mongrel service locally. I didn't know it caused the service not work. My employer blocked lots of internet sites, so I was not able to install mongrel remotely from the office. I took my laptop home and did the remote installation from home. Now it works. Thanks again. Luis Lavena wrote: > On Tue, Sep 16, 2008 at 6:01 PM, Sophie Su wrote: >> I have Ruby and Rails 2.1.1 installed, then I installed mongrel 1.1.5. >> Now I want to install mongrel as a service. I downloaded and installed >> mongrel_service-0.3.3-mswin32.gem. After all these, I followed the >> instructions to install it as service by running the command below, but >> got an error. >> > > Did you install mongrel_service using RubyGems locally or remote? > > If you downloaded the gem and installed locally then the win32/service > dependency will not be fulfilled. > > mongrel_service requires a specific version of that win32-service gem >>= 0.5.2 and less than 0.6, since that version introduced some > incompatibilities that require a lot of code change in the plugin. > > -- > Luis Lavena > AREA 17 -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Wed Sep 17 13:48:26 2008 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 17 Sep 2008 14:48:26 -0300 Subject: [Mongrel] offline/local install of mongrel_service In-Reply-To: <8320fad730538fbb11473524481e34d1@ruby-forum.com> References: <8320fad730538fbb11473524481e34d1@ruby-forum.com> Message-ID: <71166b3b0809171048x10f27956i7d0563cee0c3b25b@mail.gmail.com> On Wed, Sep 17, 2008 at 12:14 PM, Zainab Memon wrote: > I am trying to install mongrel_service 0.3.4 on a server that does not > have any outside internet connection. It has ruby 1.8.6 and I have been > installing gems by copying the source into > ..\ruby\lib\ruby\gems\1.8\gems and then doing a gem install --local > using the .gem file. I was able to find and install all the gem > dependencies of mongrel_service through rubyforge except win32-service > which required version 0.5.2, which was not readily available through > rubyforge's win32 utilities page > (http://rubyforge.org/frs/?group_id=85). I ended up finding the gem > win32-service-0.5.2-mswin32.gem I needed through google > (http://rubyforge.org/frs/download.php/15355/win32-service-0.5.2-mswin32.gem) > but I suspect if might have been corrupted. I installed this gem, then > installed mongrel_service. After installing mongrel_service there is no > mongrel_service.exe in ..\ruby\bin. Does anyone have any suggestions > as to how I can successfully install mongrel_service? > Hello Zainab, If you don't have internet access, then will be really hard for you to fulfill all the dependencies. if win32utils project administrator decided to hide previous releases, the files are still there, as you found. The gem is not corrupted. The mongrel_service executable will be copied automatically the first time you install (with service::install) a Rails application. So: 1) download manually the following gems (you can use wget or enter the url in your browser) http://gems.rubyforge.org/gems/cgi_multipart_eof_fix-2.5.0.gem http://gems.rubyforge.org/gems/mongrel-1.1.5-x86-mswin32-60.gem http://gems.rubyforge.org/gems/gem_plugin-0.2.3.gem http://gems.rubyforge.org/gems/mongrel_service-0.3.4-i386-mswin32.gem http://gems.rubyforge.org/gems/win32-service-0.5.2-mswin32.gem 2) install with gem install --local in the same order I listed above. 3) install your rails application as service: mongrel_rails service::install (all the params here) 4) Done, you can now start the service with "net start ..." and "net stop ..." HTH, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From lists at ruby-forum.com Mon Sep 22 04:52:38 2008 From: lists at ruby-forum.com (Chris James) Date: Mon, 22 Sep 2008 10:52:38 +0200 Subject: [Mongrel] Mongrel + Apache occasional Proxy Error Message-ID: Hi There - long time reader first time poster :p I appreciate this is a problem with quite a few threads out there, but I have read many of the threads and tried many of the fixes / hacks suggested to no avail. I have taken over looking after a server that is running 6 rails applications, each with up to 3 mongrels each. The apps each use a local mysql database. Every few days or sometimes more frequently I get the infuriating error from some of the apps: ======================== Proxy Error The proxy server recieved an invalid response from an upstream server. The proxy could not handle the request GET / Reason: Error reading from remote server ======================== I have read many threads and tried adding the following to the vhost file for each cluster: SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 This did not seem to solve the issue unfortunately. I have the mysql gem installed (ver 2.7). When I log into mysql and run the "show full processlist" there are a lot of SLEEP commands with a TIME value ranging from 100 - 3000. It looks like there is one for each mongrel in each cluster. I am not sure if this is normal behavior for the mysql gem? Is there any way of finding out whether rails is using the mysql gem? Can the gem be installed but rails still be using the ruby drivers instead of the gem? I am not even sure if it is a mysql issue, but mysql seems to be the first port of call for fixing the proxy errors. I have been banging y head against this for weeks now and am completely out of ideas! Any help would be most appreciated! Key Info: OS: CentOS 5 Apache: Apache/2.0.52 MySQL: Ver 14.7 Distrib 4.1.20 GEM: mysql (2.7) Ruby: ruby 1.8.6 Rails rails (2.1.0, 1.2.4, 1.2.3) (Apps using 2.1.0) Mongrel: 1.1.5 Thanks guys! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Sep 27 11:20:16 2008 From: lists at ruby-forum.com (Roger Pack) Date: Sat, 27 Sep 2008 17:20:16 +0200 Subject: [Mongrel] Mongrel hangs with 100% CPU / EBADF (Bad file descriptor) In-Reply-To: References: Message-ID: <050ca8485ce842556570a032eb163db6@ruby-forum.com> > gettimeofday({1219834026, 235289}, NULL) = 0 > select(4, [3], [0], [], {0, 905241}) = -1 EBADF (Bad file descriptor) > gettimeofday({1219834026, 235477}, NULL) = 0 > select(4, [3], [0], [], {0, 905053}) = -1 EBADF (Bad file descriptor) > gettimeofday({1219834026, 235654}, NULL) = 0 > select(4, [3], [0], [], {0, 904875}) = -1 EBADF (Bad file descriptor) > gettimeofday({1219834026, 235829}, NULL) = 0 > select(4, [3], [0], [], {0, 904700}) = -1 EBADF (Bad file descriptor) > gettimeofday({1219834026, 236017}, NULL) = 0 > select(4, [3], [0], [], {0, 904513}) = -1 EBADF (Bad file descriptor) > gettimeofday({1219834026, 236192}, NULL) = 0 > select(4, [3], [0], [], {0, 904338}) = -1 EBADF (Bad file descriptor) > gettimeofday({1219834026, 236367}, NULL) = 0 > ... > > I used lsof and found that the process used 67 file descriptors (lsof -p > PID |wc -l) > You could try evented mongrel. I think the real problem is that internally ruby's select mechanism isn't designed to handle -1's from select. I'd call that a ruby bug, should that be the case. In Python when this happens it raises an exception and relies on the caller to loop through each socket and discover the offending one. I can only hope that 1.9 does better at this situation. I beliee ruby's select also doesn't handle "more than 1024 socket descriptors" [it ignores those above 1024] so...I'd call it less than perfect.[1] -=R [1] http://rubyforge.org/tracker/index.php?func=detail&aid=20088&group_id=426&atid=1698 -- Posted via http://www.ruby-forum.com/. From joshua at crackcreative.com Tue Sep 30 16:34:58 2008 From: joshua at crackcreative.com (joshua at crackcreative.com) Date: Tue, 30 Sep 2008 13:34:58 -0700 Subject: [Mongrel] mongrel cluster configuration Message-ID: <0A7E90A8-66D2-4E13-AB60-54D6DC9C3A69@crackcreative.com> So I'm using ec2onrails which launches mongrels like: mongrel_rails cluster::start -C /etc/mongrel_cluster/app.yml -clean $* Where app.yml looks like this: --- user: app cwd: /mnt/app/current port: "8000" environment: production daemon: true pid_file: log/mongrel.pid servers: 6 group: app The question is, I have installed the mongrel upload_progress plugin, and according to the docs I need it to read a script (mongrel.config) in the config folder of my app: uri "/", :handler => plugin("/handlers/upload", :frequency => 1, :drb => 'druby://127.0.0.1:2999', :path_info => ['/assets.js']), :in_front => true The docs say to use a command like "mongrel_rails start -S config/ mongrel.config", which works when I hack it into the local rails script/server process, however the -S options doesn't appear to be valid for for the mongrel cluster::start command. Can this information be put in the app.yml file somehow? Is there a way to get the cluster to read the script file? Thanks, j