I am running a basic Jhipster generated app - see bottom for setup details - that is to be run on a single basic Heroku dyno for the time being. I use the embedded tomcat approach and all is working out fine apart from the start-up time on the production profile.
Running the server locally on my machine with Foreman I get the following results:
- On the dev profile I get start-up times of <30sec for both the local and the remote Heroku database.
- On the prod profile this goes up to >100sec for both cases.
This causes Heroku to terminate the instance before start-up completes due to them requiring the server to bind to their designated port within 60 seconds.
Thus my question is how/if I could reduce that time. I am aware of Heroku offering to increase the timeout interval to 120sec on a per-application basis. I would appreciate a more elegant approach, though, especially since I am running on a basic dyno so that timeout extension might not even be sufficient.
I know of Jetty/WebappRunner, too, but would prefer to stick to the simpler embedded tomcat setup if at all possible.
Finally, I have seen that for Rails there is the possibility of employing a proxy during start-up to bind to Heroku's port right away - I did not find a Spring equivalent, though.
Thanks in advance!
Setup
- jhipster v017.2
- authenticationType": "token"
- hibernateCache": "no"
- clusteredHttpSession": "no"
- websocket": "no"
- databaseType": "sql"
- devDatabaseType": "postgresql"
- prodDatabaseType": "postgresql"
- useCompass": true
- buildTool": "maven",
- frontendBuilder": "grunt"
- javaVersion": "7"