Changing -XX:MaxRAMPercentage value for Healthwatch exporter vms
search cancel

Changing -XX:MaxRAMPercentage value for Healthwatch exporter vms

book

Article ID: 297944

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

In Healthwatch Exporter for Tanzu Application Service tile v2.2.7 the value of -XX:MaxRAMPercentage is set to 80% by default. Increased max percentage up to 80% because a lot of customers were reaching the default limit 30% because of huge traffic and were facing a lot of out of memory errors. There is no option to config this in the Product Tile right now, however the workaround to temporarily reset the value to different number is specified below.
The option is set to give JVM ability to use the given percentage of whole memory, but it does not mean that JVM will use memory exactly equal to that percentage. Note, it is up to JVM to decide how much memory it should reserve based on its algorithm, we just set the maximum percentage.

Environment

Product Version: 2.1

Resolution

Step 1. SSH to the OpsMan VM, Run "bosh upload-release https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=22.1.2"
Step 2. Run "vim ./os-config.yaml"
Step 3. Modify the file. You should update your deployment here: deployment: ["<Your_deployment_name>"], and you can change the value here as needed for example: "MaxRAMPercentage=30.0".

releases:
- name: os-conf
  version: 22.1.2
  url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=22.1.2
  sha1: 386293038ae3d00813eaa475b4acf63f8da226ef
 
addons:
  - name: update-MaxRAMPercentage
    include:
      deployment: ["<Your_deployment_name>"]
      instance_groups: ["pas-exporter-gauge"]
    jobs:
    - name: pre-start-script
      release: os-conf
      templates:
        pre-start.sh: bin/pre-start
      properties:
        script: |-
            #!/bin/bash
            echo 'sed -i 's/MaxRAMPercentage=80.0/MaxRAMPercentage=30.0/' /var/vcap/jobs/pas-exporter/config/bpm.yml' >> /var/vcap/jobs/bpm/bin/pre-start

Step 4. Run "bosh update-runtime-config --name=update-MaxRAMPercentage ./os-config.yaml"
Step 5. Apply Changes from the OpsMan UI for Healthwatch Exporter for Tanzu Application Service tile.
Step 6. Verify from the VM and check your Grafana dashboard metrics. "bosh -d <deployment_name> ssh pas-exporter-gauge" and "ps -ef | grep pas-exporter"