Message
Author
Board
Date
January 22, 2025, 11:45:46 PM
January 22, 2025, 11:35:09 PM
January 18, 2025, 01:56:06 AM
January 18, 2025, 12:31:57 AM
January 15, 2025, 10:10:06 PM

SMF-Redis

Started by Chen Zhen, December 19, 2024, 01:07:50 AM

Previous topic - Next topic

Chen Zhen

SMF-Redis
Caching modification for the SMF 2.1 branch

[DOWNLOAD SMF-REDIS]

You must uninstall any previous version of SMF-Redis prior to commencing this installation.
It is also advisable to uninstall any other SMF modification that uses Redis or Predis from your SMF platform to avoid conflicts.

Redis
A key-value store that supports multiple data types, including lists and sets. Redis uses in-memory data storage to handle large amounts of real-time data.
This allows for fewer database accesses, which can improve performance and reduce latency.
You are required to have this server package available on your OS.

Predis
A Redis client written entirely in PHP. Predis uses PHP's autoloading features to load its files when needed.
This client package is included with SMF-Redis & communicates with the Redis server software.

PhpRedis
A PHP PECL extension for interfacing with the Redis server key-value stores.
Using PhpRedis is optional and requires PECL and a few other enabled PHP PECL modules to run on Apache/Nginx.



SMF-Redis modification

A flexible and feature-rich PHP Redis client for the SMF 2.1 branch.

This modification requires the Unix Redis Client to be installed on your server.
If you intend to use the PhpRedis(PECL) interface, you are also required to install PECL & PhpRedis on your server.

SMF-Redis supports both optional & required fields, including:
- Predis Client support
- PhpRedis PECL extension support
- TCP ports
- UNIX domain sockets
- persistent connections
- user authentication
- unique prefixes
- database keys
- connection timeouts



To enable & adjust this modification, navigate to: Admin -> Server Settings -> Caching & select Redis from the Caching Accelerator options.



For advanced users that require further configuration, there are functions located at the top of the Redis settings file at this path: ./Sources/Cache/APIs/Predis.php

[Predis]
The array within smf_redis_connection_params() can be altered for additional Predis parameters.
Please refer to the chart in this link for available configurations: Predis Connection Parameters
The additional settings only apply to Predis & will be ignored while PhpRedis(PECL) is enabled.



For secure connections using a password, ACL is the preferred method which requires a name & password combination.
If you need assistance regarding Redis ACL user commands, refer to the link shown below or post in the support board at web-decelop.ca.



[Information]

Redis (Remote Dictionary Server) is a source-available, in-memory storage, used as a distributed, in-memory key–value database, cache and message broker with optional durability.
It holds all data in memory and because of its design, Redis offers low-latency reads and writes, making it particularly suitable for use cases that require a cache.
Redis is the most popular NoSQL database and one of the most popular databases overall.

Installing Redis on Linux:
https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-linux/

Secure Redis with ACL user & password (only ACL configurations will work):
https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/

Installing PECL -> PhpRedis OPTIONAL
apt install pkg-php-tools
pecl install redis



[Credits]

Much appreciation goes out to the developers of Redis, Predis, PhpRedis & the original author of this modification.

SMF-Redis developer:
Chen Zhen [2024]

Redis Cache for SMF (Predis) developer:
Daniel Richt (original work) [2022]

Predis (Redis Client) developers:
Daniele Alessandri (original work) [2009 - 2020]
Till Krüss (modified work) [2021 - 2024]

PhpRedis(PECL) extension lead developers:
Michael Grunder and Pavlo Yatsukhnenko
The PHP Group

Redis developers:
Salvatore Sanfilippo [2009 - 2014]
Redis Labs (lead developer: Salvatore Sanfilippo) [2015 - 2020]
Redis (formerly Redis Labs) (lead developers: Yossi Gottlieb and Oran Agra) [2020 - 2024]