4

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"
Baldrick
  • 23,882
  • 6
  • 74
  • 79
  • Have you tried scaling the number of dyno's up? – Rori Stumpf Nov 27 '14 at 01:03
  • No I did not; it would not have solved the issue in any case. I would have needed to switch to more performant dyno - more dynos just means the same problem on more dynos. As of of now I could not resolve the problem but I guess it is an configuration error on my part - either on the app or the heroku setup. Question may be closed. – Manuel Weidmann Jan 26 '15 at 09:12
  • Have you tried using JConsole to see what's taking the time? I found jHipster was painfully slow to start even in dev mode. Using JConsole I could see most of the time was spent generating the swagger docs. If you have a lot of rest resources then it's particularly bad. Knowing the cause though means you can do something about it. I.e. turn off swagger or maybe generate the docs as part of the build instead. Your issue may be somewhere else but JConsole should help you find it. – Ben Thurley Oct 28 '15 at 14:22

0 Answers0