1 Introduction
Licensed apps in the Mendix Cloud can be scaled in various ways.
Memory can be added to the application container. This is called vertical scaling.
Apps can be run in multiple runtime containers (instances) simultaneously. Incoming traffic for your app is distributed over the running instances. Scheduled events will always be run on the first instance. This is called horizontal scaling.
The scaling options on possible cloud versions are the following:
Cloud Version | Scaling Options | Limitations |
---|---|---|
Mendix Cloud v3 | Vertical scaling | This needs to be done by raising a support ticket with Mendix Support |
Mendix Cloud v4 | Vertical and horizontal scaling | Horizontal scaling is only available for apps written in Mendix version 7.0 and above Scheduled events always run on the first instance |
This how-to will teach you how to do the following:
- Scale your environment in Mendix Cloud v4
2 Prerequisites
Before starting this how-to, make sure you have completed the following prerequisites:
- Have a licensed app hosted in Mendix Cloud v4
- The Mendix version of the app is Mendix 7.0 or above
- Have a plan which provides more than 1GiB of memory
You can find the cloud version on which your app is hosted in the environment details: see Cloud Version and Region in the Mendix Cloud.
Details of your plan are also displayed on the environment details page.
3 Scaling Your Environment
If you want to scale your licensed app in Mendix Cloud v4, follow these steps:
Go to the Developer Portal and select your licensed app.
Click Environments to go to the environments page.
Click Details for a selected environment.
Click Change scaling next to the current description of Instances.
Set the number of Instances by dragging the indicator bar.
Set the Memory per instance that you want to use.
You cannot exceed the total memory provided by your plan. This is shown as the lower number in Total Allocated Memory.
If you try to use scaling values which exceed the memory provided by your plan you will get the message You do not have sufficient resources to configure this allocation
.
4 Examples
The following examples assume that you have 16GiB memory available to you in your plan.
4.1 Scaling Example 1
You can spread the 16GiB RAM across 4 instances. Create 4 instances, each with 4GiB memory (4 x 4GiB = 16GiB).
4.2 Scaling Example 2
You don’t need to allocate all the plan memory at once. You can just allocate part of it and then use the rest of the memory later by allocating more memory per instance, or creating more instances.
For example, you can use one instance with 4GiB RAM. The remaining 12GiB in your plan will be unused.