Redis is an open source
key-value cache and
non-SQL database released under the BSD license.
The configuration file can be downloaded using the command:
The recommended way to host a Redis server on Serv00.com is unixsocket. This is a special file through which the Redis server and the application communicate with each other.
To configure the server to be accessible via unixsocket, set the following variables in the
- port to
- unixsocket to
- LOGIN is the name of the hosting account
- DOMAIN is the domain of the site that Redis is running on.
If no password is set, each Serv00.com hosting user will have access to the cache system and its contents.
To define the password for the Redis server, enter it after the phrase
requirepass in the
redis.conf configuration file.
After setting the service to a given port, unless the listening configuration file is limited to
127.0.0.1, the cache system will be available remotely - so it is absolutely necessary to set the access password!
To configure the server to be accessible via a port, you must first reserve a
TCP port. Then you need to set the
port variable in the
redis.conf file to
reserved port number.
By default, Redis listens on all network interfaces. To restrict listening to localhost, set the
bind variable in the
redis.conf file to
Persistence, i.e. database resilience in the case of Redis, has 2 mechanisms:
AOF. Each of them is configurable, which is described below. Both can be turned on or both off.
By default, all the files listed below are saved to the location from which the Redis server was started.
RDB (Redis DataBase) consists in dumping the database from RAM periodically and after a certain number of changes to the database. The default configuration saves the database to a
dump.rdb file which:
- every 900 seconds (15 minutes), if there was at least one change (in the configuration it is the line:
save 900 1),
- every 300 seconds (5 minutes) if there were at least 10 changes (
save 300 10),
- every 60 seconds if there have been at least 10000 changes (
save 60 10000).
The name of the file where the database is dumped is defined by the
RDB remove the
save lines from the configuration.
AOF (Append Only File) is about writing
write commands (those that change data). The default configuration does not use the
AOF mechanism. A file created in this way can be many times larger than the size of the database. The name of the AOF file is defined by the
It is possible to reduce file size by rebuilding the
AOF file without breaking Redis.
To enable AOF change
To start the Redis server, use the command:
screen redis-server redis.conf
On Serv00.com servers,
Redis is also available from PHP using the appropriate module.