newrelic / node-newrelic

New Relic Node.js agent code base. Developers are welcome to create pull requests here, please see our contributing guidelines. For New Relic technical support, please go to http://support.newrelic.com.
Apache License 2.0
959 stars 384 forks source link

newrelic module needs a lot of storage space #77

Closed Prinzhorn closed 10 years ago

Prinzhorn commented 10 years ago

I've noticed that my slug size on Heroku (https://devcenter.heroku.com/articles/slug-compiler) increased from about 30megs to over 70megs just because I added the newrelic module.

Running du | sort -g on the dyno these are the bottom lines

13320   ./.npm/newrelic/1.0.1/package/test/versioned/express3-mongodb-async/node_modules/mongodb/.coverage_data
13320   ./node_modules/newrelic/test/versioned/express3-mongodb-async/node_modules/mongodb/.coverage_data
15220   ./.npm/newrelic/1.0.1/package/test/versioned/express3-mongodb-async/node_modules/mongodb
15220   ./node_modules/newrelic/test/versioned/express3-mongodb-async/node_modules/mongodb
18140   ./.npm/newrelic/1.0.1/package/test/versioned/express3-mongodb-async/node_modules
18140   ./node_modules/newrelic/test/versioned/express3-mongodb-async/node_modules
18160   ./.npm/newrelic/1.0.1/package/test/versioned/express3-mongodb-async
18160   ./node_modules/newrelic/test/versioned/express3-mongodb-async
54960   ./.npm/newrelic/1.0.1/package/test/versioned
54960   ./node_modules/newrelic/test/versioned
58272   ./.npm/newrelic/1.0.1/package/test
58272   ./node_modules/newrelic/test
59708   ./.npm/newrelic/1.0.1/package
59732   ./node_modules/newrelic
74324   ./.npm/newrelic/1.0.1
74856   ./.npm/newrelic
101136  ./node_modules
134832  ./.npm
258384  .

I don't think the /test folder should be part of the release on npm. I suggest adding a .npmignore file.

Funny enough, on my dev machine the test folder only weighs about 1meg, whereas it's 57meg on Heroku.

Prinzhorn commented 10 years ago

I was still on 1.0.0 locally. Upgrading to 1.0.1 results in 57mb /test folder as well. This increases build time significantly.

othiym23 commented 10 years ago

This is due to an npm bug related to how it deals with the combination of bundledDependencies and multiple node_modules folders in a repo. That module should be around 300KiB as a tarball, but I forgot a step in the build process. I'll republish 1.0.1 in a more svelte form later today.

Prinzhorn commented 10 years ago

Great, thanks!

othiym23 commented 10 years ago

Republished a bazillion times smaller. Sorry about that!

Prinzhorn commented 10 years ago

Confirmed. Dropped from 59M to 2.6M