fabric8io-images / README

Overview of Docker images provided by fabric8
17 stars 3 forks source link

Add JDK/JVM options for reliability and stability #3

Closed hrishin closed 6 years ago

hrishin commented 7 years ago

Its observed that following JVM options from OpenShift JDK image increases application/pods reliability and stability. Adding following JDK/JVM options to all( or specific) java images by default could provide better developer experience

-XX:+UseParallelGC 
-XX:MinHeapFreeRatio=20 
-XX:MaxHeapFreeRatio=40 
-XX:GCTimeRatio=4 
-XX:AdaptiveSizePolicyWeight=90 
-XX:MaxMetaspaceSize=100m 
-XX:+ExitOnOutOfMemoryError
rhuss commented 7 years ago

Thanks ! We should indeed align our options with the options from the other images

-XX:MaxMetaspaceSize=100m

I wonder whether we really can add a fixed size here, as it, of course, depends on the image we are running in. If not specified by the user, we calculated memory options based on the memory limits imposed on the container.

kameshsampath commented 7 years ago

I wonder whether we really can add a fixed size here, as it, of course, depends on the image we are running in

@rhuss what you mean here ?? can you please add some details ?

kameshsampath commented 7 years ago

@rhuss also adding one more thing if the experimental options for Docker Java things are added we should avoid computing from our scripts.. wdyt ?

rhuss commented 7 years ago

@rhuss what you mean here ?? can you please add some details ?

This is a base image. Setting some limits to a fixed value of 100 MB seems wrong to me, as their as the limit depends on the application which is running on this image and which is not known upfront. A relative size based on the container limits given makes more sense as this limit is set by the user who knows the requirements of its app (and sized the limit accordingly).

hrishin commented 6 years ago

@rhuss @kameshsampath

We did basic observation with these options. Its good to see a significant change with memory consumption with these options. Only thing is we are dropping -XX:MaxMetaspaceSize=100m option. As it imposes the memory limit for class metadata section. TL;DR; This flag will vary from one java application to other. WDYT?

rhuss commented 6 years ago

I'm happy with the relative values, and as they result from some real-world experiences I'm fine with them.