Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add hor autoscale docs #298

Merged
merged 36 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
68e543b
feat: add hor autoscale docs
martijneichelsheim Dec 17, 2024
daf071d
add Redirect_from
martijneichelsheim Dec 17, 2024
2ff5dc7
Mdformat
martijneichelsheim Dec 17, 2024
f8d23fa
Mdformat
martijneichelsheim Dec 18, 2024
bc444fa
Some typo fixing, paraphrasing, etc in the doc
hrithikkothari1234 Dec 18, 2024
9695037
Merge remote-tracking branch 'origin/documentation-horizontal-autosca…
hrithikkothari1234 Dec 18, 2024
aabc223
run mdformat fix
hrithikkothari1234 Dec 18, 2024
511a135
Merge pull request #300 from ByteInternet/tiny-fixes-typos-paraphrasing
hrithikkothari1234 Dec 18, 2024
cba1c6a
Merge branch 'master' into documentation-horizontal-autoscaling
hrithikkothari1234 Dec 18, 2024
0add07e
Split checks into hypernode and application specific
hrithikkothari1234 Dec 20, 2024
ca50eaf
Update docs/hypernode-platform/autoscaling/how-does-horizontal-autosc…
hrithikkothari1234 Dec 20, 2024
6a719b4
Update docs/hypernode-platform/autoscaling/how-does-horizontal-autosc…
hrithikkothari1234 Dec 20, 2024
43ea4a5
Update docs/hypernode-platform/autoscaling/how-does-horizontal-autosc…
hrithikkothari1234 Dec 20, 2024
4cccc87
Update docs/hypernode-platform/autoscaling/how-does-horizontal-autosc…
hrithikkothari1234 Dec 20, 2024
beddeb2
add remote storage link and mention non-default rabbitmq user
hrithikkothari1234 Dec 20, 2024
60a1860
point customer to support and move redis to application specific
hrithikkothari1234 Dec 30, 2024
ccdacc7
Merge branch 'master' into documentation-horizontal-autoscaling
hrithikkothari1234 Dec 30, 2024
05d1d27
Merge remote-tracking branch 'origin/documentation-horizontal-autosca…
hrithikkothari1234 Dec 30, 2024
42e2a59
Merge pull request #302 from ByteInternet/split-elig-checks
hrithikkothari1234 Dec 30, 2024
95665ab
Add doc for enabling horizontal autoscaling from cp
hrithikkothari1234 Dec 31, 2024
2de8cbc
run mdformat
hrithikkothari1234 Dec 31, 2024
1b3bcb3
fix image and review comments
hrithikkothari1234 Jan 2, 2025
f25106e
change text a bit
hrithikkothari1234 Jan 2, 2025
4c7cdcf
Merge pull request #304 from ByteInternet/enable-horizintal-autoscali…
hrithikkothari1234 Jan 2, 2025
64582a5
Merge branch 'master' into documentation-horizontal-autoscaling
hrithikkothari1234 Jan 2, 2025
e363e5c
fix: img tag doesnt work
hrithikkothari1234 Jan 2, 2025
635f341
fix the numbering in the doc
hrithikkothari1234 Jan 2, 2025
894e94c
Add podman and supervisor to hypernode specific requirements doc
hrithikkothari1234 Jan 3, 2025
2fefb86
change title and move descr
hrithikkothari1234 Jan 3, 2025
8ee7d12
add dot
hrithikkothari1234 Jan 3, 2025
ca8a01e
Merge pull request #311 from ByteInternet/additional-doc-requirements…
hrithikkothari1234 Jan 3, 2025
3cb1fd5
add hostnames part to the doc application check
hrithikkothari1234 Jan 3, 2025
e0a1fd7
Merge branch 'additional-doc-requirements-hypernodespecific' into doc…
hrithikkothari1234 Jan 3, 2025
68a06ec
Horizontal autoscaling pricing doc
hrithikkothari1234 Jan 6, 2025
6c1e851
Merge pull request #315 from ByteInternet/hz-as-pricing
hrithikkothari1234 Jan 6, 2025
11e5c8b
Merge branch 'master' into documentation-horizontal-autoscaling
hrithikkothari1234 Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ You need to make some changes in Magento in order to use RabbitMQ. For example i
),
),
```

Note: Hypernode provisions a non-default user called `hypernode-admin` but you are free to create new users.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---
myst:
html_meta:
description: Learn how autoscaling dynamically adjusts server resources based
on CPU usage metrics, allowing efficient workload management without manual
intervention. Configure thresholds, durations, and understand the workflow for
horizontal autoscaling without downtime on Hypernode.
title: How does horizontal Autoscaling work? | Hypernode
---

# How does horizontal Autoscaling work

This article explains how Horizontal autoscaling works, what the requirements are and how you can enable it.

## How does it work

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.
Since there's no configuration or IP changes needed, Horizontal autoscaling has zero-downtime.

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.
You can configure the following conditions:

- **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%.
- **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.

## Horizontal autoscaling process

### Upscaling

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.
We create a snapshot of your main Hypernode and attach that snapshot to the extra provisioned Hypernodes.
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.
The load of the different autoscaling nodes will be balanced from your original Hypernode.

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.
The greater of either:

- User-defined minimum duration for CPU threshold surpassing: Allows time to assess newly allocated resources' impact on CPU performance.
- A cooldown period of 15 minutes: Ensures a minimum interval for reassessment when the user-defined duration is less than 15 minutes.

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.

### Downscaling

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.

Downscale will happen by detaching the autoscaling instances from the main Hypernode one by one.
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.

If the amount of used resources is still below the configured threshold, another downscale operation will be triggered.

If there is need for extra resources instead, extra resources will be added again.

## Horizontal autoscaling requirements

Horizontal autoscaling is available on all the Falcon cloud plans (OpenStack).

Next to the provider, horizontal autoscaling does have a couple of additional requirements.

We will divide them between Hypernode-specific and Application-specific requirements

### Hypernode Specific Requirements

#### Operating system

- 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/

#### Make sure the Hypernode is a production plan

For now, we don't support horizontal autoscaling for development plans.

#### Enable and configure Varnish

To make use of Horizontal autoscaling, Varnish should be enabled and configured on the Hypernode.
You can check if Varnish is enabled on your Hypernode by running

```console
hypernode-systemctl settings varnish_enabled
```

Example output if Varnish is enabled:

```console
varnish_enabled is set to value True
```

If Varnish is not enabled, you can [enable Varnish](../varnish/how-to-enable-varnish-on-hypernode.md) by following the documentation
If varnish is enabled on your Hypernode, your Magento store should also be configured to make use of varnish.
You can verify if the Varnish host is configured correctly by running the following command from the Magento root:

```console
php bin/magento config:show system/full_page_cache/varnish/backend_host
```

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.

```console
php bin/magento config:set system/full_page_cache/varnish/backend_host varnish
```

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we say the location of the file here?

etc/varnish/default.vcl etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't really know where the VCL file is, that's up to the user - they should know where it's located. Once you load a VCL into varnish, varnish doesn't know where the VCL came from. We do backup the VCL to /data/var/varnish/default.vcl so it loads in the same VCL when you restart varnish.

app@abcdef-example-magweb-cmbl:~$ ll /data/var/varnish/default.vcl
-rw-r--r-- 1 root root 8.3K Jan 10 11:50 /data/var/varnish/default.vcl
app@abcdef-example-magweb-cmbl:~$ ll /etc/varnish/default.vcl
lrwxrwxrwx 1 root root 29 Jan  7 07:25 /etc/varnish/default.vcl -> /data/var/varnish/default.vcl


```console

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to include the following in vcl_recv for handling PURGE requests?

sub vcl_recv {
if (req.method == "PURGE") {
if (!client.ip ~ purge) {
return (synth(405, "Not allowed."));
}
return (purge);
}
}

Curious if this is required ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that's completely up to the users

acl purge {
"localhost";
"10.0.0.0/24";
}
```

#### Make sure to use MySQL 5.7 or higher

The configured MySQL version should be 5.7 or above. You can check the enabled MySQL version by running the following command.

```console
hypernode-systemctl settings mysql_version
```

Example output if MySQL version is 8.0:

```console
mysql_version is set to value 8.0
```

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.

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.

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`.

#### Disable supervisor services

Make sure supervisor is disabled and that there are no supervisor services configured.

#### Disable Podman services

Make sure podman is disabled and that there are no podman services running.

#### Configure hostnames correctly

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.

Make sure the env variables (db, cache, session, queue) are not using localhost.

### Application Specific Requirements - Magento2

#### Supported CMS

Horizontal autoscaling is available for Magento 2.4.7 and higher.
To make use of Horizontal autoscaling, there are a couple of other requirements the application should meet.

#### Enable and configure Redis Persistent

Redis persistent is another requirement before you can make use of Horizontal autoscaling.
The persistent instance will be used to store the sessions so we can access the same sessions from the Horizontal autoscale Hypernodes.

You can check if Redis Persistent is enabled on your Hypernode by running

```console
hypernode-systemctl settings redis_persistent_instance
```

Example output if Redis Persistent is enabled:

```console
redis_persistent_instance is set to value True
```

If Redis Persistent instance is not enabled, you can enable the second Redis instance for sessions you run the command:

```console
hypernode-systemctl settings redis_persistent_instance --value True
```

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
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`.

#### Make sure Elasticsearch/Opensearch is configured properly

Please make sure Elasticsearch or Opensearch host is set to `elasticsearchmaster` in the Magento2 configuration file at `<magento_root>/app/etc/env.php`
More information about [Elasticsearch on Hypernode](../../hypernode-platform/tools/how-to-use-elasticsearch-on-hypernode.md)

#### Make sure RabbitMQ configured properly

Please make sure RabbitMQ host is set to `rabbitmqmaster` in the Magento2 configuration file at `<magento_root>/app/etc/env.php`
More information about [RabbitMQ o Hypernode](../../best-practices/database/how-to-run-rabbitmq-on-hypernode.md)

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.
But please make sure to configure RabbitMQ without the default guest user.

#### Make sure Database storage is disabled & Remote storage is enabled and configured.

Please make sure to enable remote storage for your application and configure it correctly as only AWS-s3 remote storage drivers are supported.

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.

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)

## Enabling Horizontal Autoscaling

For detailed steps on enabling horizontal Autoscaling, please refer to our documentation: [How to enable horizontal Autoscaling?](how-to-enable-horizontal-autoscaling.md)

## Horizontal Autoscaling Pricing

To know more about the pricing, you can visit our documentation: [Horizontal Autoscaling Pricing](pricing-for-horizontal-autoscaling).
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ myst:
on CPU usage metrics, allowing efficient workload management without manual
intervention. Configure thresholds, durations, and understand the workflow for
seamless autoscaling on Hypernode.
title: How does Autoscaling work? | Hypernode
title: How does vertical Autoscaling work? | Hypernode
redirect_from:
- hypernode-platform/autoscaling/how-does-autoscaling-work
---

# How does Autoscaling work?
# How does vertical Autoscaling work?

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

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

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.

## Enabling Autoscaling
## Enabling vertical Autoscaling

For detailed steps on enabling Autoscaling, please refer to our documentation: [How to enable Autoscaling?](how-to-enable-autoscaling.md)
For detailed steps on enabling Autoscaling, please refer to our documentation: [How to enable vertical Autoscaling?](how-to-enable-vertical-autoscaling.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
myst:
html_meta:
description: Step-by-step instructions on enabling horizontal Autoscaling through
the Control Panel
title: How to enable horizontal Autoscaling? | Hypernode
---

# How to Enable horizontal Autoscaling?

## What is horizontal Autoscaling?

Horizontal autoscaling means increasing the amount of resources when your Hypernode needs it, so you don’t need to worry about constant monitoring.

The amount of extra resources your Hypernode will upgrade with, is calculated by our agent based on the requirements.

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).
hrithikkothari1234 marked this conversation as resolved.
Show resolved Hide resolved

## Autoscaling in the Control Panel

1. Choose the Hypernode you want to enable autoscaling for and then click on the autoscaling option from the vertical navbar. <br>
![Autoscaling option in the navbar](_res/autoscaling-navbar.png)
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.
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.
![Choose autoscaling options](./_res/autoscaling-options.png)
1. If you have decided to enable horizontal autoscaling, you can move ahead with the below steps.

## Enabling Horizontal autoscaling from the Control Panel

1. Click Configure on the Horizontal autoscaling option.
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 ).
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
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)
![Autoscaling toggled](_res/autoscaling-toggled.png)
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/).
![Autoscaling eligibility checks](_res/autoscaling-eligchecks.png)
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.
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.
1. You can always come back to this page to change the conditions and add/remove applications.
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.
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
---
myst:
html_meta:
description: Step-by-step instructions on enabling Autoscaling through the Control
Panel or command line
title: How to enable Autoscaling? | Hypernode
description: Step-by-step instructions on enabling vertical Autoscaling through
the Control Panel or command line
title: How to enable vertical Autoscaling? | Hypernode
redirect_from:
- hypernode-platform/autoscaling/how-to-enable-autoscaling
---

# How to Enable Autoscaling?
# How to Enable vertical Autoscaling?

## What is Autoscaling?
## What is vertical Autoscaling?

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.

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).
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).

## How to enable Autoscaling?
## How to enable vertical Autoscaling?

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

### How to enable Autoscaling in the Control Panel?
### How to enable vertical Autoscaling in the Control Panel?

You can start using autoscaling by:

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

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

## How to enable Autoscaling via command line?
## How to enable vertical Autoscaling via command line?

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

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

**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.

### Enable autoscaling via the CLI
### Enable vertical autoscaling via the CLI

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

### Manage autoscaling tresholds via the CLI
```console
hypernode-systemctl autoscaling --enable
```

### Manage vertical autoscaling tresholds via the CLI

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

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

```
```console
hypernode-systemctl settings autoscale_trigger_load_percentage 80
hypernode-systemctl settings autoscale_trigger_load_avg_minutes 50
```

### Disable autoscaling via the CLI
### Disable vertical autoscaling via the CLI

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

Expand Down
Loading
Loading