๐Ÿ—„๏ธ Redis

On this page, you will find everything you need to know about the redis add-on.

#Information

The Redis add-on caches player data in Redis and keeps it in sync across a network of servers, so keys, cooldowns and win limits stay consistent as players move between them.

๐Ÿ‘‰ You can purchase this add-on on Phoenix Plugins

#Installation

To install this add-on, you can either:

  • Drag and drop the jar file into the PhoenixCrates/addons folder, then restart your server.
  • Download the plugin with the add-on selected during the downloading.

#Redis

Redis sits in front of your database, it does not replace it.

On the first start it generates a redis.yml file in the plugin's folder, where you set your connection details.

circle-exclamation

You still need MySQL configured. Redis is only the cache and locking layer, all data is still written to the database.

#Player Locking

While a server is handling a player, it holds a lock on that player in Redis so no other server can write their data at the same time. The lock is refreshed for as long as the player is online, and released when they leave or when the server shuts down.

If a lock cannot be obtained in time, the change is written straight to the database instead, so no rewards or keys are lost.

#Settings

Setting Description
Host / Port / Password / Database The connection details of your Redis server.
Connection Pool The maximum, idle, and minimum number of connections kept open. Default is 8, 8, and 0.
Key Prefix The prefix used for every key the add-on writes. Default is phoenixcrates.
Data TTL How long, in seconds, cached player data is kept. Default is 3600.
Lock TTL How long, in seconds, a player lock stays valid without a refresh. Default is 15.
Heartbeat Interval How often, in seconds, held locks are refreshed. Default is 5.
Lock Poll Interval How often, in milliseconds, a server retries while waiting for a lock. Default is 200.
Max Lock Wait How long, in milliseconds, to keep waiting for a lock before giving up and writing straight to the database. Default is 15000.
Debug Logs every cache and lock operation to the console. Disabled by default.
lock:
  heartbeat-interval-seconds: 5
  ttl-seconds: 15
  poll-interval-ms: 200
  max-wait-ms: 15000

circle-info

The two lock timing options are not written into redis.yml when the file is first created. Add them yourself if you need to change them from the defaults above.

circle-info

If the connection to Redis fails on startup, the add-on logs a warning and the plugin keeps running on the database alone.

Last updated 18 days ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy