2.2.3. Redis

Redis (REmote DIctionary Server) is a fast data store like "key-value" in RAM. Redis, due to its simplicity and high speed of work, is used to organize caching, session management, systems "subscriberpublisher" and other tasks requiring maximum productivity. Unlike Memcache(d)Redis allows you to store not only strings, but also arrays, dictionaries, non-repetitive sets, sorted sets, and other data structures. It also supports transactions (when either all operations are performed sequentially, or none), batch processing of commands (first a series of commands are executed, then a series of results are obtained)

Important points:

  • The ordered volume is allocated to the entire hosting account without division by site. As part of a regular hosting, the maximum total volume is 512 MB (on business hosting under Redis, you can allocate up to 1/4 of the amount of RAM available at the rate).
  • On businesshosting You do not need to order Redis. It is available free of charge within the allocated amount of RAM.
  1. Open the section "Hosting".
  2. In the block "Extra services" click "Redis":
  3. In the drop-down list, select the required amount of memory and click "To order" (if the system informs about the presence of an unpaid order, in the text of this notification click "undo"and then repeat the order):
  4. If this is the first time ordering the service, skip this step to use free 7-day trial period... Otherwise, pay automatically generated invoice any of available ways and wait for the payment to be credited.
  5. Wait approximately 30 minutes for the service to activate.
  6. Configure Redis on the right sites.
To work with Redis from PHP, the Redis PHP module is installed on the hosting.

Attention!

On business hosting, it should be borne in mind that if the maximum memory value is selected in the Redis settings, but part of the memory is consumed by other scripts, then the module will not be able to consume all the memory selected in the settings and will overwrite the oldest data in the cache. Therefore, when configuring, it is recommended to reserve part of the memory for the scripts.

To connect to the Redis server, you need to use the socket address specified in the section "Redis statistics":

Instructions for setting up Redis in various CMS and frameworks:

You can test how Redis works with this script.
The information is updated every time you open the statistics page in the control panel.

To view statistics on Redis usage, see "Hosting" in the block "Extra services" click "Redis statistics":

Example statistics:

There are several ways to clear the Redis cache:

  • Through the control panel — use the button "Clear cache" in the upper right corner statistics.
  • Across Telegrambot — in the bot menu select "Hosting → Hosting account → your hosting account → Clear cache → Clear Redis cache".
Content