Phoenix: CodeReloader watches the `priv/` directory, slows down requests

Created on 27 Apr 2016  路  6Comments  路  Source: phoenixframework/phoenix

Environment

  • Elixir version (elixir -v): 1.2.4
  • Phoenix version (mix deps): 1.1.4
  • NodeJS version (node -v): 5.5.0
  • NPM version (npm -v): 3.5.3
  • Operating system: El Capitan

    Expected behavior

My priv/ directory contains a large vendor folder, containing Elasticsearch and a number of other foreign executables. I expect the CodeReloader to ignore this directory.

Actual behavior

CodeReloader observes the priv/vendor directory, slowing down each request, very similar to https://github.com/phoenixframework/phoenix/issues/1607. If the priv/vendor folder is moved to vendor, CodeReloader no longer watches it.

Now that :reloadable_paths has been removed from the Endpoint configuration options, how would one exclude the priv/vendor folder (or any other folder) from CodeReloader?

bug advanced discussion

Most helpful comment

Closing this in favor of the gettext issue.

All 6 comments

@danielberkompas thank you!

Two questions:

  1. Does the slow down also happen on the regular "mix compile" command? I don't believe we watch "priv" directory.
  2. Do you actually need those files in "priv"? Are they used by your application or just something that must be in the deployed system?

Yes, the slowdown appears to occur in mix compile.

$ time mix compile
mix compile  2.32s user 2.06s system 139% cpu 3.139 total
$ mv priv/vendor vendor
$ time mix compile
mix compile  0.87s user 0.45s system 110% cpu 1.195 total

To answer your second question, I don't need those files to be in priv/, and I'm fine with moving them somewhere else. I just thought it was odd that having a large directory in priv would cause this behavior, so it warranted a bug report.

@danielberkompas yes, there is definitely something weird going on. I am going to see if I can reproduce this. :)

It is the gettext compiler. /cc @whatyouhide :)

Argh, I'll look into this :)

Closing this in favor of the gettext issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GPrimola picture GPrimola  路  3Comments

mmcc picture mmcc  路  3Comments

tcoopman picture tcoopman  路  3Comments

mitchellhenke picture mitchellhenke  路  3Comments

mcampa picture mcampa  路  3Comments