How to optimise your model
When to optimise your model
As a general guide, you would usually consider optimising your model when you are hitting consistent memory usage of greater than 90%. This is especially important if your memory usage will likely only increase, as users update budgets, or overnight loads occur bringing in additional datapoints from external databases and systems.

This can be found by opening your model logs on go.modlr.co, and accessing your model metrics.
If you are seeing real world impact, it's time to consider optimising your model, regardless of the exact memory usage percentage reported.
Knowing which cubes are worth optimising
Not every cube is worth your time. You might have a cube with inefficient formulas, but if it only contains 1,000 cells out of a total model size of 100,000,000 cells, optimising it will not achieve much.
To make an impact, you need to find your largest cubes in terms of cell count.

- Open Sandbox
- Run the task
cube.statisticsunder service/model.service
What does it mean to optimise your model
When we talk about optimising your model, the most common way to do this is to reduce your model's cell count. Each cube has an amount of fed cells, and to reduce this usually involves one of the below:
- Restricting formulas
- Turning off unnecessary feeders
- Removing unused old data
Restricting formulas
Ensure formulas are restricted appropriately. For example, if a formula should only apply to a single scenario, and it is not restricted, it should be restricted to that scenario.
Step by step guide on how to restrict a formula.
Turning off unnecessary feeders
Feeders are one of the simplest fixes, yet one of the most impactful causes of cell count balloon.
For more details on turning off feeders, please review the documentation on Turning off a feeder.
Removing unused or old data
Too much old data that is unused adds unnecessary size and cell count to your model. Consider:
- Is there data from years ago that is no longer required in MODLR memory? Should it be stored in the MODLR data warehouse, or wiped entirely?
- Are there old scenarios that have never been used?
These are all considerations worth asking when reviewing your model.
Step by step guide on how to remove data from a cube.
TIP
MODLR will retain the cell location in memory until the server has been restart. Please ensure you restart your server to see the impact of your optimisations. :::