The deployment of my play 2.1 application is very slow since several weeks. In fact it is randomly so slow that the build times out (15 minutes time limit).
I already tried to use a custom buildpack, with few to no effect.
When I do the build locally as described here it takes appr. 10 minutes, but most of the time is spend in retrieval of the dependent artifacts. When i have a look at the build on Heroku, the retrieval doesn't need much time and thus the retrieval seems not to be the problem.
About the build: [info] Compiling 83 Scala sources and 3 Java sources.
It looks like the generation and packaging of sources and docs (never used in prod) seem to take a significant amount of time.
Is there any way to reduce the build time significantly, e.g. by shutting of the generation of docs?
You can potentially reduce the time of compilation by reducing what is included in the compilation of your application. You can tell the Heroku slug compiler to exclude things like docs and sources from the application slug it creates.
Heroku uses a file called .slugignore which is the same concept as the .gitignore file. Details of the .slugignore file are covered in the Slug Compiler article on Heroku Dev Center:
https://devcenter.heroku.com/articles/slug-compiler
If you are unsure as to what is actually making up your deployment, you can connect via secure shell to your running Heroku application using the command
heroku run bash
Then you can navigate around your application deployment files and folders to see if there is anything else you can remove. The Heroku Scala build pack should have removed things like the ivy cache.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With