Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of jvm Parameter setting of tomcat Project in K8s

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the example analysis of jvm parameter setting of tomcat project in K8s, which is very detailed and has certain reference value. Interested friends must finish reading it!

K8s cluster facilitates deployment. But it also brings other problems, such as with the continuous increase of services, memory + cpu continues to add, the cost is also increasing.

In the early frontend and backend projects, tomcat8 is used as the server container, and the corresponding jvm configuration is as follows:

Kubectl get pod-n namespace podName-o yaml

Containers:- env:-name: JAVA_OPTS value:-server-Xmx3550m-Xms3550m-Xmn2g-Xss256k-Duser.timezone=GMT+8-XX:+DisableExplicitGC-XX:+UseConcMarkSweepGC-XX:+CMSParallelRemarkEnabled-XX:LargePageSizeInBytes=128m-XX:+UseFastAccessorMethods-XX:+UseCMSInitiatingOccupancyOnly-XX:CMSInitiatingOccupancyFraction=70

View the yaml file in the Aliyun console:

Containers:-env:-name: JAVA_OPTS value: >-- server-Xmx3550m-Xms3550m-Xmn2g-Xss256k-Duser.timezone=GMT+8-XX:+DisableExplicitGC-XX:+UseConcMarkSweepGC-XX:+CMSParallelRemarkEnabled-XX:LargePageSizeInBytes=128m-XX:+UseFastAccessorMethods-XX:+UseCMSInitiatingOccupancyOnly-XX:CMSInitiatingOccupancyFraction=70

For example, a smaller configuration:

Kubectl get pod-n namespace2 podName2-o yaml

Containers:- env:-name: JAVA_OPTS value:-server-Xmx2000m-Xms2000m-Xmn800m-Xss512k-Duser.timezone=GMT+8-XX:+DisableExplicitGC-XX:+UseConcMarkSweepGC-XX:+CMSParallelRemarkEnabled-XX:LargePageSizeInBytes=128m-XX:+UseFastAccessorMethods-XX:+UseCMSInitiatingOccupancyOnly-XX:CMSInitiatingOccupancyFraction=70

Corresponding to the yaml configuration of Ali Cloud console:

Containers:-env:-name: JAVA_OPTS value: >-- server-Xmx2000m-Xms2000m-Xmn800m-Xss512k-Duser.timezone=GMT+8-XX:+DisableExplicitGC-XX:+UseConcMarkSweepGC-XX:+CMSParallelRemarkEnabled-XX:LargePageSizeInBytes=128m-XX:+UseFastAccessorMethods-XX:+UseCMSInitiatingOccupancyOnly-XX:CMSInitiatingOccupancyFraction=70

Jvm tuning is involved here.

The above is all the contents of the article "sample Analysis of jvm Parameter Settings of tomcat Project in K8s". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report