Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion linux project dir with many (15k) files un-guard-able

Received: by 10.101.134.33 with SMTP id l33mr1565206ann.3.1337949146113;
        Fri, 25 May 2012 05:32:26 -0700 (PDT)
X-BeenThere: guard-dev@googlegroups.com
Received: by 10.236.42.69 with SMTP id i45ls2264953yhb.3.gmail; Fri, 25 May
 2012 05:32:24 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.236.170.66 with SMTP id o42mr215497yhl.11.1337949144858; Fri,
 25 May 2012 05:32:24 -0700 (PDT)
Authentication-Results: ls.google.com; spf=pass (google.com: domain of
 edsloc...@gmail.com designates internal as permitted sender)
 smtp.mail=edsloc...@gmail.com; dkim=pass
 header...@gmail.com
Received: by d33g2000yqa.googlegroups.com with HTTP; Fri, 25 May 2012 05:32:24
 -0700 (PDT)
Date: Fri, 25 May 2012 05:32:24 -0700 (PDT)
In-Reply-To: <BEA76503-5A5F-47AB-89BB-2F3DDD20AEFC@thibaud.me>
References: <190afc71-3d6d-4f4c-92d9-d8d3ed248a45@oy3g2000pbc.googlegroups.com>
 <BEA76503-5A5F-47AB-89BB-2F3DDD20AEFC@thibaud.me>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)
 Gecko/20100101 Firefox/10.0.2,gzip(gfe)
Message-ID: <d9989e42-d41e-4b00-b78f-abb1f11e2105@d33g2000yqa.googlegroups.com>
Subject: Re: linux project dir with many (15k) files un-guard-able
From: eps <edsloc...@gmail.com>
To: guard-dev <guard-dev@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I guess I should have been clearer; I don't need or want to watch any
of the 15k files that guard is thrashing.  I want to ignore them; I
want to eliminate the disk activity that is slowing down the system.

Moving the dir with the 15k files in it (without symlinking back)
accomplishes this, but I do need those files in place in the project
to do development work.  I just don't need (or want) guard to watch
(or even seek/stat) them for rspec testing.

I am not experiencing the resource allocation problem ("user limit on
the total  number of inotify watches was reached") that I encountered
prior to increasing max_user_watches.

I thought ignore_paths would do what I want, but it doesn't seem to
help.


On May 25, 12:11=A0am, Thibaud Guillaume-Gentil <thib...@thibaud.me>
wrote:
> Maybe 65536 isn't enough, we have a good wiki page about that:https://git=
hub.com/guard/listen/wiki/Increasing-the-amount-of-inotify...
>
> You can also give a try to Guard 1.1.0.beta that use the Listen gem.
>
> On May 25, 2012, at 00:34 , eps wrote:
>
>
>
>
>
>
>
> > I'm using guard with rspec and spork in a on ubuntu 12.04, rails
> > 3.2.3, ruby 1.9.3
>
> > I have a directory in public/ in the rails project directory with
> > around 15,000 files in it. =A0When I fire up guard, the disk gets
> > thrashed to the point where the workstation is effectively unusable.
> > I *have* added ignore_paths 'public' to the Guardfile, which makes no
> > difference.
>
> > Guard works fine with this project on other developers' MacOS
> > workstations, this disk-grinding only seems to happen on Linux.
>
> > I have bumped up max_user_watches:
>
> > $ cat /proc/sys/fs/inotify/max_user_watches
> > 65536
>
> > I've tried moving the dir containing the 15k files out of the project
> > dir, and then symlinking to it; this doesn't fix the problem.
>
> > -----------------------------------------
> > Relevant snippet of Gemfile:
> > -----------------------------------------
> > group :development, :test do
> > =A0gem 'thin'
> > =A0gem 'rspec-rails'
> > =A0gem 'capybara'
> > =A0gem 'fuubar'
> > =A0gem 'nifty-generators'
> > =A0gem 'nokogiri'
> > =A0gem 'sqlite3'
> > =A0gem 'rails_best_practices'
> > =A0gem 'rb-fsevent'
> > =A0gem 'guard-rspec'
> > end
>
> > --------------
> > Guardfile:
> > --------------
>
> > # -*- ruby -
> > *-
> > # A sample
> > Guardfile
> > # More info athttps://github.com/guard/guard#readme
>
> > ignore_paths 'public'
>
> > # NOTE: spork section needs to come
> > first.
> > guard 'spork', :rspec_env =3D> { 'RAILS_ENV' =3D> 'test' } do
> > =A0watch('config/application.rb')
> > =A0watch('config/environment.rb')
> > =A0watch(%r{^config/environments/.+\.rb$})
> > =A0watch(%r{^config/initializers/.+\.rb$})
> > =A0watch('Gemfile')
> > =A0watch('Gemfile.lock')
> > =A0watch('spec/factories.rb')
> > =A0watch('spec/spec_helper.rb') { :rspec }
> > =A0watch(%r{^app/(.+)\.rb$})
> > end
>
> > guard 'rspec', :version =3D> 2, :cli =3D> "--drb", :all_on_start =3D>
> > false, :all_after_pass =3D> false do
> > =A0watch(%r{^spec/.+_spec\.rb$})
> > =A0watch(%r{^lib/(.+)\.rb$}) =A0 =A0 { |m| "spec/lib/#{m[1]}_spec.rb" }
> > =A0watch('spec/spec_helper.rb') =A0{ "spec" }
>
> > =A0# Rails
> > example
> > =A0watch(%r{^app/(.+)\.rb$}) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 { |m| "spec/
> > #{m[1]}_spec.rb" }
> > =A0watch(%r{^app/(.*)(\.erb|\.haml)$}) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
{ |m| "spec/
> > #{m[1]}#{m[2]}_spec.rb" }
> > =A0watch(%r{^app/controllers/(.+)_(controller)\.rb$}) =A0{ |m| ["spec/
> > routing/#{m[1]}_routing_spec.rb",
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "spec/
> > #{m[2]}s/#{m[1]}_#{m[2]}_spec.rb",
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "spec/
> > acceptance/#{m[1]}_spec.rb"] }
> > =A0watch('spec/factories.rb') =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0{ "spec" }
> > =A0watch('config/routes.rb') =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 { "spec/
> > routing" }
> > =A0watch('app/controllers/application_controller.rb') =A0{ "spec/
> > controllers" }
>
> > =A0# Request
> > specs
> > =A0watch(%r{^app/views/(.+)/}) { |m| "spec/requests/#{m[1]}
> > _request_spec.rb" }