How to adjust Hyperglance's memory allocation

Adjust the memory allocation afforded to Hyperglance if the application is slow or you are seeing out of memory errors.

How Hyperglance uses memory

Hyperglance stores inventory and billing data in-memory. Increasing RAM is the usually the best way to scale your Hyperglance deployment, not by increasing CPU, Disk or Network.

By default 75% of the machine's RAM is allocated as "heap space" to the Hyperglance application.  This default works well for smaller deployments but on larger-scale deployments it can be necessary to adjust this to best utilize available memory.

If you are experiencing OutOfMemoryError in the logs or severe slowdowns in the UI then increasing the memory allocation should help with that.

Adjusting memory allocation

You can configure a custom allocation by editing config.env:

Edit file:

/var/lib/data/hyperglance/config.env

Set memory allocation to reflect a recommendation:

MAX_HEAPSIZE=4g

Re-start the services:

sudo docker-compose -f /etc/docker-compose.yml up -d

Instance/VM RAM Guidelines

Many factors affect the memory use:

  • Number of accounts
  • Number of resources
  • Amount of billing data

The following table is a guideline based on the number of qualified resources in the license, just note this is approximate since many factors affect the memory use.

For larger deployments we recommend memory-optimised instance/VM types intended for large memory applications such as Hyperglance. AWS offer the R5-series of instances. Azure offer E series VMs.  We advise finding the cheapest type that offers the RAM needed.

 

Hyperglance Variant Recommended RAM Optimal Heap Size Example Instance/VM Size
250 Resources 4GB Default 75%

AWS: t3.medium
Azure: Standard_B2s
(or equivalent)

500 Resources 4GB Default 75%

AWS: t3.medium
Azure: Standard_B2s
(or equivalent)

1000 Resources 8GB Default 75%

AWS: t3.large
Azure: Standard_B2ms
(or equivalent)

2000 Resources 8GB - 16GB Default 75%

AWS: t3.xlarge
Azure: Standard_B4ms
(or equivalent)

5000 Resources 32GB 28GB

AWS: r5.xlarge
Azure: Standard_E4as_v5
(or equivalent)

10000 Resources 64GB - 128GB 60GB - 120GB

AWS: r5.4xlarge
Azure: Standard_E16-4as_v5
(or equivalent)

20000 Resources 256GB 250GB

AWS: r5.8xlarge
Azure: Standard_E32-8as_v5
(or equivalent)