Redis for VMware Tanzu Application Service offers on-demand and shared-VM service plans. This topic tells you about the architecture, lifecycle, and configurations of the shared-VM plan.
For similar information for the on-demand service plan, see On-Demand Service Offering.
The shared-VM plan is a pre-provisioned service plan for development and testing purposes only. An instance of this plan provisions a single Redis process on a single shared VM. This plan is suitable for workloads that do not require dedicated hardware. This plan is not suitable for production purposes.
The p-redis service broker manages the shared-vm plan service instances.
The following diagram shows the architecture of the service broker and shared-VM plans and how the user’s app binds to a Redis instance.
The previous diagram shows the p-redis service broker pointing to a shared-VM plan instance, which was created by running cf create-service
. For more information about this command, see Create a Service Instance in Using Redis for VMware Tanzu Application Service.
The service broker VM contains the shared-VM plan instances. Six shared-VM plan instances are shown. These are provisioned when created by the app developer. The maximum number is specified by the operator.
Each shared instance has its own Redis server, with credentials stored in the VCAP_SERVICES
environment variable.
The user’s app is bound to a shared-VM plan instance, shown above by an arrow labeled binding pointing from the app to a shared-VM plan instance. For information about binding, see Bind a Service Instance to your App in Using Redis for VMware Tanzu Application Service.
You cannot change the default Redis settings for shared-VM plans. Because of this, you cannot run cf update-service
with the -c
flag to set config parameters, as described in the Cloud Foundry documentation.
The default Redis settings are as follows:
Redis is configured with a maxmemory-policy
of no-eviction
. This policy means that when the memory is full, the service does not evict any keys or perform any write operations until memory becomes available.
Shared-VM Redis supports both Redis Database Backup (RDB) and Append-Only File (AOF) persistence options. Redis writes to the AOF log every second. For more information, see Redis Persistence in the Redis documentation.
The maximum number of connections, maxclients
, is set at 10,000 by default. Redis might reduce this number when run on a system with a low maximum number of file descriptors. You can retrieve the actual setting on your Redis service instances with the Redis command CONFIG GET maxclients
.
You can run the Redis command CONFIG SET maxclients NUMBER
in your service instance to reduce maxclients
until the next BOSH action occurs. For example:
$ CONFIG SET maxclients 9000You cannot set `maxclients` above 10,000 and you cannot configure shared plans to permanently use a custom limit.
The replication and event notifications are not configured.
This plan deploys a Redis instance on a shared VM and a single service broker VM. To prevent this, set the Max instances limit on the Shared-VM Plan tab in Tanzu Operations Manager to 0
.
You can increase the maximum number of service instances that can run on a shared VM from the default five to 250. There is a hard maximum of 250 shared instances.
If you increase the number of instances that can be run on a VM, consider increasing the resources allocated to the VM, especially RAM and CPU. Failure to do so might lead to a degradation of performance.
You can also increase the maximum amount of RAM allocated to each service instance that is running on this VM.
If you decrease the service instance limit, any instances that are now running beyond the limit are not automatically terminated. You cannot create any new instances until the total falls below the new limit.
For example, if you use 10 service instances, and you then reduce the limit to 8, the two instances outside the limit continue to run until you terminate them.
The number of shared-VM instances available to developers is set by the operator.
The maximum number of shared-VM instances is relative to the memory allocated to each shared-VM instance and the total memory of the Redis service broker.
For more information, see Configure Shared-VM Plan settings.
You can activate or deactivate Lua scripting. Changes to this configuration apply to all existing shared-VM instances. Lua scripting can adversely affect the performance of other service instances on the VM, so VMware recommends deactivating Lua scripting unless developers need it enabled. For more information, see Configure Shared-VM Plan settings.
Caution The Steeltoe connector for Redis requires Redis for Tanzu Application Service to support Lua scripting. Check if any of your apps require Lua scripting. By default, Lua scripting is deactivated for Redis for Tanzu Application Service, but an operator can change the setting to enable it by selecting the Lua Scripting checkbox in the Shared-VM Plan configuration pane.
The shared-vm plan cannot:
CONFIG
, MONITOR
, SAVE
, BGSAVE
, SHUTDOWN
, BGREWRITEAOF
, REPLICAOF
, SLAVEOF
, DEBUG
, or SYNC
This is the lifecycle of Redis for Tanzu Application Service, from an operator installing the tile, to an app developer using the service, to an operator deleting the tile.
Operators do the following to install Redis for Tanzu Application Service:
Configure:
Install Redis
After you click Apply Changes, Redis for Tanzu Application Service does the following:
After you have installed Redis for Tanzu Application Service, developers can create service instances, bind and unbind the service instances to apps, and delete service instances.
When a developer runs the cf create-service
command, for example:
$ cf create-service p-redis shared-vm mysharedinstance
Redis for Tanzu Application Service does the following:
When a developer runs the cf bind-service
command, for example:
$ cf bind-service my-application mysharedinstance
Redis for Tanzu Application Service does the following:
VCAP_SERVICES
environment variable and the app can talk directly to the Redis server inside the service instanceWhen a developer runs the cf unbind-service
command, for example:
$ cf unbind-service my-application mysharedinstance
Redis for Tanzu Application Service does the following:
VCAP_SERVICES
environment variableWhen a developer runs the cf delete-service
command, for example:
$ cf delete-service mysharedinstance
Redis for Tanzu Application Service does the following:
You do the following to delete Redis for Tanzu Application Service:
After you click Apply Changes, Redis for Tanzu Application Service does the following:
cf purge-service