As stated before, Redis is an excellent choice for storing sessions - especially if your hub/site is slightly larger and has got more than a few users. Here’s a part of the configuration:
/etc/redis/redis.conf
bind 127.0.0.1 -::1 unixsocketperm 770 unixsocket /run/redis/redis.sock maxmemory 64MB maxmemory-policy noeviction
The configuration has lots of options. Fortunately, most default options are perfectly fitting. I’ve set three options:
bind
: The TCP/IP address Redis listens to. In this case, only localhost (V4 and V6)unixsocketper
: That way processes belonging to theredis
group are able to read/write to Redis’s unix socket (unixsocket). Theoretically there would be no need for TCP/IP, if the user running PHP belongs to the Redis group. ⚠️However, I found some problems when setting this to hubzilla’s .htconfig.php, so beware!maxmemory
: Depends on the size of your size, probably 32MB or less would be enough. However, if Redis’ memory is exhausted, no new sessions can be stored - because ofmaxmemory-policy
. Otherwise, Redis would choose which sessions to evict from it’s database, which could be bad idea.