Caching
In this article:
Caching#
General information#
Caching is a set of K2 Cloud automated services that allows you to quickly deploy and configure popular data caching systems using cloud platform tools. We currently support Memcached and Redis caching systems.
Memcached is a high-performance and scalable open-source system for caching objects in memory. It allows you to store key–value data in a distributed hash table and retrieve it in less than a millisecond. To learn more, visit the official website.
Redis is an open-source resident system for caching data and managing databases. It handles key-value data structures and can be used as a database, cache, message broker, or queue. To learn more about Redis capabilities, visit the official website.
Before you begin#
To be able to work with the cashing service, a user needs to have PaaSServicePolicy project grants. For instance, such grants are available to administrators in CloudAdministrators group. If necessary, you can create a separate user, add the user to the project, and either attach the PaaSServicePolicy policy to the user or add the user to the group of cloud administrators in this project.
In addition, the project should have the following resources:
We also advise to read the recommendations on how to work with the service in the cloud.
Launching the caching service#
To launch the service, go to the Service store or Running services subsection, select the caching service in the Caching tab and click Create.
The caching service launch procedure comprises the following stages:
Note
The text below refers to the Memcached-based caching service. Redis, whether a caching service or database, uses the same launch procedure. Its detailed description is available in the section on creating a database service.
Set the required network parameters for a caching service:
The configuration of the cluster in which the service will be deployed. Only a single node configuration is available for the Memcached service.
VPC where the service will be deployed.
Security groups to control traffic through the interface of the instance on which the Memcached service will run.
Subnet where the service will be deployed.
Click Next to proceed to the next step.
Set the configuration of an instance where the caching service will run.
Select the instance type and parameters of its volumes: type, size and IOPS (if available for a type).
Note
The caching service performance depends on the node components. We recommend using the Memory Optimized instance type.
In addition, you can also specify an SSH key. In this case, after automatic service setup, you will get an SSH access to the respective instances.
Attention
You can connect to instances using an SSH key while the new caching service is in a beta testing stage. This feature may be disabled in the future.
Click Next to proceed to the next step.
Set main parameters for the caching service :
Name tag — Optional arbitrary description of the service.
Service name – An arbitrary unique name for the service.
Enable monitoring – For centralized monitoring of a caching service, first deploy the Prometheus-based monitoring service.
Monitoring service – The selection of a monitoring service is only available when the Enable monitoring checkbox is checked.
Monitoring labels — Optionally, you can set monitoring labels, which the installed monitoring agents will assign to the collected metrics (for details, see Using labels). Labels can only be set when the Enable monitoring checkbox is selected.
Enable logging – For centralized PaaS service logging, first create a logging service. Once a PaaS service is created, you will be able to install logging agents manually only.
Logging service – The selection of a service is only available when the Enable logging checkbox is checked.
Logging tags – Tags are assigned to logs when the latter are imported by the logging service. They simplify search for the required logs. Tags can only be set when the Enable logging checkbox is selected.
To set tags for the service, click Add tags to go to the next step. If no tags are required, click Create to launch the service.
To add a tag, click Add tag and enter tag key and value.
Note
If no tags have been set yet, you can add the Name tag by clicking Add Name tag and specifying its value.
When done, click Create to launch the service.
Important
The service launching process usually takes 5 to 15 minutes.
Changing parameters of a data volume#
Important
This feature is only available for a Redis service.
You can only change the data volume parameters when the service is in the Ready state.
You can configure the data volume size and its performance in IOPS right from the cloud web interface.
Important
You can change IOPS only for a data volume of the type io2.
To change the volume parameters, follow these steps:
Go to PaaS Running services and open the Caching tab.
Find the desired service in the table and click the service ID to go to its page.
In the Information tab, edit the required fields (Data volume size and/or Data volume IOPS) by clicking the edit icon.
Important
The new data volume size must exceed the current one.
Save the changes.
Caching service configuration#
If you have not enabled monitoring or logging when creating the caching service, or you want to disable them, you can do it when the service is in the Ready state.
Note
To enable monitoring and logging, first deploy Prometheus-based monitoring service and ELK-based logging service.
Important
If an attempt to modify some settings fails, then the service will be reset to default ones.
To set up the caching service:
Go to PaaS Running services and open the Caching tab.
Find the desired service in the table and click the service ID to go to its page.
Open the Parameters tab and click Modify.
In the window that opens, you can configure monitoring and logging (or disable them if they are already enabled).
To save new settings, click Modify.
Assigning tags#
Important
Tags are only supported for PaaS services with an fm-cluster-xxxxxxxxxxx
ID. If you want to add tag support for the installed services with a UUID as an ID, please contact K2 Cloud support.
Tags allow you to classify PaaS services by various attributes, such as purpose, owner, etc. Their usage simplifies the management of many similar resources.
To add, modify or delete tag for the caching service:
Go to PaaS Running services and open the Caching tab.
In the resource table, find the service for which you want to assign tags, and click on its ID to go to the service page.
Open the Tags tab.
To add a tag, click Add tag and specify the Key and Value fields.
To modify a tag, edit the required fields (Value and/or Key) of the respective tag.
To delete a tag, click the icon next to the tag you no longer need.
Note
If no tags have been set earlier, you can add the Name tag by clicking Add Name tag.
Click Apply to save the changes.
Environment upgrade#
PaaS services are updated regularly. If you want the already deployed caching service to support new features, then update its environment. For the current environment version, see the Information tab on the service page.
Note
All services with environment version 3_6 and higher support environment update. It is also available for some previously deployed services with environment version 3_5. To check if you can update them, use the API method DescribeService: the response should contain the common:update_environment
value in the SupportedFeatures list.
Important
If an attempt to update the environment fails, the service will be reset to the default one.
To update the environment version:
Go to PaaS Running services and open the Caching tab.
Find the desired service in the table and click the service ID to go to its page.
In the Information tab, click Update environment version.
In the window that opens, select the version from the list, to which you want to upgrade the current environment.
Click Update to change the version.
Deleting a caching service#
Deleting the caching service deletes all instances and volumes created with it.
You can delete the service using one of the following methods.
Go to the section PaaS Running services.
Open the Caching tab.
Find the service in the table and click on the icon .
Go to the section PaaS Running services.
Open the Caching tab.
Find the service in the table and go to the service page.
Click :Delete in the Information tab.