1
votes

I'm running a spring boot 1.4.3 app in openshift origin 1.3.

It takes more than 20 minutes to bring spring bootup.

the docker base container I'm using is alpine:3.4 with opendk8-jre.

the spring boot embedded container is using default tomcat one. I've installed the haveged and set -Djava.security.egd=file:/dev/./urandom

but if I run the image itself with docker run(I'm not using openshift), it can start up..

any idea why ?

1
Can you post the log of your Spring boot application starting up in a Docker container as well? Perhaps we might be able to resolve where the issue lies if we look at the timestamps. - g00glen00b
please find the log here pastebin.com/G55Vh5j6 as you can find from the log, it takes.more than 300seconds to start up. and sometines it takes more than 10 minutes. - Feng Xi
How much memory does your application normally require? OpenShift will set an upper bound on both memory and CPU in some cases, so if you are under memory pressure your app may be unable to start. - Clayton
Also, verify that the DNS in the container is resolving - sometimes long pauses can be the result of having an invalid DNS nameserver set on your hosts, because application libraries may hang waiting for name resolution. - Clayton
Thanks for your reminder Clayton. The memory I'm setting in OpenShift is 512Mi, for which I assume is enough for a normal spring boot or java app. But it turns out I'm wrong. When I increase the memory to 1G, my app starts quickly. Is there any tips/tricks/margic that I can use to tune my app ? - Feng Xi

1 Answers

0
votes

Could it be the case that you don't have a maven proxy setup and are downloading all dependencies?

If it's the case your logs likely show that you are donwloading the same deps over and over.

run this command to see the logs:

oc logs _POD_NAME_

Also, have you tried the same in OpenShift Dev Preview and got similar results?