Skip to content

Commit f7fc97d

Browse files
Merge pull request #298 from ByteInternet/documentation-horizontal-autoscaling
feat: add hor autoscale docs
2 parents e40d98a + 11e5c8b commit f7fc97d

10 files changed

+304
-18
lines changed

docs/best-practices/database/how-to-run-rabbitmq-on-hypernode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ You need to make some changes in Magento in order to use RabbitMQ. For example i
8484
),
8585
),
8686
```
87+
88+
Note: Hypernode provisions a non-default user called `hypernode-admin` but you are free to create new users.
349 KB
Loading
25.1 KB
Loading
199 KB
Loading
215 KB
Loading
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
---
2+
myst:
3+
html_meta:
4+
description: Learn how autoscaling dynamically adjusts server resources based
5+
on CPU usage metrics, allowing efficient workload management without manual
6+
intervention. Configure thresholds, durations, and understand the workflow for
7+
horizontal autoscaling without downtime on Hypernode.
8+
title: How does horizontal Autoscaling work? | Hypernode
9+
---
10+
11+
# How does horizontal Autoscaling work
12+
13+
This article explains how Horizontal autoscaling works, what the requirements are and how you can enable it.
14+
15+
## How does it work
16+
17+
With horizontal autoscaling, additional Hypernodes will be added automatically to your main Hypernode at peak times. The extra Hypernodes will be used as PHP fpm workers.
18+
Since there's no configuration or IP changes needed, Horizontal autoscaling has zero-downtime.
19+
20+
For Horizontal autoscaling you can configure some conditions. If the conditions are met from the configured settings in the Control Panel, Horizontal autoscaling will be triggered.
21+
You can configure the following conditions:
22+
23+
- **CPU Load Threshold:** CPU load that is continuously monitored by the autoscaling agent. The percentage value you see is the actual load divided by the number of CPUs you have. For example, if your actual load is 2, but you have 4 CPUs, your CPU load percentage is 50%. The default setting is 70%.
24+
- **Minimum Duration in Minutes:** Minimum amount of time the server is overloaded before autoscaling gets triggered. We monitor your CPU load every minute; autoscaling will be triggered once the CPU load condition is met for the minimum amount of time set in the Control Panel. The default setting is 15 minutes.
25+
26+
## Horizontal autoscaling process
27+
28+
### Upscaling
29+
30+
Once the configured conditions are met and autoscaling is triggered, we spin up extra Hypernode(s) which meets the extra calculated amount of resources you need.
31+
We create a snapshot of your main Hypernode and attach that snapshot to the extra provisioned Hypernodes.
32+
All the services, such as MySQL, Elasticsearch and Redis, keep running on your original Hypernode. We add the additional Hypernodes as PHP-fpm workers and will handle the incoming requests.
33+
The load of the different autoscaling nodes will be balanced from your original Hypernode.
34+
35+
If the Hypernodes remains overloaded post-autoscaling, the extra needed resources will be added to handle the traffic. The autoscaling trigger is determined based on these criteria.
36+
The greater of either:
37+
38+
- User-defined minimum duration for CPU threshold surpassing: Allows time to assess newly allocated resources' impact on CPU performance.
39+
- A cooldown period of 15 minutes: Ensures a minimum interval for reassessment when the user-defined duration is less than 15 minutes.
40+
41+
This approach selects the longer duration between user-defined settings or the fallback duration before initiating the next autoscaling event. It ensures adequate time for evaluating resource changes on CPU performance. Autoscaling is capped at the biggest plan available on each cloud provider.
42+
43+
### Downscaling
44+
45+
If the monitor agent notices that the used resources are below the configured thresholds, the downscale operation will begin. This will lead to removing the additional servers that are no longer needed.
46+
47+
Downscale will happen by detaching the autoscaling instances from the main Hypernode one by one.
48+
After a downscale operation has been completed, there will be a cooldown of 15 minutes to monitor the behaviour of the newly available resources before downscaling again.
49+
50+
If the amount of used resources is still below the configured threshold, another downscale operation will be triggered.
51+
52+
If there is need for extra resources instead, extra resources will be added again.
53+
54+
## Horizontal autoscaling requirements
55+
56+
Horizontal autoscaling is available on all the Falcon cloud plans (OpenStack).
57+
58+
Next to the provider, horizontal autoscaling does have a couple of additional requirements.
59+
60+
We will divide them between Hypernode-specific and Application-specific requirements
61+
62+
### Hypernode Specific Requirements
63+
64+
#### Operating system
65+
66+
- The operating system of the Hypernode should be Debian Bookworm. If you would like to upgrade the os of your Hypernode, feel free to contact our support team for help. https://www.hypernode.com/en/contact/
67+
68+
#### Make sure the Hypernode is a production plan
69+
70+
For now, we don't support horizontal autoscaling for development plans.
71+
72+
#### Enable and configure Varnish
73+
74+
To make use of Horizontal autoscaling, Varnish should be enabled and configured on the Hypernode.
75+
You can check if Varnish is enabled on your Hypernode by running
76+
77+
```console
78+
hypernode-systemctl settings varnish_enabled
79+
```
80+
81+
Example output if Varnish is enabled:
82+
83+
```console
84+
varnish_enabled is set to value True
85+
```
86+
87+
If Varnish is not enabled, you can [enable Varnish](../varnish/how-to-enable-varnish-on-hypernode.md) by following the documentation
88+
If varnish is enabled on your Hypernode, your Magento store should also be configured to make use of varnish.
89+
You can verify if the Varnish host is configured correctly by running the following command from the Magento root:
90+
91+
```console
92+
php bin/magento config:show system/full_page_cache/varnish/backend_host
93+
```
94+
95+
The output should show `varnish` as backend. If it is configured as something else (like `localhost` or `127.0.0.1`), you can update it by running which sets the backend host to `varnish` instead.
96+
97+
```console
98+
php bin/magento config:set system/full_page_cache/varnish/backend_host varnish
99+
```
100+
101+
Additionally make sure the IP range `10.0.0.0/24` is set to the `acl_purge` section in the Varnish VCL file. The `acl_purge` section should look something similar:loaded Varnish VCL.
102+
103+
```console
104+
acl purge {
105+
"localhost";
106+
"10.0.0.0/24";
107+
}
108+
```
109+
110+
#### Make sure to use MySQL 5.7 or higher
111+
112+
The configured MySQL version should be 5.7 or above. You can check the enabled MySQL version by running the following command.
113+
114+
```console
115+
hypernode-systemctl settings mysql_version
116+
```
117+
118+
Example output if MySQL version is 8.0:
119+
120+
```console
121+
mysql_version is set to value 8.0
122+
```
123+
124+
If your MySQL version is still set to 5.6, you can consider [upgrading](../mysql/how-to-use-mysql-on-hypernode.md) the MySQL version to a supported version for autoscaling.
125+
126+
After the version validation, please verify the MySQL host is set to `mysqlmaster`. You can verify this by running `cat app/etc/env.php | grep -i mysql | grep -i host` from the magento root.
127+
128+
You should see something similar to `'host' => 'mysqlmaster',`. If this is not the case please make sure the database connection host is set to `mysqlmaster` instead of `localhost` or `127.0.0.1` in the magento configuration file at `<magento_root>/app/etc/env.php`.
129+
130+
#### Disable supervisor services
131+
132+
Make sure supervisor is disabled and that there are no supervisor services configured.
133+
134+
#### Disable Podman services
135+
136+
Make sure podman is disabled and that there are no podman services running.
137+
138+
#### Configure hostnames correctly
139+
140+
The database, cache, session and queue of the application must be configured with correct hostnames instead of `localhost` or `127.0.0.1`. This way the services will be available across multiple hypernodes when the app is autoscaled.
141+
142+
Make sure the env variables (db, cache, session, queue) are not using localhost.
143+
144+
### Application Specific Requirements - Magento2
145+
146+
#### Supported CMS
147+
148+
Horizontal autoscaling is available for Magento 2.4.7 and higher.
149+
To make use of Horizontal autoscaling, there are a couple of other requirements the application should meet.
150+
151+
#### Enable and configure Redis Persistent
152+
153+
Redis persistent is another requirement before you can make use of Horizontal autoscaling.
154+
The persistent instance will be used to store the sessions so we can access the same sessions from the Horizontal autoscale Hypernodes.
155+
156+
You can check if Redis Persistent is enabled on your Hypernode by running
157+
158+
```console
159+
hypernode-systemctl settings redis_persistent_instance
160+
```
161+
162+
Example output if Redis Persistent is enabled:
163+
164+
```console
165+
redis_persistent_instance is set to value True
166+
```
167+
168+
If Redis Persistent instance is not enabled, you can enable the second Redis instance for sessions you run the command:
169+
170+
```console
171+
hypernode-systemctl settings redis_persistent_instance --value True
172+
```
173+
174+
Make sure Redis session is configured as [described](../../ecommerce-applications/magento-2/how-to-configure-redis-for-magento-2.md#configure-magento-2-to-use-redis-as-the-session-store) in our docs
175+
Please notice the Redis host in the setup documentation. The Redis host should be set to `redismaster` instead of `localhost` or `127.0.0.1`.
176+
177+
#### Make sure Elasticsearch/Opensearch is configured properly
178+
179+
Please make sure Elasticsearch or Opensearch host is set to `elasticsearchmaster` in the Magento2 configuration file at `<magento_root>/app/etc/env.php`
180+
More information about [Elasticsearch on Hypernode](../../hypernode-platform/tools/how-to-use-elasticsearch-on-hypernode.md)
181+
182+
#### Make sure RabbitMQ configured properly
183+
184+
Please make sure RabbitMQ host is set to `rabbitmqmaster` in the Magento2 configuration file at `<magento_root>/app/etc/env.php`
185+
More information about [RabbitMQ o Hypernode](../../best-practices/database/how-to-run-rabbitmq-on-hypernode.md)
186+
187+
There is a rabbitmq user provisioned by Hypernode called hypernode-admin as a non-default user. But you can also configure RabbitMQ with a new different user of your own.
188+
But please make sure to configure RabbitMQ without the default guest user.
189+
190+
#### Make sure Database storage is disabled & Remote storage is enabled and configured.
191+
192+
Please make sure to enable remote storage for your application and configure it correctly as only AWS-s3 remote storage drivers are supported.
193+
194+
Make sure that the `remote_storage` key is present in the Magento2 configuration file at `<magento_root>/app/etc/env.php` with the correct config.
195+
196+
More information about [S3 Remote Storage with Magento2](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/storage/remote-storage/remote-storage-aws-s3)
197+
198+
## Enabling Horizontal Autoscaling
199+
200+
For detailed steps on enabling horizontal Autoscaling, please refer to our documentation: [How to enable horizontal Autoscaling?](how-to-enable-horizontal-autoscaling.md)
201+
202+
## Horizontal Autoscaling Pricing
203+
204+
To know more about the pricing, you can visit our documentation: [Horizontal Autoscaling Pricing](pricing-for-horizontal-autoscaling).

docs/hypernode-platform/autoscaling/how-does-autoscaling-work.md renamed to docs/hypernode-platform/autoscaling/how-does-vertical-autoscaling-work.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ myst:
55
on CPU usage metrics, allowing efficient workload management without manual
66
intervention. Configure thresholds, durations, and understand the workflow for
77
seamless autoscaling on Hypernode.
8-
title: How does Autoscaling work? | Hypernode
8+
title: How does vertical Autoscaling work? | Hypernode
9+
redirect_from:
10+
- hypernode-platform/autoscaling/how-does-autoscaling-work
911
---
1012

11-
# How does Autoscaling work?
13+
# How does vertical Autoscaling work?
1214

1315
Vertical autoscaling is triggered once the conditions are met from the configured settings in the Control Panel. You can configure the following:
1416

@@ -41,6 +43,6 @@ Simply turn off the autoscaling feature in your control panel. This prevents sub
4143

4244
Regardless of the number of times your Hypernode was autoscaled, you will go back to your initial plan after 24 hours from your initial upgrade.
4345

44-
## Enabling Autoscaling
46+
## Enabling vertical Autoscaling
4547

46-
For detailed steps on enabling Autoscaling, please refer to our documentation: [How to enable Autoscaling?](how-to-enable-autoscaling.md)
48+
For detailed steps on enabling Autoscaling, please refer to our documentation: [How to enable vertical Autoscaling?](how-to-enable-vertical-autoscaling.md)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
myst:
3+
html_meta:
4+
description: Step-by-step instructions on enabling horizontal Autoscaling through
5+
the Control Panel
6+
title: How to enable horizontal Autoscaling? | Hypernode
7+
---
8+
9+
# How to Enable horizontal Autoscaling?
10+
11+
## What is horizontal Autoscaling?
12+
13+
Horizontal autoscaling means increasing the amount of resources when your Hypernode needs it, so you don’t need to worry about constant monitoring.
14+
15+
The amount of extra resources your Hypernode will upgrade with, is calculated by our agent based on the requirements.
16+
17+
The upgrade is effective as long the extra resources are needed and being used. For more technical overview you can check our docs [How Horizontal Autoscaling Works](how-does-horizontal-autoscaling-work.md).
18+
19+
## Autoscaling in the Control Panel
20+
21+
1. Choose the Hypernode you want to enable autoscaling for and then click on the autoscaling option from the vertical navbar. <br>
22+
![Autoscaling option in the navbar](_res/autoscaling-navbar.png)
23+
1. If you already enabled vertical autoscaling, you will have to disable it in order to enable horizontal autoscaling for that Hypernode. This is because we only support one type of autoscaling for a Hypernode at a given time.
24+
1. If you do not have vertical or horizontal autoscaling enabled, you will see the following two choices with an option to help you choose. If you are still confused about which type of autoscaling you would like for your Hypernode please click on "Help me choose". And if the additional information is not enough, feel free to [contact support](https://www.hypernode.com/en/contact/) for more info.
25+
![Choose autoscaling options](./_res/autoscaling-options.png)
26+
1. If you have decided to enable horizontal autoscaling, you can move ahead with the below steps.
27+
28+
## Enabling Horizontal autoscaling from the Control Panel
29+
30+
1. Click Configure on the Horizontal autoscaling option.
31+
1. You will see the price of the autoscaling license. If you wish to continue, click configure. This charge is automatically added as part of your subscription when you enable autoscaling ( at a futher step ).
32+
1. Toggle Horizontal autoscaling. This will enable the form to choose the thresholds and the applications you would like to autoscale with. You can choose the certain conditions when autoscaling should be initiated. By default we recommend when the load on the server is higher than 70 for more than 15 minutes
33+
Note: You can also choose the specific time window in which autoscaling should be initiated, if you prefer not to autoscale 24/7. ( E.g. if you have a cron running at 4am that will increase the load on the server but you dont want that to trigger autoscaling, you can choose the autoscaling window to be 5AM-3AM. This will avoid autoscaling between 3AM-5AM)
34+
![Autoscaling toggled](_res/autoscaling-toggled.png)
35+
1. Now click on applications to check if your Hypernode and all the applications on that Hypernode are eligibile for horizontal autoscaling. We have a list of requirements that your Hypernode and it's applications must meet for you to be able to enable horizontal autoscaling. You can see the list [here](https://www.hypernode.com/).
36+
![Autoscaling eligibility checks](_res/autoscaling-eligchecks.png)
37+
1. If an application is not supported, you can either unselect that application so that its not a part of horizontal autoscaling. Or you can update your application as required to make it eligible and re-run the checks.
38+
1. After you have decided the thresholds and choosen the eligible applications, you can now click save changes at the top right corner. This will enable horizontal autoscaling, charge you for the autoscaling license and now your Hypernode will be monitored 24/7 against the conditions you have set.
39+
1. You can always come back to this page to change the conditions and add/remove applications.
40+
1. You can always disable autoscaling by toggling off and clicking save changes after which your license will be removed. And if you wish to come back and enable it, you can follow the same steps above.

docs/hypernode-platform/autoscaling/how-to-enable-autoscaling.md renamed to docs/hypernode-platform/autoscaling/how-to-enable-vertical-autoscaling.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
---
22
myst:
33
html_meta:
4-
description: Step-by-step instructions on enabling Autoscaling through the Control
5-
Panel or command line
6-
title: How to enable Autoscaling? | Hypernode
4+
description: Step-by-step instructions on enabling vertical Autoscaling through
5+
the Control Panel or command line
6+
title: How to enable vertical Autoscaling? | Hypernode
7+
redirect_from:
8+
- hypernode-platform/autoscaling/how-to-enable-autoscaling
79
---
810

9-
# How to Enable Autoscaling?
11+
# How to Enable vertical Autoscaling?
1012

11-
## What is Autoscaling?
13+
## What is vertical Autoscaling?
1214

1315
Vertical autoscaling in other words means upgrading your plan automatically when your server needs it, so you don’t need to worry about constant monitoring.
1416

15-
Your plan will be upgraded to the next possible plan within the same provider, increasing your resources while keeping the disk size the same. The upgrade is effective for 24h, after which your Hypernode will return to your regular plan. For more technical overview you can check our docs [How Autoscaling Works](how-does-autoscaling-work.md).
17+
Your plan will be upgraded to the next possible plan within the same provider, increasing your resources while keeping the disk size the same. The upgrade is effective for 24h, after which your Hypernode will return to your regular plan. For more technical overview you can check our docs [How Autoscaling Works](how-does-vertical-autoscaling-work.md).
1618

17-
## How to enable Autoscaling?
19+
## How to enable vertical Autoscaling?
1820

1921
You can enable Autoscaling two ways: in the Control Panel or directly via command line.
2022

21-
### How to enable Autoscaling in the Control Panel?
23+
### How to enable vertical Autoscaling in the Control Panel?
2224

2325
You can start using autoscaling by:
2426

@@ -32,7 +34,7 @@ After enabling Autoscaling feature, expect a 5min grace period before Autoscalin
3234

3335
Now, rest easy knowing that your server will automatically handle overloads.
3436

35-
## How to enable Autoscaling via command line?
37+
## How to enable vertical Autoscaling via command line?
3638

3739
To allow using autoscaling via the command line, follow the steps below:
3840

@@ -41,12 +43,15 @@ To allow using autoscaling via the command line, follow the steps below:
4143

4244
**Please note:** when enabled, **everyone who has SSH access can enable and configure autoscaling from the CLI**, even if they are not the Owner or Admin.
4345

44-
### Enable autoscaling via the CLI
46+
### Enable vertical autoscaling via the CLI
4547

4648
To enable autoscaling via the CLI, you can run the following command:
47-
`hypernode-systemctl autoscaling --enable`
4849

49-
### Manage autoscaling tresholds via the CLI
50+
```console
51+
hypernode-systemctl autoscaling --enable
52+
```
53+
54+
### Manage vertical autoscaling tresholds via the CLI
5055

5156
If you have enabled autoscaling, you can configure the thresholds when it is being autoscaled.
5257
This tresholds does have a default value:
@@ -56,12 +61,12 @@ This tresholds does have a default value:
5661

5762
If you want to change the default settings, you can use the commands below:
5863

59-
```
64+
```console
6065
hypernode-systemctl settings autoscale_trigger_load_percentage 80
6166
hypernode-systemctl settings autoscale_trigger_load_avg_minutes 50
6267
```
6368

64-
### Disable autoscaling via the CLI
69+
### Disable vertical autoscaling via the CLI
6570

6671
If you want to disable autoscaling via the CLI, you can run `hypernode-systemctl autoscaling --disable`.
6772

0 commit comments

Comments
 (0)