Skip to content

Commit a176c43

Browse files
authored
Merge pull request #301 from GOKULRAJ136/JOPT-13X
Perform optimization for JVM arguments Durian Repo [MOSIP-44752]
2 parents b64feb7 + 0dc25b6 commit a176c43

4 files changed

Lines changed: 219 additions & 193 deletions

File tree

data-share/data-share-service/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,18 @@ VOLUME ${work_dir}/logs
7575

7676
ADD ./target/data-share-service-*.jar data-share-service.jar
7777

78+
COPY configure_start.sh ${work_dir}/configure_start.sh
79+
7880
# change permissions of file inside working dir
79-
RUN chown -R ${container_user}:${container_user} /home/${container_user}
81+
RUN sed -i 's/\r$//' ${work_dir}/configure_start.sh \
82+
&& chmod +x ${work_dir}/configure_start.sh \
83+
&& chown -R ${container_user}:${container_user} ${work_dir}
8084

8185
# select container user for all tasks
8286
USER ${container_user_uid}:${container_user_gid}
8387

8488
EXPOSE 8097
8589

86-
CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
87-
java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops \
88-
-Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar data-share-service.jar ; \
90+
ENTRYPOINT ["sh", "configure_start.sh"]
91+
92+
CMD java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar data-share-service.jar ; \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
#installs the pre-requisites.
4+
set -e
5+
6+
echo "Downloading pre-requisites install scripts"
7+
8+
wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
9+
10+
echo "Installating pre-requisites completed."
11+
12+
exec "$@"

helm/datashare/values.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ service:
4646
externalTrafficPolicy: Cluster
4747
image:
4848
registry: docker.io
49-
repository: mosipid/data-share-service
50-
tag: 1.3.0
49+
repository: mosipqa/data-share-service
50+
tag: 1.3.x
5151
## Specify a imagePullPolicy
5252
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
5353
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -113,15 +113,25 @@ resources:
113113
# resources, such as Minikube. If you do want to specify resources, uncomment the following
114114
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
115115
limits:
116-
cpu: 1000m
116+
cpu: 600m
117117
memory: 4000Mi
118118
requests:
119-
cpu: 500m
120-
memory: 2400Mi
119+
cpu: 300m
120+
memory: 2000Mi
121121
additionalResources:
122122
## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources
123123
## Example: java_opts: "-Xms500M -Xmx500M"
124-
javaOpts: "-Xms1800M -Xmx3000M"
124+
javaOpts: >-
125+
-XX:+UseZGC -XX:+ZGenerational -XX:+ZUncommit
126+
-XX:ZUncommitDelay=30 -XX:+ZProactive -XX:ZCollectionInterval=5
127+
-Xms1500m -Xmx3600m -XX:SoftMaxHeapSize=3200m
128+
-XX:+UseContainerSupport -XX:MaxMetaspaceSize=256m
129+
-XX:MetaspaceSize=128m -XX:ReservedCodeCacheSize=160m
130+
-XX:InitialCodeCacheSize=48m -XX:+UseCodeCacheFlushing
131+
-XX:+ExitOnOutOfMemoryError -XX:+PrintCommandLineFlags
132+
-Djava.security.egd=file:/dev/urandom
133+
-Dcom.amazonaws.sdk.disableEc2Metadata=true
134+
-Daws.sdk.disableCertChecking=false -Dhttp.keepAlive=true
125135
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
126136
## Clamav container already runs as 'mosip' user, so we may not need to enable this
127137
containerSecurityContext:

0 commit comments

Comments
 (0)