This week's giveaway is in the Spring forum.
We're giving away four copies of liveProject: Protecting User Data with Spring Security and OAuth2 and have Laurentiu Spilca on-line!
See this thread for details.
Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Tuning Metaspace for Services

Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a web services platform where we deploy Java based web services inside docker containers. By default, up until now we were making a Max Metaspace allocation of 256MB. However, we found that for most of the 95% of the services the maximum used metaspace never crosses 150MB. To add to that we have over 5000 instance of services running which is only increasing as more and more teams move from legacy system to this.

The way the platform works is like this:
We have a customized runtime which runs on top of Dropwizard. We take the WAR, read its contents and pass onto the underlying Jetty web server which is embedded in Dropwizard. This allows us to maintain and improve the runtime independent of the WAR which is developed by the consumer teams. We also have a monitoring system in place which monitor all the JVM metrics and reports it.

Optimization 1st Attempt
We used the monitoring system to identify the max used metaspace for each and every service. On top of that we added some buffer and set that as the max metaspace for the services in our internal environments. However, we quickly realized that wasn't working partially when we started receiving alerts for some of the services (~5-6%). This where we started investigating further. We found that for some of the service, the WAR version didn't change, but there was a change in the runtime version, which may have contributed to increase in the required metaspace for those services and this is where we need help.

We have two completely different components which are developed independently but one relies on other for it to run. So, how do we even estimate the required metaspace upfront so that we can dynamically set the required metaspace during deployment for our services.
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic