Mongo-memory-profile and production controllers

Hi all,

The default bootstrap experience is designed to give a good experience to people testing out Juju and trying to see if it is something they want to use.

This default experience sets the cache size that the mongo storage engine uses to be 250MB. The behaviour of mongo without this restriction is to use half of the ram less 1GB. Clearly a production controller would want to store more of the information in cache.

When bootstrapping a new production controller, the following args should be used

--config mongo-memory-profile=default

However as of Juju 2.5.1 and earlier, this value is read only after bootstrapping. This causes some issues as a controller may take on more and more load. This should be changeable after bootstrapping.

When a machine becomes a controller, some controller specific configuration is written to the machine’s agent.conf file.

An agent started without the mongo-memory-profile set will have the following at the end of the agent’s file:

mongomemoryprofile: low

Change this to:

mongomemoryprofile: default

and restart the machine agent. This will cause the mongo systemd service file to be rewritten.

NOTE: found that even when bootstrapped with mongo-memory-profile=default, the first machine honours this, but if you enable-ha, they don’t, see bug.

NOTE: specifying “default” for a non-default value is very confusing, created a bug for this too.