Resource icon

Zend Redis Cache 1.6.0

No permission to download
An FYI but redis is absolutely affected by the recent meltdown/spector CPU design faults; https://gist.github.com/antirez/9e716670f76133ec81cb24036f86ee95

Patched hypervisor, unpatched guest:
Code:
Pipelined:
SET: 602772.75 requests per second
GET: 1012145.75 requests per second

Not pipelined:
SET: 170590.25 requests per second
GET: 159261.03 requests per second

Patched hypervisor, patched guest:
Code:
Pipelined:
SET: 554631.19 requests per second
GET: 857632.94 requests per second

Not pipelined:
SET: 121285.63 requests per second
GET: 119502.87 requests per second

This add-on (and my redis add-ons) use pipelining when dealing with multiple redis instructions, and use lua to reduce the required redis instructions where possible.

But I don't think anyone is going to care about dropping from 159261 requests/s to 119502 requests/s (or ~30% hit) , the new redis connection per request will be a bigger issue :p

Ended up having this issue pop back up, created local read only slaves and the issue is gone. I think there may have been some latency created by the large number of requests to that single instance. Has been error free for a few days now!
It also dramatically reduces the amount of traffic the master-redis instance needs to handle.
 
Yes, it is possible, use this stanza in $config['cache']['config'] configuration block;

Code:
'server' => 'unix:///home/pathtoyoursocket.sock',

Is this also valid for 1.x version?

I couldn't make it work.

Thanks.
 
Is this also valid for 1.x version?

I couldn't make it work.

Thanks.
Both XF1 & XF2 use the same redis library

XF1:
Code:
$config['cache']['backendOptions'] = array(
        'server' => 'unix:///tmp/redis.sock',
// ....
);

XF2:
Code:
$config['cache']['config'] = array(
        'server' => 'unix:///tmp/redis.sock',
// ....
);

(just tested this in my dev environment)
 
Thanks for the reply.

With that line I am getting the error below:

Connection to Redis /tmp/redis.sock: failed after 2 failures.Last Error : (1) Redis::connect(): connect() failed: No such file or directory - library/Redis/lib/Credis/Client.php:475
But redis seems to be configured to accept connections from /tmp/redis.sock

23384:M 08 Mar 22:30:50.902 * The server is now ready to accept connections at /tmp/redis.sock
 
@estranged please check the permissions on the /tmp/redis.sock file. It needs to read/writable to whatever use php is running as.

By default the redis sock is only usable by the redis user
 
Can you start a conversation with me and include more of your config.php? I will need to see the entire
$config['cache']['backendOptions'] block.

But this indicates php can't open the file, there isn't much beyond I can recommend. Try doing;
Code:
sudo -u <php user> bash
ls -lah /tmp/redis.sock
(Replace <php user> with the username of the user php runs under)
And see what the php user sees.
 
@estranged this might be a long shot, but using the default Redis from Xenforo, this is what worked for me when using a socket. Maybe you can use it in Xons?

Code:
'host' => '/home/pathtoyoursocket.sock',
'port' => 0,
 
Just installed it, working perfect. For some reason memcached is slower on my server then no cache, but faster with this ;)

Has it been tested with php redis 4.0.0 ? My server automatically updates to new pecl versions but is still in beta.. Version 3.1.6 is stable.

Edit: found answer in the xf2 version. 3.1.6 it will be until 4.0.0 is stable.
https://xenforo.com/community/threads/redis-cache-by-xon.132179/page-5#post-1230710
 
Last edited:
Can you start a conversation with me and include more of your config.php? I will need to see the entire
$config['cache']['backendOptions'] block.

But this indicates php can't open the file, there isn't much beyond I can recommend. Try doing;
Code:
sudo -u <php user> bash
ls -lah /tmp/redis.sock
(Replace <php user> with the username of the user php runs under)
And see what the php user sees.

This is the output.

srwxrwxrwx 1 redis redis 0 Mar 10 14:55 /tmp/redis.sock
Thanks for your help.

I give up. :)
 
This is the output.


Thanks for your help.

I give up. :)
I've updated the FAQ with some bits about using sockets;

Q. When trying to use a socket, an exception with "No such file or directory" is thrown
A. There are a few reasons this could happen;

After confirming that the socket path is correct, try the following suggestions:
  • selinux is preventing php from accessing the socket.
  • open_basedir is preventing php from accessing the socket.
  • chroot is preventing php from accessing the socket.
  • permissions are preventing php from reading/writing to the socket.

TCP is just easier and doesn't make a huge performance impact anyway.
 
How much of a performance increase does this add-on provide? And does it require any "special" server setup? Also, how do I check if I have phpredis installed?

I'm running a fully dedicated Ubunto 16.04 server with PHP 7.0.28 and Plesk Onyx. Thanks!
 
This add-on requires redis to be setup, and offers effectively the same performance benefits as memcache. The major difference is I have add-ons which built off Redi's advanced functionality which memcache can't (easily, or at all) achieve.

Additionally, Memcache php extensions are generally horrible unmaintained things.

Actual server setup is well outside of this add-on's offered support.
 
I'm running a fully dedicated Ubunto 16.04 server with PHP 7.0.28 and Plesk Onyx. Thanks!
It's super simple to setup with Plesk. Add the Docker extension if you don't already have it and install the official redis container. Just be sure to take note of the values that need to be configured in the FAQ of this add-on. If you do that you'll be functional.

Since it's so easy with Plesk, just try it and see what sort of performance benefits you get, if you don't see much, it's as simple as deleting the docker container.

Personally, I run a server that is overpowered, and utilize Cloudflare as a reverse proxy/cache, so I don't really feel the need for redis anymore, but it used to run great on XF1. Just be aware that even when correctly configured, it can be prone to generating a lot of server errors.
 
I think I'll pass on Redis. My server is quite stout, and I have it running perfectly. Don't want to install anything else server side if not required...
 
Top Bottom