Sonarqube 8.8 prerequisites: Why set vm.max_map_count=524288 regardless of hardware specifications?

This is related to upgrade to Sonarqube 8.8 Requirements Guide

under “Platform Notes”, The prerequisites dictate that

"If you’re running on Linux, you must ensure that:

  • vm.max_map_count is greater than or equal to 524288"

Looking into what that setting actually means, I read from the Linux Kernel Documentation

"max_map_count:

This file contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap and mprotect, and also when loading shared libraries.

While most applications need less than a thousand maps, certain programs, particularly malloc debuggers, may consume lots of them, e.g., up to one or two maps per allocation.

The default value is 65536."

When I cross reference this setting with other software such as elasticsearch, I see that the setting has to be higher than 262144 and nothing about an upper threshold.

However, I came across Actian Vector Configuring and Managing Vector which uses a formula:

where map_count should be around 1 per 128 KB of system memory. For example:

vm.max_map_count=2097152

on a 256 GB system.

How was the value for sonarqube determined?

Why won’t the size of my hardware host/VM allocated matter when setting up the prerequisite value?

Are there other considerations I should have for this value? For Example, why not a much higher value if my baseline specs are larger than 64 GB system memory?

Based on the Actian Vector Formula, the 524288 value was extrapolated from a 4 GB system?

If I use a 2 GB system then the value should be 262144 matching the minimum that elasticsearch for example uses?

Based on the 8.8 Pre-requisite Guide, under the Hardware requirements,

### Enterprise Hardware Recommendations

For large teams or Enterprise-scale installations of SonarQube, additional hardware is required. At the Enterprise level, [monitoring your SonarQube instance](https://docs.sonarqube.org/8.8/instance-administration/monitoring/) is essential and should guide further hardware upgrades as your instance grows. A starting configuration should include at least:

* 8 cores, to allow the main SonarQube platform to run with multiple Compute Engine workers
* 16GB of RAM For additional requirements and recommendations relating to database and ElasticSearch, see [Hardware Recommendations](https://docs.sonarqube.org/8.8/requirements/hardware-recommendations/).

at 16 GB, I might be safe to set vm.max_map_count=2097152 ?

1024 x 16 x 128

Hi,

Welcome to the community!

First, 8.8 is past EOL. You should really be looking at either 8.9.1 LTS or at 9.0.1, which is the latest version.

To answer your question though, the numbers we enforce are the ones that were current when this ticket was implemented:

SONAR-11264 - Enforce ElasticSearch bootstrap checks in production (possibly leading to startup failure)

If you’d like to set higher-still values, you’re certainly welcome to do so.

 
:slightly_smiling_face:
Ann

Ms. Ann,

Oh My, that (EOL) introduces an even larger concern! Thank you so much.

So Elastic Search influences these changes overtime. I did see the importance of a minimum value due to those bootstrap checks.

I am currently going through the prerequisite guide history (8.0 to current) to see when the switch for vm.max_map occured and digging further from there.

I will look further on Elasticsearch’s changes. Thank you for that reference.

1 Like